如何为微处理器 SA1100 安装交叉编译器(在 ubuntu 12.04 LTS 上)? [英] How to install cross compiler (on ubuntu 12.04 LTS) for microprocessor SA1100?
问题描述
谁能告诉我如何为SA1100微处理器安装交叉编译器(编程语言C)?我有 ubuntu 12.04 LTS.我是 Linux 的完全菜鸟,我昨天刚刚安装了 Ubuntu.我需要一个名为arm-unknown-linux-gnu-gcc"的 GCC 编译器的特殊变体,但不知道该怎么做.
Can someone please tell me how to install the cross compiler (programming language C) for the SA1100 microprocessor? I have ubuntu 12.04 LTS. I´m a complete noob to Linux, I just installed Ubuntu yesterday. I need a special variant of the GCC compiler that is named "arm-unknown-linux-gnu-gcc" but don know how to do it.
有人可以帮我吗?
推荐答案
正如我在评论中所说,尝试
As I told in comments, try
apt-get install gcc-arm-linux-gnueabi
或
apt-get install gcc-4.7-arm-linux-gnueabi
我还强烈建议能够为您的 Linux 系统编译一个普通的 C 程序(即学习gcc
、make
...命令的基础知识以及如何使用一些编辑器如 emacs
或 gedit
...) 以及您想要的交叉编译器也取决于您的 SA1100 硬件板上运行的系统.不要忘记将 -Wall
传递给任何 GCC 编译.您可能希望能够调试您的程序(在编译时将 -g
传递给 GCC,并使用 gdb
调试器).当你的程序运行良好时,用-O2
编译它,让GCC优化它的机器码.
I also strongly recommend being able to compile an ordinary C program for your Linux system (i.e. learn the basics of gcc
, make
... commands and how to use some editor like emacs
or gedit
...) and the cross compiler you want also depends upon the system running on your SA1100 hardware board. Don't forget to pass -Wall
to any GCC compilation. You probably want to be able to debug your program (pass -g
to GCC at compilation, and use the gdb
debugger). When your program is running well, compile it with -O2
to ask GCC to optimize its machine code.
学习使用 GNU make
-e.g.通过阅读文档来编写Makefile
-s-使用 arm-linux-gnueabi-gcc
作为交叉编译器程序.(当 make
不够用时,您可能想使用 remake
来调试您的 Makefile
-s)
Learn to use GNU make
-e.g. to write Makefile
-s- by reading its documentation and use the arm-linux-gnueabi-gcc
as the cross-compiler program. (You might want to use remake
to debug your Makefile
-s when make
does not help enough)
您可以获取随包安装的文件列表,例如dpkg -L gcc-arm-linux-gnueabi
You can get the list of files installed with a package with e.g. dpkg -L gcc-arm-linux-gnueabi
ARM 的交叉编译程序可执行文件很可能至少需要在 ARM 主板上带有一些 libc
(或静态链接)的 Linux 内核,并且您需要某种方式来传输二进制程序Linux 桌面到 ARM 硬件.
A cross compiled program executable for ARM very probably needs a Linux kernel with some libc
(or link it statically) at least on the ARM motherboard, and you need some way to transmit the binary program from the Linux desktop to the ARM hardware.
这篇关于如何为微处理器 SA1100 安装交叉编译器(在 ubuntu 12.04 LTS 上)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!