在嵌入式開發(fā)中,碰到一個問題,arm-v7-linux-uclibceabi-gcc編譯工具在路徑中,但不能運行。用file看了一下發(fā)現(xiàn)居然是32bit的應(yīng)用,程序,而安裝的ubuntu是64bit的。
$ file arm-v7-linux-uclibceabi-gcc
arm-v7-linux-uclibceabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=155512229a6a8c0b9940242fffb3e85fe9e956a6, not stripped
查看ubuntu的信息:
$ file /lib/systemd/systemd
/lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=36002c7ee605e4fa995d6e895b318cd2eaf2240a, stripped
解決方法,安裝32bit的兼容庫
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386 libstdc++6:i386
libncurses5:i386 zlib1g:i386