Article View: comp.soft-sys.andrew
Article #2095Re: Statically linking "runapp" (was Re: Trouble with 'set hold')
From: Tom Crockett
Date: Thu, 22 Feb 1990 15:23
Date: Thu, 22 Feb 1990 15:23
55 lines
2879 bytes
2879 bytes
Excerpts from info-andrew: 13-Feb-90 Statically linking "runapp".. Guy
Harris@uunet.uu.net (679)
> >I finally got Andrew Release 3 up and running -- seems the Imakefiles
> >neglected to put in some "-Bstatic" options in the right places in the
> >Makefiles. The places I know about are atk/apps (for runapp) and
> >atk/ness/objects (for nessrun). Are there any others I may have
> >missed?
> Err, umm, why do you want to build "runapp" statically? I modified the
> Imakefile too, but I did it to link with "-lX11" rather than
> "/usr/lib/libX11.a", so that it would pick up the *shared* "libX11";
> heck, even if I run *no* non-Andrew X11 applications other than the
> window manager, I still get some sharing, and there will be other
> non-Andrew X11 applications that I'd run, I suspect....
Well, I've been running some further experiments with my static vs.
dynamic linking problem on SPARCstations. It turns out that the only
library I have to link in statically to runapp is -lm. With -lm
dynamically linked, many of my Andrew apps core dump before ever
displaying a window. With it statically linked, everything seems to run
just fine. Beats the heck out of me -- maybe I have a damaged version
of the shared math library.
I also looked at the relative sizes of some things when using dynamic
vs. static linking. For my test case, I had the following X clients
active, which is reasonably representative of my usual working
environment:
twm
xterm (2)
xman
xload (2) running on remote machines
console
bush
ez (2)
messages
For purposes of comparison, everything was iconified except console and
the two xterms.
I made the modification Guy suggested, substituting -lX11 for
/usr/lib/libX11.a in the Makefile. I then built two versions of runapp,
one using -Bstatic for all of the libraries, and one using it only for
the troublesome -lm. Much to my surprise, the completely static version
used about 900K less swap space, as reported by "pstat -T". messages
itself was well over 600K smaller (SZ field from "ps aux") in the static
version.
Does anybody have a good explanation for this? I rebuilt runapp a
couple of times each way, just to be sure I hadn't made any mistakes
about which version was which.
-Tom
Technical Details
Message-ID:
<AZt0Dqr0_csmJfnV9c@sparc01.icase.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ns-mx!iowasp!deimos!ux1.cso.uiuc.edu!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!ucbvax!sparc01.icase.edu!tomReferences:
<2932@auspex.auspex.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ns-mx!iowasp!deimos!ux1.cso.uiuc.edu!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!ucbvax!sparc01.icase.edu!tom From: tom@sparc01.icase.edu (Tom Crockett) Newsgroups: comp.soft-sys.andrew Subject: Re: Statically linking "runapp" (was Re: Trouble with 'set hold') Message-ID: <AZt0Dqr0_csmJfnV9c@sparc01.icase.edu> Date: 22 Feb 90 15:23:34 GMT References: <2932@auspex.auspex.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 55