This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: multiarch proposal
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: goswin-v-b at web dot de (Goswin von Brederlow)
- Cc: paul at codesourcery dot com (Paul Brook), goswin-v-b at web dot de (Goswin von Brederlow), binutils at sourceware dot org
- Date: Sun, 4 May 2008 00:47:12 +0200 (CEST)
- Subject: Re: multiarch proposal
Goswin von Brederlow wrote:
> For reference: gcc on amd64 uses
>
> /usr/bin/ld --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o foo /usr/lib64/crt1.o /usr/lib64/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.2.3/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3 -L/usr/lib64 -L/lib64 -L/usr/lib64 -L/usr/x86_64-linux-gnu/lib -L/usr/lib foo.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.2.3/crtend.o /usr/lib64/crtn.o
>
> /usr/bin/ld --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o foo /usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.2.3/32/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3/32 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3/32 -L/usr/lib32 -L/lib32 -L/usr/lib32 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.2.3 -L/usr/x86_64-linux-gnu/lib -L/usr/lib foo.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.2.3/32/crtend.o /usr/lib32/crtn.o
>
> Note that is searching [/usr]/lib32 correctly but
> /usr/x86_64-linux-gnu/lib instead of /usr/i486-linux-gnu/lib as it
> should be.
>
> So gcc needs some work as well.
You may not like the way GCC implements its own multilibs,
but it certainly *works*. Note the difference between:
-L/usr/lib/gcc/x86_64-linux-gnu/4.2.3
-L/usr/lib/gcc/x86_64-linux-gnu/4.2.3/32
The latter directory contains the multilibs for GCC-provided
libraries when using -m32 on a x86_64-linux-gnu GCC.
This is in turn with the scheme GCC has always used for
multilibs required with ABI-changing compiler options
(even for the same target triple).
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com