#554 Linux binary should be 'dynamic' by default

release
closed-fixed
9
2006-11-22
2006-10-07
No

http://www.nedit.org/pipermail/discuss/2006-October/008740.html
http://www.nedit.org/pipermail/develop/2006-October/012566.html

Thomas Orgis brought up the point in the mailing list
that NEdit's linux binary should be dynamically linked
to the motif library by default.

The old LIBS setting should be kept (commented out) for
those who wants to have static builds.

Discussion

  • Scott Tringali

    Scott Tringali - 2006-10-13

    Logged In: YES
    user_id=11321

    I have a fix.

     
  • Scott Tringali

    Scott Tringali - 2006-10-13
    • assigned_to: ajhood --> tringali
     
  • Scott Tringali

    Scott Tringali - 2006-10-26
    • status: open --> open-fixed
     
  • Scott Tringali

    Scott Tringali - 2006-10-26

    Logged In: YES
    user_id=11321

    Fixed in CVS. (I'm leaving this open to make preparing
    release notes easier, so you can query recently fixed bugs
    by the status. If you don't care, close it.)

    I added a new makefile target linux-static rather than
    adding comments in the makefile.

     
  • Andrew Hood

    Andrew Hood - 2006-11-21

    Logged In: YES
    user_id=36856
    Originator: NO

    The following patch, inlined as SF does not seem to want to let me attach it, is not Linux specific. It applies to any build using a shared libXm.

    It will have NEdit check that the runtime *tif is the same as the build *tif. It doesn't stop NEdit running, but pops up a dialog emphasises that we are not interested in debugging unmatched versions.

    The various makefile/Makfile.<opsys> files need -DHAVE__XMVERSIONSTRING added to CFLAGS. Every *tif I've tried (AIX, Solaris, OpenMotif, LessTif) has this exported from libXm. This is left as an exercise for those on other platforms.

    ===========================================

    *** source/nedit.c.20060930 Sat Sep 30 23:23:14 2006
    --- source/nedit.c Sun Oct 8 14:36:24 2006
    ***************
    *** 49,54 ****
    --- 49,55 ----
    #include "parse.h"
    #include "help.h"
    #include "../util/misc.h"
    + #include "../util/DialogF.h"
    #include "../util/printUtils.h"
    #include "../util/fileUtils.h"
    #include "../util/getfiles.h"
    ***************
    *** 379,384 ****
    --- 379,388 ----
    "[Sorry, no on-line help available.]\n"; /* Why is that ? */
    #endif /*VMS*/

    + #ifdef HAVE__XMVERSIONSTRING
    + extern char _XmVersionString[];
    + #endif
    +
    int main(int argc, char **argv)
    {
    int i, lineNum, nRead, fileSpecified = FALSE, editFlags = CREATE;
    ***************
    *** 488,493 ****
    --- 494,511 ----
    TheDisplay,
    NULL,
    0);
    +
    + #ifdef HAVE__XMVERSIONSTRING
    + /* Warn user if build and runtime don't match . */
    + if (strcmp(XmVERSION_STRING,_XmVersionString)) {
    + DialogF(DF_ERR, TheAppShell, 1, "Version Mismatch",
    + "\nThis NEdit was built with a different Motif "
    + "(%s) to the runtime version (%s).\n"
    + "Please do not report any bugs you encounter unless you "
    + "can reproduce them with matched build and runtime.\n",
    + "OK", XmVERSION_STRING, _XmVersionString);
    + }
    + #endif

    /* Restore the original bindings ASAP such that other apps are not affected. */
    restoreInsaneVirtualKeyBindings(invalidBindings);
    *** source/help.c.20051231 Sat Dec 31 18:36:46 2005
    --- source/help.c Sun Oct 8 13:20:25 2006
    ***************
    *** 224,229 ****
    --- 224,235 ----
    "file a bug report with them asking them to build NEdit with a "
    "known-good version of Motif.\n";

    + #ifdef HAVE__XMVERSIONSTRING
    + static const char *const version_mismatch =
    + "\nThis NEdit was built with a different version of Motif to the "
    + "runtime version. Please do not report any bugs you encounter "
    + "unless you can reproduce them with matching build and runtime.\n";
    + #endif

    static const char *getBuildInfo(void)
    {
    ***************
    *** 264,270 ****
    usingDefaultVisual ? ", Default" : "");
    }

    ! bldInfoString = XtMalloc(strlen(bldFormat) + strlen(warning) + 1024);
    locale = setlocale(LC_MESSAGES, "");

    sprintf(bldInfoString, bldFormat,
    --- 270,280 ----
    usingDefaultVisual ? ", Default" : "");
    }

    ! bldInfoString = XtMalloc(strlen(bldFormat) + strlen(warning)
    ! #ifdef HAVE__XMVERSIONSTRING
    ! + strlen(version_mismatch)
    ! #endif
    ! + 1024);
    locale = setlocale(LC_MESSAGES, "");

    sprintf(bldInfoString, bldFormat,
    ***************
    *** 283,288 ****
    --- 293,303 ----
    if (stab == MotifKnownBad)
    strcat(bldInfoString, warning);

    + #ifdef HAVE__XMVERSIONSTRING
    + if (strcmp(XmVERSION_STRING,_XmVersionString))
    + strcat(bldInfoString,version_mismatch);
    + #endif
    +
    atexit(freeBuildInfo);
    }

     
  • Nobody/Anonymous

    Logged In: NO

    A great idea. On the other hand, it should be possible to turn off the warning with a NEdit preference setting, accessible through the dialog you display. This setting should hold all versions of run-time motif with which the user is happy, and once set the dialog should no longer appear. Otherwise we'd be penalising users every time they open NEdit: a real turn-off.

     
  • Thorsten Haude

    Thorsten Haude - 2006-11-22

    Logged In: YES
    user_id=119143
    Originator: YES

    Do you propose to add this before the release? Could you open a new tracker item then?

     
  • Thorsten Haude

    Thorsten Haude - 2006-11-22
    • status: open-fixed --> closed-fixed
     
  • Scott Tringali

    Scott Tringali - 2006-11-27

    Logged In: YES
    user_id=11321
    Originator: NO

    I have a few issues with this:

    1) It's probably too overzealous. On most systems besides Linux, they take binary compatablility seriously and this isn't a problem. For example, I remember some (IRIX?) systems have Motif 1.2.3 and other have 1.2.4, and it works fine. We have knowingly taken advantage of this in the past years by building a single binary. We should only do this check on systems that are known to be troublesome.

    Further, it's likely to kill nedit when people do upgrades. Imagine nedit built against a version of lesstif. They do a 'yum update' or whatever to get a new lesstif, and now nedit is dead. Even if the two are compatible.

    2) It's likely this should not use a dialog. If Motif is messed up, then it doesn't seem that using a Motif dialog is a good idea. Case in point: mixing OpenMotif and LessTif. You'll crash hard. It would be better to print this on standard error and exit.

    I suggest:

    A) If it's a severe mismatch (LessTif vs. OpenMotif) then printf to stderr and exit. Check this early because any Motif calls are likely to die.

    B) If it's a major mismatch (1.2. vs 2.0), I'm not sure.

    C) If it's a minor mismatch (1.2.3 vs. 1.2.4) then don't complain.

    In short, please keep the warning thing separate from this.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks