i686-cm-linux-gcc:找不到命令

i686-cm-linux-gcc:找不到命令

在交叉编译OpenWRT时,我已经用工具链i686架构替换了OpenWRT的工具链。但是,我收到下面提到的错误:

make[5]: Leaving directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18'
./scripts/gcc-version.sh: line 25: i686-cm-linux-gcc: command not found
./scripts/gcc-version.sh: line 26: i686-cm-linux-gcc: command not found
make[5]: Entering directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18'
arch/x86/Makefile:114: stack-protector enabled but compiler support broken
Makefile:657: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make[5]: i686-cm-linux-gcc: Command not found
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      kernel/bounds.s
/bin/sh: 1: i686-cm-linux-gcc: not found
make[6]: *** [kernel/bounds.s] Error 127
make[5]: *** [prepare0] Error 2
make[5]: Leaving directory `/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18'
make[4]: *** [/home/hclintel/pankaj/fresh/trunk/build_dir/target-i386_i486_musl-1.1.10/linux-x86_generic/linux-3.18.18/.modules] Error 2
make[4]: Leaving directory `/home/hclintel/pankaj/fresh/trunk/target/linux/x86'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/hclintel/pankaj/fresh/trunk/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/home/hclintel/pankaj/fresh/trunk'
make[1]: *** [/home/hclintel/pankaj/fresh/trunk/staging_dir/target-i386_i486_musl-1.1.10/stamp/.target_compile] Error 2
make[1]: Leaving directory `/home/hclintel/pankaj/fresh/trunk'
make: *** [world] Error 2
hclintel@hclintel-ThinkCentre-M73:~/pankaj/fresh/trunk$ 

当我运行时echo $PATH,我得到下面提到的结果:

/home/hclintel/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

我想我需要修改配置文件中的路径,但我找不到修改路径的正确位置。

答案1

1)您需要找到i686-cm-linux-gcc所在的位置。

2) 你是如何构建 OpenWRT 的?我猜测是通过Make。为此,您需要编辑 Makefile 并在其中添加路径。在其中分配编译器的 Makefile 之一中应该有一个声明。

改变

CC=i686-cm-linux-gcc

CC=/path/to/i686-cm-linux-gcc

相关内容