ubuntu 20 patchelf 解决GLIBCXX not found
想在arm上使用node,好不容易移过去了,结果提示这个.这个时候可以试下patchelf,可能有用.
/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found。
ubuntu 20 安装 pathchelf
sudo apt install patchelf
查看命令帮助
patchelf -h
syntax: patchelf
[--set-interpreter FILENAME]
[--page-size SIZE]
[--print-interpreter]
[--print-soname] Prints 'DT_SONAME' entry of .dynamic section. Raises an error if DT_SONAME doesn't exist
[--set-soname SONAME] Sets 'DT_SONAME' entry to SONAME.
[--set-rpath RPATH]
[--remove-rpath]
[--shrink-rpath]
[--allowed-rpath-prefixes PREFIXES] With '--shrink-rpath', reject rpath entries not starting with the allowed prefix
[--print-rpath]
[--force-rpath]
[--add-needed LIBRARY]
[--remove-needed LIBRARY]
[--replace-needed LIBRARY NEW_LIBRARY]
[--print-needed]
[--no-default-lib]
[--debug]
[--version]
FILENAME
当前patchelf 版本
patchelf --version
patchelf 0.10
patchelf --print-interpreter node
/lib/ld-linux-armhf.so.3
patchelf --print-needed node
libdl.so.2
librt.so.1
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libpthread.so.0
libc.so.6
修改interpreter
patchelf --set-interpreter /usr/local/lib/ld-linux-armhf.so.3 node
修改rpath
patchelf --set-rpath /usr/local/lib node
root@host:~# node -v
v8.11.1
root@host:~# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 718.02
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
Hardware : am335xevm
Revision : 0000
Serial : 0000000000000000
/lib/ld-linux-armhf.so.3 --list /usr/bin/node
libdl.so.2 => /usr/local/lib/libdl.so.2 (0x4034a000)
librt.so.1 => /usr/local/lib/librt.so.1 (0x4006e000)
libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 (0x4035d000)
libm.so.6 => /usr/local/lib/libm.so.6 (0x400b0000)
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x40125000)
libpthread.so.0 => /usr/local/lib/libpthread.so.0 (0x40160000)
libc.so.6 => /usr/local/lib/libc.so.6 (0x4024e000)
/usr/local/lib/ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0x40090000)