ldd 显示 libstdc++ 未找到,但对于 clang 来说它可用,这怎么可能?

ldd 显示 libstdc++ 未找到,但对于 clang 来说它可用,这怎么可能?

我运行 Fedora 34,这怎么可能(ldd 显示 libstdc++ 未找到,但对于 clang 可用):

$ ldd /opt/toolchains/gcc-rl78/bin/rl78-elf-gcc
         linux-gate.so.1 (0xf7f7d000)
         libstdc++.so.6 => not found
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7f50000)
         libc.so.6 => /lib/libc.so.6 (0xf7d90000)
         /lib/ld-linux.so.2 (0xf7f7f0000)
$ ldd /opt/toolchains/llvm-rl78/bin/clang
/opt/toolchains/llvm-rl78/bin/clang: /lib64/libtinfo.so.5: no version information available (required by /opt/toolchains/llvm-rlvm-rl78/bin/clang)
         linux-vdso.so.1 (0x00007ffdc9397000)
         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4e3a062000)
         librt.so.1 => /lib64/librt.so.1 (0x00007f4e3a057000)
         libdl.so.2 => /lib64/libdl.so.2 (0x00007f4e3a050000)
         libtinfo.so.5 => /lib64/libtinfo.so.5 (0x000074e3a023000)
         libm.so.6 => /lib64/libm.so.6 (0x00007f4e39edf000)
         libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f4e39cc0000)
         libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4e39ca3000)
         libc.so.6 => /lib64/libc.so.6 (0x00007f4e39ad4000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f4e3a08e000)
$ ldconfig -v | grep libstd
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: ath `/usr/lib' given more than once
(from <builtin>:0 and <builtin>:0)
ldconfig: ath `/usr/lib64' given more than once
(from <builtin>:0 and <builtin>:0)
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
        libstdc++.so.6 -> libstdc++.so.6.0.29

答案1

第一个二进制是 32 位二进制,第二个是 64 位二进制(查看 s ld-linux.so)。您有 64 位版本libstdc++,但没有 32 位版本。

安装libstdc++.i686将解决这个问题:

sudo dnf install libstdc++.i686

相关内容