This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: order of arguments on command line when linking
- From: "Erik Poupaert" <erik dot poupaert at chello dot be>
- To: <tromey at redhat dot com>,"Clemens Eisserer" <Linuxhippy at web dot de>
- Cc: <java at gcc dot gnu dot org>
- Date: Sun, 16 Feb 2003 23:25:28 +0100
- Subject: Re: order of arguments on command line when linking
>>>> There are various ways to handle this. One is to order things
>>>> carefully. Another is to have the linker search the libraries
>>>> multiple times; see the ld manual.
Thanks, Tom.
I finally got myself to reading the gcc and ld man pages which contain the
solution:
-Xlinker --start-group myarc1.a myarc2.a myarc3.a -Xlinker --end-group
-Xlinker passes the next argument to ld
everything between --start-group and --end-group will be searched repeatedly
as needed.
That spares me indeed from ordering libraries carefully. And it also solves
cases where libraries recursively depend on each other.