按照海思文档安装完交叉编译器后执行:

sudo make CROSS_COMPILE=aarch64-himix100-linux- -j 20

报错:

make: aarch64-himix100-linux-gcc: Command not found

 执行命令又成功:

aarch64-himix100-linux-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-himix100-linux-gcc
COLLECT_LTO_WRAPPER=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/host_bin/../libexec/gcc/aarch64-linux-gnu/6.3.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/src/gcc-6.3.0/configure --build=i386-redhat-linux --host=i386-redhat-linux --target=aarch64-linux-gnu --with-arch=armv8-a --prefix=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install --with-specs='%{!ftree-coalesce-vars:-fno-tree-coalesce-vars}' --disable-libmudflap --disable-libssp --enable-gold=yes --disable-libstdcxx-pch --disable-multilib --enable-multiarch --with-gnu-as --with-gnu-ld --enable-libgomp --enable-gnu-indirect-function --enable-checking=yes --enable-lto --enable-c99 --enable-long-long --disable-nls --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --enable-shared --with-pkgversion='HC&C V100R002C00B027_20181107' --enable-languages=c,c++ --with-headers=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target/usr/include --with-sysroot=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target --with-build-sysroot=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/target --with-gmp=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-mpfr=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-mpc=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-cloog=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/obj/host-libs/usr --with-build-time-tools=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/aarch64-linux-gnu/bin --libdir=/home/sying/SDK_CPU_UNIFIED/build/script/aarch64-himix100-linux/aarch64_himix100_build_dir/install/lib
Thread model: posix
gcc version 6.3.0 (HC&C V100R002C00B027_20181107) 

如果执行:

sudo aarch64-himix100-linux-gcc -v

结果报错:

sudo: aarch64-himix100-linux-gcc: command not found

原因:sudo用户为了安全执行的是最小环境变量,没有这个编译器路径

解决:

修改文件:/etc/sudoers ,以下语句中加入交叉编译器安装路径,修改后就立即生效

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

 

Logo

更多推荐