Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install cross compiler (on ubuntu 12.04 LTS) for microprocessor SA1100?

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.

Can someone please help me?

like image 370
n00b1990 Avatar asked Feb 17 '13 13:02

n00b1990


2 Answers

As I told in comments, try

apt-get install gcc-arm-linux-gnueabi 

or

apt-get install gcc-4.7-arm-linux-gnueabi

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.

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)

You can get the list of files installed with a package with e.g. dpkg -L gcc-arm-linux-gnueabi

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.

like image 144
Basile Starynkevitch Avatar answered Nov 02 '22 19:11

Basile Starynkevitch


Add the ppa: https://launchpad.net/gcc-arm-embedded The source codes for both are same. Currently supports Ubuntu 10.04/12.04/13.04/13.10/14.04 32 and 64 bit.

Detailed explanations to Launchpad PPA can be found at https://help.launchpad.net/Packaging/. That website explains how a PPA is set up and how to add existing PPA and install software from it.

Here are quick steps to install toolchain from this PPA on Ubuntu before 14.04. Open a terminal and type :

  1. sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
  2. sudo apt-get update
  3. sudo apt-get install gcc-arm-none-eabi

To remove installed toolchain, just do :

sudo apt-get remove gcc-arm-none-eabi

To update the toolchain, just repeat step 2 and 3.

like image 43
Nooty Avatar answered Nov 02 '22 21:11

Nooty