PATCH: Support libtool -no-undefined under GNU/Linux.

Alexandre Oliva aoliva@redhat.com
Wed Feb 7 01:41:00 GMT 2001


On Feb  7, 2001, Mark Mitchell <mark@codesourcery.com> wrote:

Alexandre> If they use libtool, it will just work, because, without
Alexandre> -no-undefined, libtool will just create static libraries on these
Alexandre> platforms, that should work in this case.

> That's false on AIX.  We do create a shared library, even when
> -no-undefined is not present.

Indeed.  Because allow_undefined is set on AIX.  On MS-Windows and old
versions of BeOS, this was just unsupported, and static libraries
would get built.  I got confused, sorry.

> So, it would be really good if libtool would support -no-undefined
> usage on GNU/Linux.  If that means working around a GNU linker bug,
> isn't that the sort of thing libtool is supposed to do?

Yep.  I'm convinced.  I'll gladly accept patches that arrange for
libtool to use, in decreasing order of preference:

`${wl}--no-undefined', if running `$LD --no-undefined -shared -o
conftest -lc' works, otherwise

`${wl}--no-undefined ${wl}--allow-shlib-undefined', if running `$LD
--no-undefined -shared -o conftest -lc' works, otherwise,

empty, if everything else fails.

I'd rather not explicitly link libraries against /lib/ld-linux.so.*,
because this would introduce an unnecessary and possibly incorrect
dependence of the library being created on /lib/ld-linux.so.*.

If nobody beats me to it, I'll probably implement this myself some
day.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


More information about the Gcc-patches mailing list