[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should libtool link in libgcc when building a shared library?
From: |
Steve Ellcey |
Subject: |
Re: Should libtool link in libgcc when building a shared library? |
Date: |
Wed, 23 Mar 2005 15:25:05 -0800 (PST) |
> From: Bob Friesenhahn <address@hidden>
>
> >From the beginning, libtool took the approach that it knew best. It
> would glean the list of libraries that the compiler would supply,
> extend the list, and then do the link using the system linker.
>
> More recently, libtool has started to change its approach. For C++,
> linking is already done using the compiler. I believe that this has
> started to change for C as well. It is a gradual process since care
> must be taken to not break something which already works.
But when it uses the C++ compiler (and that compiler is GNU g++), does
it also use -nostdlib? It looks to me like it does, but I could be
wrong. I.e. I look at the file libtool.m4 from libtool 1.5.10, and I
see:
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects
$libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o
$lib'
It uses the compiler to link but it also uses -nostdlib and so we are
not using the compiler to automatically link in any libraries. It is
the use of -nostdlib that I am most interested in. Will that usage
continue?
Steve Ellcey
address@hidden