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?

share|improve this question
    
Did you 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. – Basile Starynkevitch Feb 17 '13 at 13:56
    
I do know how to compile an ordinary C program. That was gcc -o hello hello.c. I already tried apt-get install gcc-arm-linux-gnueabi and installed but cross compiling still doesn´t work. I want to cross compile the programs with (for example) arm-unknown-linux-gnu-gcc -O2 -Wall -o hello hello.c but it tells me the command couldn be found. Can you also tell me what make is for? Thank you, I appreciate your help! – n00b1990 Feb 17 '13 at 14:44
    
You should actually use gcc -Wall -g hello.c -o hello ; About make, read gnu.org/software/make/manual/html_node/index.html and use the arm-linux-gnueabi-gcc program as your cross-compiler – Basile Starynkevitch Feb 17 '13 at 14:47
    
Additional hint, use dpkg -L gcc-arm-linux-gnueabi to learn about the files installed by package gcc-arm-linux-gnueabi – Basile Starynkevitch Feb 17 '13 at 14:53
    
@BasileStarynkevitch You may want to post an answer. – Eliah Kagan Feb 17 '13 at 16:11
up vote 22 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.