Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] snx can't find libstdc++.so.5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 4:50 pm    Post subject: [SOLVED] snx can't find libstdc++.so.5 Reply with quote

When I try to run snx on the command line, I get this:
snx: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

However, I've verified that /usr/lib64/libstdc++.so.5 exists and is a link to /usr/lib64/libstdc++.so.5.0.7

I've also verified that /usr/lib64 is in ld.so.conf

snx isn't managed by portage, but I have synced and updated since the last time I successfully worked from home so it's possible that something it depends on has broken things. I don't really understand the whole process, but I think that the snx executable gets updated whenever I VPN in to work (I believe this to be true because it prompts me for the root password before establishing the VPN and the snx file gets updated timestamps) so it's possible that I got a broken executable this morning when I attempted to connect, but the error makes it sound like a linking issue.

Any help is greatly appreciated.

--flatelin


Last edited by flatelin on Fri Mar 28, 2014 5:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 4:54 pm    Post subject: Reply with quote

It could be looking for it in a specific directory rather than using the ld cache.

Run ldd on the binary and see what it lists.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:01 pm    Post subject: Reply with quote

Here's the result of running `ldd /usr/bin/snx`:
Code:
        linux-gate.so.1 (0xf7716000)
        libX11.so.6 => /usr/lib32/libX11.so.6 (0xf75bd000)
        libpthread.so.0 => /lib32/libpthread.so.0 (0xf75a2000)
        libresolv.so.2 => /lib32/libresolv.so.2 (0xf758b000)
        libdl.so.2 => /lib32/libdl.so.2 (0xf7586000)
        libpam.so.0 => /lib32/libpam.so.0 (0xf7577000)
        libnsl.so.1 => /lib32/libnsl.so.1 (0xf755e000)
        libstdc++.so.5 => not found
        libc.so.6 => /lib32/libc.so.6 (0xf73b2000)
        libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf7390000)
        /lib/ld-linux.so.2 (0xf7717000)
        libXau.so.6 => /usr/lib32/libXau.so.6 (0xf738b000)
        libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf7384000)
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 5:09 pm    Post subject: Reply with quote

Do you have a libstdc++.so.5 in lib32, you can't use the 64 bit one in a 32 bit app.

On my system
Code:
ldconfig -p |grep libstdc++.so.5
   libstdc++.so.5 (libc6,x86-64) => /usr/lib64/libstdc++.so.5
   libstdc++.so.5 (libc6) => /usr/lib32/libstdc++.so.5


Or just check with "ls -l /usr/lib32/libstdc++*"
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland


Last edited by Anon-E-moose on Fri Mar 28, 2014 5:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:14 pm    Post subject: Reply with quote

So I tried creating /usr/lib32/libstdc++.so.5 as a link to /usr/lib64/libstdc++.so.5 and got a new error:

Code:
snx: error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS64


So I'm guessing the issue is that my executable is compiled as 32-bit but my libstdc++.so.5 is compiled as 64-bit.

When I run the file command on the executable, I get this:
Code:
/usr/bin/snx: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped


which seems to confirm that suspicion. It makes me wonder if I had a 32-bit libstdc++ that was recently removed by an update or if I've been getting 64-bit executables all this time but for some reason got a 32-bit executable this morning.

--flatelin
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:15 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Do you have a libstdc++.so.5 in lib32, you can't use the 64 bit one in a 32 bit app.

On my system
Code:
ldconfig -p |grep libstdc++.so.5
   libstdc++.so.5 (libc6,x86-64) => /usr/lib64/libstdc++.so.5
   libstdc++.so.5 (libc6) => /usr/lib32/libstdc++.so.5


Or just check with "ls -l /usr/lib32/libstdc++*"


No, I do not have a libstdc++.so.5 in /usr/lib32. How do I get one?

--flatelin
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 5:18 pm    Post subject: Reply with quote

What does "emerge -pv libstdc++-v3" return?
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:24 pm    Post subject: Reply with quote

Anon-E-moose wrote:
What does "emerge -pv libstdc++-v3" return?


I just ran "equery uses sys-libs/libstdc++-v3" and got this:
Code:
 equery uses sys-libs/libstdc++-v3
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-libs/libstdc++-v3-3.3.6-r1:
 U I
 - - multilib : On 64bit systems, if you want to be able to compile 32bit and
                64bit binaries
 + + nls      : Add Native Language Support (using gettext - GNU locale
                utilities)


So now I've added "multilib" to package.use and am rebuilding.

Any idea if this is a new use flag? It seems strange that I've been working fine for the last couple of years without it.

--flatelin
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 5:26 pm    Post subject: Reply with quote

Code:
drwxr-xr-x  2 root root  752 Sep  1  2013 libstdc++-v3-3.3.6-r1


Not exactly new.

If you are using a multilib profile then it should be set there.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:37 pm    Post subject: Reply with quote

Anon-E-moose wrote:
Code:
drwxr-xr-x  2 root root  752 Sep  1  2013 libstdc++-v3-3.3.6-r1


Not exactly new.

If you are using a multilib profile then it should be set there.


How do I check that?

The only profile I'm aware of is /etc/portage/make.profile which points to ../../usr/portage/profiles/default/linux/amd64/13.0.

--flatelin
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 5:50 pm    Post subject: Reply with quote

That profile should be a multilib one.

What does "emerge --info | grep multilib" show?

OR

what does this "grep multilib /etc/make.conf /etc/portage/package.*" show? (use /etc/portage/make.conf if your's is there)
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:56 pm    Post subject: Reply with quote

Anon-E-moose wrote:
That profile should be a multilib one.

What does "emerge --info | grep multilib" show?

OR

what does this "grep multilib /etc/make.conf /etc/portage/package.*" show? (use /etc/portage/make.conf if your's is there)


emerge --info | grep multilib returns nothing.

grep multilib /etc/portage/make.conf /etc/portage/package.* returns
Code:
/etc/portage/package.use:sys-libs/libstdc++-v3 multilib


which is the line I added moments ago.

Oh, things are working now that I've rebuilt with the multilib use flag. Thank you so much for your help!

--flatelin
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:57 pm    Post subject: Reply with quote

So if my profile is supposed to be multilib, should I be nervous that I've inadvertently done something to make it not multilib?

--flatelin
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Fri Mar 28, 2014 5:57 pm    Post subject: Reply with quote

You should have that flag set, not sure why you don't.
But it's only used when compiling 32 bit libs or apps.

Just mark this as solved, and good luck.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
flatelin
n00b
n00b


Joined: 27 Aug 2004
Posts: 67

PostPosted: Fri Mar 28, 2014 5:58 pm    Post subject: Reply with quote

Anon-E-moose wrote:
You should have that flag set, not sure why you don't.
But it's only used when compiling 32 bit libs or apps.

Just mark this as solved, and good luck.


Thanks so much for the help!

--flatelin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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