2013/8/12 东方巽雷 <dongfangxun...@gmail.com>:
> It seems that this variable is hard-code by gcc.I cannot change it any
> more.When I use gcc -m32 to compile a 32bit program,gcc is looking for
> /usr/lib rather than /usr/lib32.But in my system,/usr/lib is a symlink to
> /usr/lib64.The real 32bit librarys is in /usr/lib32.The linker is always
> complaining about "i386:x86-64 architecture of input file
> `/usr/lib/gcc/x86_64-pc-linux-gnux32/4.7.3/../../../../lib/crt1.o' is
> incompatible with i386 output.".Why does it not search /usr/lib32?

Well, you can always emerge crossdev and crossdev i686-pc-linux-gnu then... (-:

PS: A quick check on my system shows this:

# [08/12 13:27:52] xenon@ribosome ~ $
gcc -m32 -v --version 2>&1 | grep LIBRARY_PATH
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/32/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib32/:/lib/../lib32/:/usr/lib/../lib32/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../:/lib/:/usr/lib/
# [08/12 13:28:00] xenon@ribosome ~ $
gcc -v --version 2>&1 | grep LIBRARY_PATH
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../:/lib/:/usr/lib/

So the lib32 paths are actually included in the library search path,
and correctly placed *before* the lib counterparts. I'm not sure how
your toolchain ends up in the state you described, but it's certainly
weird... Can you please provide the output of "emerge --info" and "gcc
-v --version"? This way people will have more clue to help you...

Reply via email to