谷动谷力

标题: 交叉编译工具运行错误error while loading shared libraries: libz.so.1... [打印本页]

作者: 鸣涧    时间: 2022-7-27 16:44
标题: 交叉编译工具运行错误error while loading shared libraries: libz.so.1...
交叉编译工具运行错误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 -工具时提示:
  1. .....
复制代码

原因
在于,ubuntu 18.04 版本 ia32_libs 被废弃了导致没有32位的lib库。

解决方法
1.我们使用命令: apt-file search 来查找,首先安装,按如下命令:
  1. sudo apt-getinstall apt-file
复制代码

2.安装完以后系统会提示你update,如果没有提示,在终端输入如下命令:
  1. sudo apt-file update
复制代码

3.依据系统提示运行apt list --upgradable
  1. sudo apt list --upgradable
复制代码

4.对libz进行查找
  1. apt-file search libz.so.1
复制代码

我查找的内容是lib32z1: /usr/lib32/libz.so.1
  1. lib32z1: /usr/lib32/libz.so.1
  2. lib32z1: /usr/lib32/libz.so.1.2.11
  3. libx32z1: /usr/libx32/libz.so.1
  4. libx32z1: /usr/libx32/libz.so.1.2.11
  5. libzadc4: /usr/lib/x86_64-linux-gnu/genwqe/libz.so.1
  6. zlib1g: /lib/x86_64-linux-gnu/libz.so.1
  7. zlib1g: /lib/x86_64-linux-gnu/libz.so.1.2.11
复制代码

5.对libz进行安装
  1. sudo apt-get install lib32z1
复制代码

6.查检是否解决 arm-hisiv500-linux-gcc -v
  1. arm-hisiv500-linux-gcc -v
  2. Using built-in specs.
  3. COLLECT_GCC=arm-hisiv500-linux-gcc
  4. COLLECT_LTO_WRAPPER=/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/../libexec/gcc/arm-hisiv500-linux-uclibcgnueabi/4.9.4/lto-wrapper
  5. Target: arm-hisiv500-linux-uclibcgnueabi
  6. 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
  7. Thread model: posix
  8. gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20150831)
复制代码
看到上述内容,则问题已经解决了。







欢迎光临 谷动谷力 (http://bbs.sunsili.com/) Powered by Discuz! X3.2