我正在尝试在raspberry pi上安装汇编代码的工具链。我使用以下过程来安装包文件:
$ wget http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
--2012-08-16 18:26:29-- http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
Resolving www.cl.cam.ac.uk (www.cl.cam.ac.uk)... 128.232.0.20, 2001:630:212:267::80:14
Connecting to www.cl.cam.ac.uk (www.cl.cam.ac.uk)|128.232.0.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32108070 (31M) [application/x-bzip2]
Saving to: `arm-none-eabi.tar.bz2'
100%[======================================>] 32,108,070 668K/s in 67s
2012-08-16 18:27:39 (467 KB/s) - `arm-none-eabi.tar.bz2' saved [32108070/32108070]
$ tar xjvf arm-none-eabi.tar.bz2
arm-2008q3/arm-none-eabi/
arm-2008q3/arm-none-eabi/lib/
arm-2008q3/arm-none-eabi/lib/libsupc++.a
arm-2008q3/arm-none-eabi/lib/libcs3arm.a
...
arm-2008q3/share/doc/arm-arm-none-eabi/info/gprof.info
arm-2008q3/share/doc/arm-arm-none-eabi/info/cppinternals.info
arm-2008q3/share/doc/arm-arm-none-eabi/LICENSE.txt
$ export PATH=$PATH:$HOME/arm-2008q3/bin
这似乎有效,包文件位于正确的位置。
~/arm-2008q3/bin $ ls
arm-none-eabi-addr2line arm-none-eabi-gcc-4.3.2 arm-none-eabi-objdump
arm-none-eabi-ar arm-none-eabi-gcov arm-none-eabi-ranlib
arm-none-eabi-as arm-none-eabi-gdb arm-none-eabi-readelf
arm-none-eabi-c++ arm-none-eabi-gdbtui arm-none-eabi-run
arm-none-eabi-c++filt arm-none-eabi-gprof arm-none-eabi-size
arm-none-eabi-cpp arm-none-eabi-ld arm-none-eabi-sprite
arm-none-eabi-g++ arm-none-eabi-nm arm-none-eabi-strings
arm-none-eabi-gcc arm-none-eabi-objcopy arm-none-eabi-strip
然而,当我去做时,我得到以下结果。
arm-none-eabi-as -I source/ source/main.s -o build/main.o
make: arm-none-eabi-as: Command not found
make: *** [build/main.o] Error 127
提前感谢您的帮助。
答案 0 :(得分:2)
export PATH = $ PATH:$ HOME / arm-2008q3 / bin仅在执行它的shell中有效(以及从该shell生成的任何shell)。所以你要么使用那个shell而不是打开一个新的shell来执行make或编辑〜/ .bashrc(参见Unix: Getting Export PATH to "Stick")
答案 1 :(得分:2)
我遇到了同样的问题,在我的情况下问题是我运行的是64位操作系统而且要使用的软件包是32位。修复是安装i32-libs软件包,它允许在64位系统上运行32位应用程序。
# apt-get install ia32-libs
答案 2 :(得分:0)
您必须将编译器指向arm-none-eabi-as
所在的正确路径。你可以通过
export PATH = $ PATH:/ file_path_goes_here /
编译时,您应该没有问题,因为编译器现在知道在哪里查找。