Gentoo Archives: gentoo-user

From: Wang Xuerui <idontknw.wang@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] about LIBRARY_PATH
Date: Mon, 12 Aug 2013 05:34:44
Message-Id: CABK5mSYYTKoNHLsn7gV_bA=9nzwnsBbrKOA700mgWbP=K7-mmQ@mail.gmail.com
In Reply to: [gentoo-user] about LIBRARY_PATH by "东方巽雷"
1 2013/8/12 东方巽雷 <dongfangxunlei@×××××.com>:
2 > It seems that this variable is hard-code by gcc.I cannot change it any
3 > more.When I use gcc -m32 to compile a 32bit program,gcc is looking for
4 > /usr/lib rather than /usr/lib32.But in my system,/usr/lib is a symlink to
5 > /usr/lib64.The real 32bit librarys is in /usr/lib32.The linker is always
6 > complaining about "i386:x86-64 architecture of input file
7 > `/usr/lib/gcc/x86_64-pc-linux-gnux32/4.7.3/../../../../lib/crt1.o' is
8 > incompatible with i386 output.".Why does it not search /usr/lib32?
9
10 Well, you can always emerge crossdev and crossdev i686-pc-linux-gnu then... (-:
11
12 PS: A quick check on my system shows this:
13
14 # [08/12 13:27:52] xenon@ribosome ~ $
15 gcc -m32 -v --version 2>&1 | grep LIBRARY_PATH
16 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/
17 # [08/12 13:28:00] xenon@ribosome ~ $
18 gcc -v --version 2>&1 | grep LIBRARY_PATH
19 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/
20
21 So the lib32 paths are actually included in the library search path,
22 and correctly placed *before* the lib counterparts. I'm not sure how
23 your toolchain ends up in the state you described, but it's certainly
24 weird... Can you please provide the output of "emerge --info" and "gcc
25 -v --version"? This way people will have more clue to help you...