0

我正在尝试在树莓派上安装汇编代码的工具链。我使用以下过程安装包文件:

$ 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

提前感谢您的帮助。

4

3 回答 3

2

export PATH=$PATH:$HOME/arm-2008q3/bin 仅在执行它的 shell 中有效(以及从该 shell 生成的任何 shell)。所以你要么使用那个 shell 而不是打开一个新的 shell 来执行 make 或编辑你的 ~/.bashrc (参见Unix: Getting Export PATH to "Stick"

于 2013-04-09T08:44:07.217 回答
2

我遇到了同样的问题,就我而言,问题是我运行的是 64 位操作系统,而要使用的包是 32 位的。修复方法是安装 i32-libs 包,它允许在 64 位系统上运行 32 位应用程序。

# apt-get install ia32-libs
于 2013-07-05T22:20:05.600 回答
0

您必须将编译器指向正确的路径arm-none-eabi-as。你可以这样做

导出 PATH=$PATH:/file_path_goes_here/

当你编译时,你应该没有问题,因为编译器现在知道去哪里找了。

于 2014-04-16T13:43:57.330 回答