This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wl,<options> mechanism
- From: "Tal Agmon" <Tal dot Agmon at nsc dot com>
- To: "Jim Wilson" <wilson at specifixinc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 6 Nov 2003 16:14:05 +0200
- Subject: Re: -Wl,<options> mechanism
Tal Agmon wrote:
>> I'm using GCC version 3.3.2, the target is i686-pc-linux-gnu.
>> It seems that the -Wl,<options> command option is not working correctly
:
Jim Wilson wrote:
>It is hard to understand what you are complaining about. Your message
>is not very clear. Please give an example.
Example :
I have a library named kuku.a in my working directory and in the library
default search path.
I want the linker to link with kuku.a which is in my working directory.
So, I did the following:
gcc -Wl,-L. program.c
Verbose shows the following linker command:
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local
/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtbegin.o
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../.
./../../i686-pc-linux-gnu/lib
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../.. /tmp/cckXmzup.o -L.
-lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr
/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtend.o /usr/lib/crtn.o
Please note that my working directory is searched last so the linker finds
first kuku.a from
the default search path and links it.