Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvlx.cv.hp.com!tomg From: tomg@hpcvlx.cv.hp.com. (Thomas J. Gilg) Newsgroups: comp.windows.x Subject: Re: URGENT!!: Problems with build of X11R4!! Message-ID: <100920327@hpcvlx.cv.hp.com.> Date: 21 Jun 91 21:28:05 GMT References: Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 42 > We are trying to build the MIT source for X11R4. Everything seems > to build fine but when we try to build some X applications using > the libraries, we get: > > ld warning: Symbol _qfree will link to shared library > ld warning: Symbol _XHeadOfDisplay will link to shared library > ld warning: Symbol _Xdebug will link to shared library > ld warning: Symbol _XIOErrorFunction will link to shared library > ld warning: Symbol _XErrorFunction will link to shared library > ld warning: Symbol XrmQString will link to shared library You've run into a Domain/OS shared library quirk. If you look at globals.c, you'll see _qfree, _XHeadOfDisplay, _Xdebug, _XIOErrorFunction, and _XErrorFunction declared _but not initialized_. Variables declared but not initialized get put into the BSS segment rather than the DATA segment and are implicitly initialized to zero. Ditto this for XrmQString in Xrm.c The quirk; for Domain/OS shared libraries, uninitialized variables act like initialized variables in that they are explicitly set to zero. When linking an application against libX11.a, the linker first finds the implicitly initialized variables in libX11.a, _but then it continues_ to search for someone who might have explicitly initialized these same variables. After passing through the link line, it scans the globally known libraries (see /etc/sys.conf), finds the 6 symbols in /lib/x11lib, and takes those over the previous versions it found. Here's the fix: For globals.c, set/abuse the define flag NULL_NOT_ZERO. When the first five symbols are declared, they will be initialized to 0/NULL. For Xrm.c, take advantage of the predefined "NULLQUARK" and change the declaration of XrmQString to "XrmQuark XrmQString = NULLQUARK;" ----------------------------------------------------------------------- Thomas Gilg | tomg@cv.hp.com | INTERNET Hewlett-Packard Company | {backbone}!hplabs!hpcvlx!tomg | UUCP 1000 N.E. Circle Blvd. | (USA) (503) 750-2756 | VOICE Corvallis, OR 97330 | (USA) (503) 750-3788 | FAX -----------------------------------------------------------------------