uclinux编译错误

时间:2012-06-09 08:08:51

标签: linux arm cross-compiling

我正在尝试使用硬件制造商提供的工具链来交叉编译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$ 

谢谢!

2 个答案:

答案 0 :(得分:2)

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

这至少可以说明在构建过程中是否有什么东西在改变你的路径。

答案 1 :(得分:0)

你还应该在环境变量

中添加它

跨工具的路径

导出CROSS_COMPILE = arm-uclinux-elf-