This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ -static-libgcc not working (g++ 3.0.4).


Phil Edwards wrote:
On Thu, Sep 05, 2002 at 07:06:19PM +0200, jean-frederic clere wrote:

But that did not help because g++ puts -lgcc -lstdc++ after my:
-Wl,"-Bstatic" -lstdc++ -lgcc -Wl,"-Bdynamic"

The libraries are searched in the order that they are listed.
So I would except that the -static-libgcc do a:
-Bstatic -lstdc++ -Bdynamic -lm -Bstatic -lgcc -Bdynamic -lc -Bstatic
-lgcc
instead of:
-lstdc++ -lm -lgcc -lc -lgcc

BTW To get the link done I have to give the -lm option twice because the first one is ignored (the same for -lc)
+++
g++ -v -o htdig -static-libgcc -L../htlib -L../htcommon -L../db/dist -L/usr/lib
Document.o HTML.o Images.o Parsable.o Plaintext.o Retriever.o SGMLEntities.o Server.o URLRef.o htdig.o ExternalParser.o PDF.o ../htcommon/libcommon.a ../htlib/libht.a ../db/dist/libdb.a \
-lz -lnsl -lsocket \
-Wl,"-Bstatic" \
-lstdc++ -Wl,"-Bdynamic" -lm -lm -Wl,"-Bstatic" \
-lgcc \
-Wl,"-Bdynamic" \
-lc -lc \
-Wl,"-Bstatic" \
-lgcc
+++


BTW why "-lgcc -lc -lgcc", something wrong in the configure of gcc?

Nope.  That's normal.  (Libraries are searched in the order that they
are listed.  libgcc creates a references to something needed from libc,
and in fulfilling that requirement, libc needs something from libgcc that
wasn't needed previously.)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]