前段时间Ubuntu 18.04
系统挂了,重装系统后,一直没有安装编译环境,记录下编译时遇到的一些问题。
1、问题描述
编译Linux内核映像时报如下错误:
root@ubuntu:/home/run/code/linux-4.9.y# make ARCH=arm CROSS_COMPILE=arm-xx-linux- defconfig
#
# configuration written to .config
#
root@ubuntu:/home/run/code/linux-4.9.y# make ARCH=arm CROSS_COMPILE=arm-xx-linux- uImage
./scripts/gcc-version.sh: line 25: /opt/bin/arm-xx-linux-gcc: No such file or directory
./scripts/gcc-version.sh: line 26: /opt/bin/arm-xx-linux-gcc: No such file or directory
make: /opt/bin/arm-xx-linux-gcc: Command not found
make: /opt/bin/arm-xx-linux-gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
./scripts/gcc-version.sh: line 25: /opt/bin/arm-xx-linux-gcc: No such file or directory
./scripts/gcc-version.sh: line 26: /opt/bin/arm-xx-linux-gcc: No such file or directory
make: /opt/bin/arm-xx-linux-gcc: Command not found
make: /opt/bin/arm-xx-linux-gcc: Command not found
CHK include/config/kernel.release
make: /opt/bin/arm-xx-linux-gcc: Command not found
Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
Makefile:1066: recipe for target 'prepare-compiler-check' failed
make: *** [prepare-compiler-check] Error 1
2、解决方法
ubuntu 180.04
是64位,而交叉编译器是32位的,需要安装软件包lib32ncurses5
。
root@ubuntu:/home/run/code/linux-4.9.y# apt-get install lib32ncurses5
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
root@ubuntu:/home/run/code/linux-4.9.y#
网友评论