3

我正在尝试使用硬件制造商提供的工具链来交叉编译 uclinux。

当我运行make命令时,我收到一个我无法理解的错误:

yannick@ubuntu:~/uclinux-dist$ make
make -C tools/ucfront
make[1]: Entering directory `/home/yannick/uclinux-dist/tools/ucfront'
make[1]: `ucfront' is up to date.
make[1]: Leaving directory `/home/yannick/uclinux-dist/tools/ucfront'
ln -sf /home/yannick/uclinux-dist/tools/ucfront/ucfront tools/ucfront-gcc
ln -sf /home/yannick/uclinux-dist/tools/ucfront/ucfront tools/ucfront-g++
make ARCH=arm CROSS_COMPILE=arm-uclinux-elf- -C linux-2.6.x  || exit 1
make[1]: arm-uclinux-elf-gcc: Command not found
make[1]: Entering directory `/home/yannick/uclinux-dist/linux-2.6.x'
  CHK     include/linux/version.h
make[2]: `include/asm-arm/mach-types.h' is up to date.
  CC      arch/arm/kernel/asm-offsets.s
/bin/sh: 1: arm-uclinux-elf-gcc: not found
make[2]: *** [arch/arm/kernel/asm-offsets.s] Error 127
make[1]: *** [prepare0] Error 2
make[1]: Leaving directory `/home/yannick/uclinux-dist/linux-2.6.x'
make: *** [linux] Error 1

yannick@ubuntu:~/uclinux-dist$ locate arm-uclinux-elf-gcc
...
/usr/local/arm-uclinux-tools/bin/arm-uclinux-elf-gcc
...

yannick@ubuntu:~/uclinux-dist$ echo $PATH
/usr/local/arm-uclinux-tools/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

yannick@ubuntu:~/uclinux-dist$ ls -l /usr/local/bin
...
lrwxrwxrwx 1 root root 52 May 20 22:53 arm-uclinux-elf-gcc -> /usr/local/arm-uclinux-tools/bin/arm-uclinux-elf-gcc
...

yannick@ubuntu:~/uclinux-dist$ ls -l /usr/local/arm-uclinux-tools/bin/
...
-rwxr-xr-x 1 root root   81832 May 20 19:27 arm-uclinux-elf-gcc
...

yannick@ubuntu:~/uclinux-dist$ 

谢谢 !!

4

2 回答 2

2

运行时路径的值make不一定是命令执行时的值。在您尝试编译源文件之前,我会在实际中放置一个。echo $PATHmakefile

这至少会表明在构建过程中是否有某些东西正在改变你的路径。

于 2012-06-09T08:14:53.570 回答
0

您还应该在环境变量中添加它

跨工具路径

导出 CROSS_COMPILE=arm-uclinux-elf-

于 2016-06-03T11:53:45.207 回答