交叉编译工具运行错误error while loading shared libraries: libz.so.1...解决
现象 在ubuntu 18.04系统上安装arm-linux-gcc交叉编译工具 arm-hisiv500-linux-gcc(海思交叉编译工具) mipsel-openwrt-linux-gcc(MT7xx8 openwrt交叉编译工具)等交叉编译工具,使用arm-linux-gcc -工具时提示:
原因 在于,ubuntu 18.04 版本 ia32_libs 被废弃了导致没有32位的lib库。
解决方法 1.我们使用命令: apt-file search 来查找,首先安装,按如下命令: - sudo apt-getinstall apt-file
复制代码
2.安装完以后系统会提示你update,如果没有提示,在终端输入如下命令:
3.依据系统提示运行apt list --upgradable - sudo apt list --upgradable
复制代码
4.对libz进行查找 - apt-file search libz.so.1
复制代码
我查找的内容是lib32z1: /usr/lib32/libz.so.1
- lib32z1: /usr/lib32/libz.so.1
- lib32z1: /usr/lib32/libz.so.1.2.11
- libx32z1: /usr/libx32/libz.so.1
- libx32z1: /usr/libx32/libz.so.1.2.11
- libzadc4: /usr/lib/x86_64-linux-gnu/genwqe/libz.so.1
- zlib1g: /lib/x86_64-linux-gnu/libz.so.1
- zlib1g: /lib/x86_64-linux-gnu/libz.so.1.2.11
复制代码
5.对libz进行安装 - sudo apt-get install lib32z1
复制代码
6.查检是否解决 arm-hisiv500-linux-gcc -v - arm-hisiv500-linux-gcc -v
- Using built-in specs.
- COLLECT_GCC=arm-hisiv500-linux-gcc
- COLLECT_LTO_WRAPPER=/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../libexec/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/lto-wrapper
- Target: arm-hisiv500-linux-uclibcgnueabi
- Configured with: ../gcc-linaro-4.9-2015.06/configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=arm-hisiv500-linux-uclibcgnueabi --prefix=/home/sying/build-toolchain/gcc-uclibc/install/arm-hisiv500-linux --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-arch=armv5te --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --enable-nls --enable-clocale=gnu --enable-extra-hisi-multilibs --with-sysroot=/home/sying/build-toolchain/gcc-uclibc/install/arm-hisiv500-linux/target --with-build-sysroot=/home/sying/build-toolchain/gcc-uclibc/install/arm-hisiv500-linux/target --with-gmp=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-mpfr=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-mpc=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-ppl=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-cloog=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-libelf=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --enable-libgomp --disable-libitm --disable-libsanitizer --enable-poison-system-directories --with-libelf=/home/sying/build-toolchain/gcc-uclibc/install/host_lib --with-pkgversion=Hisilicon_v500_20150831 --with-bugurl=http://www.hisilicon.com/cn/service/claim.html
- Thread model: posix
- gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20150831)
复制代码看到上述内容,则问题已经解决了。
|