>>>> "Martin" == Martin Buchholz
<martin(a)xemacs.org> writes:
Martin> In 21.2 there has been a fair amount of effort to make sure that your
Martin> run-of-the-mill lib-src binary is not linked with any X stuff, and
Martin> that gnuserv is linked with those X libs, and only those X libs,
Martin> required for its `xauth' feature.
Hmmm... Perhaps it does the "right thing" on some OS but not others?
Could it be the `ld' thing I asked about? Perhaps some vendor's `ld'
will not link everything you list, but only the ones actually
referenced? (Unless you give it a DWIS switch, perhaps, in some
ideal universe?)
Martin> It seems to me that 21.2 is working exactly as designed. A quick look
Martin> at 21.1 suggests that it is doing the same thing. I vaguely remember
Martin> having implemented this stuff years ago.
Martin> Please let me know exactly what is broken for you.
I'll have to double check... Ok; just did...
All of the "lib-src" binaries aside from the `gnus*' are compiled
with ${ldflags} on the CC line. ${ldflags} is built using
${ld_libs_general}, which looks like:
ld_libs_general=-ldl -ldb -lgpm -lncurses -L/usr/lib -lesd -laudiofile -lm -lpq -lldap
-llber -lm -lutil -lgcc -lc -lgcc /usr/lib/crtn.o
... in the "lib-src/Makefile" for the XEmacs I'm typing in right
now...
Hmmm. `ldd' shows them *not* to be linked to all that stuff
though... Ah, ok. I just looked again... in the GNUMakefile... I
have that `ld_libs_general=' line sharped out, like in the patch for
"lib-src/Makefile.in.in" I pasted when I asked the questions that
started this thread. Prior to that, all of them, shown by `ldd'
output, had been linked to everything in that ${ld_libs_general=}
list.
So, I conclude that we should patch it out, at least on GNU/Linux.
The question remains: will it still work right on other OS then?
Martin> Xauth requires Xau, which requires Xt, which requires X11, which
Martin> requires ICE and SM... (maybe). Check out the dependencies using ldd
Martin> (I haven't).
If a shlib does *not* have a `ld' link against a library it calls a
routine from, but a final binary links that called-on library itself,
does everything just work, or must the shlibs be built with explicit
interdependancy information specified on the link command line? How
and where could I find the answer to that question and others it may
bring up (ones an instructor or tutor would lead me to ask) without
asking in *this* mailing list? ;-) Yous seem like the types who
don't mind my questions overmuch...
Hmmm... lemme think... Seems like the interdependancies probably
have to be declared explicitly when the shlib is linked, so that the
shlib itself can be link editted at initial mmapping time. Is that
right? If so, then using `ldd' on those shlibs _will_ produce a
valid answer to the question of whether `gnuserv' and `gnuclient' are
linking only required libraries. 8-)
Alright... what I want is libXau and anything it requires plus
anything they require...
Ok. The results. On my Debian GNU/Linux "Woody" machine, with
XFree86-4.0.1 prerelease test packages installed, I find that only a
static ("*.a") Xau is installed, and it comes from the `xlibs-dev'
package...
bittersweet% dpkg --status xlibs-dev
Package: xlibs-dev
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 76292
Maintainer: Branden Robinson <branden(a)debian.org>
Source: xfree86
Version: 4.0.1-0phase2v12
Replaces: xbase (<< 3.3.2.3a-2), xdevel, xpm4g-dev, xmanpages, xlib6g-dev (<<
4.0), xlib6g-static
Provides: libxpm4-dev, xmanpages
Depends: xlibs, libc6-dev
Conflicts: xdevel, xlib6g-dev (<< 4.0), xlib6g-static, xpm4g-dev, xmanpages
Description: X Window System client library development files
xlibs-dev provides static versions of the libraries provided in xlibs, as
well as several libraries that do not exist in shared object form for various
reasons (such as the fact that their API's have not stabilized). Include
files and manual pages are also provided.
.
The libraries only available in static form include libFS, libXau,
libXdmcp, libXfontcache, libXinerama, libXss, libXv, libXxf86dga,
libXxf86misc, libXxf86rush, libXxf86vm, libfntstubs, liboldX,
libxf86config, libxkbfile, and libxkbui.
Checking on a Debian 2.2 (Potato) machine reveals that with
XFree86-2.2.6, the package name is `xlib6g-dev', but the situation is
the same in that there is *only* a static libXau.a provided.
Using `ldd' on "libXau.a" produces "Not a dynamic executable".
Linking `gnuserv' and `gnuclient' without anything specified but
-lXau produces working executables. 8-)
I will submit a patch and ChangeLog to the patch queue shortly.
KMH> A question about `ld' now... Is there a reason why, other than
"it's
KMH> just not implemented" that `ld' cannot or does not remove depends on
KMH> libs that are not actually used by any particular binary?
Martin> Computer programmers are idiots. (Actually, that's not true.
Martin> Computer programmers are selfish. Why should they invest X units of
Martin> effort to save future programmers 10X of effort, especially when they
Martin> have a manager breathing down their necks? This is one of the main
Martin> reasons free software has a chance - we *care*.)
Uh, yeah, Martin. Sure. <backs away slowly>
--
Smarter than a phoo phish am I, soon freed when be I weird.
Hight karlheg, hailing from
deB.ORG, am I. Freed will you be.
mailto:karlhegļ¼ debian.org (Karl M. Hegbloom)