Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advice regarding installing ARM toolchain on Ubuntu VM (64bit)

Trying to compile Linux kernel for arm platform on a Ubuntu virtual machine

$make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

It fails as follows

arm-none-linux-gnueabi-gcc: not found

Tried to install

$sudo apt-get install arm-none-linux-gnueabi-gcc

E: unable to locate package arm-none-linux-gnueabi-gcc

Where to find the correct package? how to include it in the system? (I found a couple of links on line that didn't work for me). It would be great if you could provide a correct solution or reference.

like image 225
codey modey Avatar asked Mar 08 '14 07:03

codey modey


People also ask

What is GNU ARM embedded toolchain?

The GNU Arm Embedded Toolchain is a ready-to-use, open-source suite of tools for C, C++ and assembly programming. The GNU Arm Embedded Toolchain targets the 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families.

What is ARM cross compiler?

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

What means none Eabi?

arm-none-eabi - This tool chain targets for ARM architecture, has no vendor, does not target an operating system and complies with the ARM EABI. arm-none-linux-gnueabi - This toolchain targets the ARM architecture, has no vendor, creates binaries that run on the Linux operating system, and uses the GNU EABI.


2 Answers

The Ubuntu package names are gcc-arm-linux-gnueabi/gcc-arm-linux-gnueabihf.

For building the kernel, which one you use does not make much difference. For building anything else, "gnueabihf" is the hard-float version. For any modern ARM processor (this statement excludes the Raspberry PI), this is the one you would want.

like image 140
unixsmurf Avatar answered Sep 27 '22 02:09

unixsmurf


  1. Download arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 from https://sourcery.mentor.com/GNUToolchain/

    or https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?@template=lite

    Get correct version of the arm-none-linux-gnueabi toolchain (i.e. targetting GNU/Linux rather than EABI).

  2. untar it

    tar xvf arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    
  3. open bashrc

    vi .bashrc
    

    at the end add below comand

    export PATH=$PATH:{path to toolchain}arm-2013.05/bin
    

    e.g export PATH=$PATH:/home/vinay/under_linux/arm-2013.05/bin

    save it and quit the terminal.

then you can cross-compile without everytime export.

Also take of correct toolchain there are two toolchain available choose according to your requirement.

Cross compile error "arm-none-eabi-g++ cannot find entry symbol"

like image 24
vinay hunachyal Avatar answered Sep 24 '22 02:09

vinay hunachyal