GNU/Linux vs. libtool --no-undefined
Andreas Schwab
schwab@suse.de
Tue Feb 6 05:14:00 GMT 2001
Mark Mitchell <mark@codesourcery.com> writes:
|> First, libtool didn't actually do anything with --no-undefined on
|> GNU/Linux. It took a while to figure that out.
|>
|> Second, I get:
|>
|> /lib/libc.so.6: undefined reference to `_dl_init_next@GLIBC_2.0'
|> /lib/libc.so.6: undefined reference to `_dl_lazy@GLIBC_2.1.1'
|>
|> These symbols are defined in ld-linux.so. Is it reasonable to link
|> against that library, or is that harmful? I know it isn't necessary,
|> but does it hurt?
You should never link against /lib/libc.so.6 directly, but only via
/usr/lib/libc.so (which is a linker script that includes the necessary
libraries). This takes care of linking in ld-linux*.so.* (using the
correct name, which differs among architectures) and libc_nonshared.a
(which defines some symbols that must not be defined by libc itself).
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
More information about the Gcc
mailing list