【嵌入式】Ubuntu20.04执行arm-linux-gc 没有那个文件或目录

00. 目录

文章目录

    • 00. 目录
    • 01. 问题描述
    • 02. 问题分析
    • 03. 问题解决
    • 04. 结果验证
    • 05. 附录

01. 问题描述

deng@itcast:/usr/local/arm/4.5.1/bin$ arm-linux-gcc
-bash: /usr/local/arm/4.5.1/bin/arm-linux-gcc: 没有那个文件或目录

arm-linux-gcc文件是存在的

02. 问题分析

2.1 查看arm-linux-gcc文件是否存在

deng@itcast:/usr/local/arm/4.5.1/bin$ ls -l  /usr/local/arm/4.5.1/bin/arm-linux-gcc
lrwxrwxrwx 1 deng deng 26 9月  28  2010 /usr/local/arm/4.5.1/bin/arm-linux-gcc -> arm-none-linux-gnueabi-gcc
deng@itcast:/usr/local/arm/4.5.1/bin$ 

文件存在,但是不可执行

2.2. 查看可执行文件的属性

deng@itcast:/usr/local/arm/4.5.1/bin$ file /usr/local/arm/4.5.1/bin/arm-none-linux-gnueabi-gcc
/usr/local/arm/4.5.1/bin/arm-none-linux-gnueabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.9, BuildID[sha1]=2dd37e8868a64f75fb3be3fcfb0ae90e7463700e, stripped
deng@itcast:/usr/local/arm/4.5.1/bin$ 

发现Ubuntu是64位的系统,arm-linux-gcc是32位的,所以缺少32位的库。

03. 问题解决

安装32位的库

deng@itcast:/usr/local/arm/4.5.1/bin$ sudo apt install lib32z1

04. 结果验证

deng@itcast:/usr/local/arm/4.5.1/bin$ arm-linux-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gcc
COLLECT_LTO_WRAPPER=/usr/local/arm/4.5.1/bin/../libexec/gcc/arm-none-linux-gnueabi/4.5.1/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /work/toolchain/build/src/gcc-4.5.1/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.5.1 --with-sysroot=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --enable-languages=c,c++ --disable-multilib --with-cpu=arm1176jzf-s --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=softfp --with-pkgversion=ctng-1.8.1-FA --with-bugurl=http://www.arm9.net/ --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-gmp=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpfr=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-ppl=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-cloog=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-mpc=/work/toolchain/build/arm-none-linux-gnueabi/build/static --with-libelf=/work/toolchain/build/arm-none-linux-gnueabi/build/static --enable-threads=posix --with-local-prefix=/opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/sys-root --disable-nls --enable-symvers=gnu --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.5.1 (ctng-1.8.1-FA) 

05. 附录

你可能感兴趣的:(嵌入式天地,gcc,arm-linux-gcc,没有那个文件或目录,arm-linux-gcc报错,arm-linux-gcc失败)