View previous topic :: View next topic |
Author |
Message |
bpoint Tux's lil' helper
Joined: 07 Oct 2008 Posts: 84 Location: Japan
|
Posted: Thu Jul 21, 2011 6:24 am Post subject: /etc/ld.so.conf does not specify 32-bit gcc LDPATH on amd64 |
|
|
Hello all,
I ran across an interesting issue today when I tried to run app-text/FoxitReader right after emerging it:
Code: | ./FoxitReader: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory |
I did some digging to find where the libstdc++ libraries are on the filesystem, and found them here:
Code: | /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/32/libstdc++.so.6
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/32/libstdc++.so.6.0.14
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/32/libstdc++.so
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/32/libstdc++.a
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/libstdc++.so.6
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/libstdc++.so.6.0.14
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/libstdc++.so
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2/libstdc++.a |
I checked /etc/ld.so.conf, and noticed that only /usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.2 was listed. Since FoxitReader is a 32-bit app, it makes sense that it can't find libstdc++.so.6, because it wants the 32-bit .so, and not the 64-bit one.
I then edited /etc/env.d/05gcc-x86_64-pc-linux-gnu, changing the LDPATH line from:
Code: | LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2" |
...to (on two lines!):
Code: | LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/32" |
After running env-update, I was then able to run FoxitReader and use it without a problem.
So, getting to the point, I have three questions:
1) Is this the proper way of fixing this issue?
2) How did this happen in the first place? I suppose any 32-bit software that would look for libstdc++.so would fail, but in this case I just happened to notice it first with FoxitReader.
3) Is there anyone else out there that has had this problem?
I wouldn't mind posting a bug about this, but since I don't understand why there wasn't any LDPATH to the 32-bit libraries, it's difficult for me to describe it in detail. All I know is just how I managed to fix it...
If it matters, this PC was a rather fresh install of Gentoo, only about 3 weeks old. I'll be happy to post any information if anyone needs it.
Thanks! |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6095 Location: Dallas area
|
Posted: Thu Jul 21, 2011 10:14 am Post subject: |
|
|
1. Yes it seems to be the proper way to do it
Others have created a symlink in /lib32 (definitely the wrong way to do it)
I'm running gcc 4.5.2 and it doesn't have the 32 path added (but I run very few 32 bit apps)
I did look at an old backup of root and found this
Code: | LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4:/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32" |
So it appears that once upon a time it was done that way.
2. I'm going to assume that after gcc 4.4.5 they forgot to add the /32 path to LDPATH.
3. There are several that have reported similar problems.
Edit to add: being curious I went looking, LDPATH is put in place by toolchain.eclass, and it seems to be broken, at least for gcc 4.5.2
It has logic for multilib pathing, but seems to ignore it. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
bpoint Tux's lil' helper
Joined: 07 Oct 2008 Posts: 84 Location: Japan
|
Posted: Tue Jul 26, 2011 10:09 am Post subject: |
|
|
Anon-E-moose wrote: | I did look at an old backup of root and found this
Code: | LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4:/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/32" |
So it appears that once upon a time it was done that way. |
I just tried using a colon to separate the paths and it works fine. So that avoids having to have the open new line in the env.d config.
Anon-E-moose wrote: | 2. I'm going to assume that after gcc 4.4.5 they forgot to add the /32 path to LDPATH. |
That sounds about right. I didn't notice the problem until a did a depclean and removed all older gccs before 4.5..
Thanks for the info! |
|
Back to top |
|
|
rvalles Tux's lil' helper
Joined: 19 Feb 2003 Posts: 121
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|