Installing Linaro ARM Cross Toolchain on Ubuntu

You can easily install Linaro arm cross-compiler on Ubuntu 10.04 (Lucid), 10.10 (Maverick) and 11.04 (Natty) as follows:

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

This will install Linaro cross-toolchain version 4.4 on Ubuntu 10.04 and 10.10, and version 4.5 on Ubuntu 11.04.

You can check the installation worked by checking the cross-compiler version

jaufranc@CNX-TOWER:~$ arm-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v –with-pkgversion=’Ubuntu/Linaro 4.4.4-14ubuntu4′ –with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs –enable-languages=c,c++,fortran,objc,obj-c++ –prefix=/usr –program-suffix=-4.4 –enable-shared –enable-multiarch –enable-linker-build-id –with-system-zlib –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.4.5 –libdir=/usr/lib –enable-nls –enable-clocale=gnu –enable-libstdcxx-debug –enable-objc-gc –disable-sjlj-exceptions –with-arch=armv7-a –with-float=softfp –with-fpu=vfpv3-d16 –with-mode=thumb –disable-werror –enable-checking=release –program-prefix=arm-linux-gnueabi- –includedir=/usr/arm-linux-gnueabi/include –build=i686-linux-gnu –host=i686-linux-gnu –target=arm-linux-gnueabi –with-headers=/usr/arm-linux-gnueabi/include –with-libs=/usr/arm-linux-gnueabi/lib
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu4)

You can also install the latest version 4.5 (recommended) on Lucid and Maverick:

sudo add-apt-repository ppa:linaro-maintainers/toolchain
sudo apt-get update
sudo apt-get install gcc-4.5-arm-linux-gnueabi

If you are using an ARM platform running Ubuntu 10.10 or higher, you could also use the native GCC compiler.

sudo apt-get install gcc-4.5


Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

19 Replies to “Installing Linaro ARM Cross Toolchain on Ubuntu”

  1. Thank you very much for your post. I’ve been looking around for this for a very long time. This is really awesome!

  2. The method above will not install g++ to build library or program using C++. To install the c++ cross-compiler on Ubuntu:

    sudo apt-get install g++-arm-linux-gnueabi

  3. I am trying to build my u-boot like source code with the above toolchain i.e. “sudo apt-get install gcc-arm-linux-gnueabi” but it is giving me below error, can anybody please help

    arm-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/home/kalpesh/Projects/Hitachi/panda_sdk/x-loader-omap4-L24.9git20100901/include -fno-builtin -ffreestanding -nostdinc -isystem /home/kalpesh/Projects/Hitachi/toolchain/arm_toolchain_linaro/bin/../lib/gcc/arm-linux-gnueabi/4.6.1/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -c -o cpu/omap4/start.o /home/kalpesh/Projects/Hitachi/panda_sdk/x-loader-omap4-L24.9git20100901/cpu/omap4/start.S
    /home/kalpesh/Projects/Hitachi/toolchain/arm_toolchain_linaro/bin/../lib/gcc/arm-linux-gnueabi/4.6.1/cc1: error while loading shared libraries: cannot open shared object file: No such file or directory
    /home/kalpesh/Projects/Hitachi/toolchain/arm_toolchain_linaro/bin/../lib/gcc/arm-linux-gnueabi/4.6.1/../../../../arm-linux-gnueabi/bin/as: /lib/ no version information available (required by /home/kalpesh/Projects/Hitachi/toolchain/arm_toolchain_linaro/i686-linux-gnu/arm-linux-gnueabi/lib/
    make: *** [cpu/omap4/start.o] Error 1

  4. Looks like some libraries are missing.
    Are you using the instructions provided at ?

    Alternatively, u-boot linaro stable is available at (HEAD) or (11.11 release).

    I haven’t tried it (yet) but it should be like:
    make omap4_panda_config

  5. 1. Where can I find the linaro arm toolchain precompiled binaries so that I can use them to compile u-boot, linux, applications etc
    2. I have checked out the linaro website but they have everything in source code format they do not have precompiled arm toolchain
    3. I should be able to download the linaro toolchain in a user specified directory so that I can tar it and freely use on any machine I want eg: I download the linaro toolchain on ubuntu I should be able to tar the toolchain put it on fedora/suse etc and compile my SDK (u-boot, linux, application source code etc) with the linaro arm cross toolchain. Is this possible? If yes how can I do that?


  6. Ok, do you mean to say I have to download and install the linaro arm toolchain on every ubuntu machine I use for development, I dont have the flexibility to download it only once and then use the copy of the downloaded toolchain on other ubuntu machine. Is my understanding correct?


  7. @kalpesh
    That’s my understanding they don’t have a tar package yet for the toolchain although they are working on it.
    So yes, I suppose you’d have to run “apt-get install gcc-arm-linux-gnueabi” on all Ubuntu development machines.

  8. Thank you very much for the update. Let me know if you have any idea of when will they release the tar package. Also do you have any guide/doc of building/cross-compiling the linaro toolchain

  9. Hi,

    I have downloaded linaro tool chain by
    $ sudo apt-get install gcc-arm-linux-gnueabi

    I wanted to have Eglibc and uClibc for ARM, so that I can compile my application and link against them.

    So i followed the below steps:

    i)Downloaded Eglibc 2.15.90.
    ii)Cross compiled for ARM using the below commands:

    $ BUILD_CC=gcc CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-cpp AR=arm-linux-gnueabi-ar RANLIB=arm-linux-gnueabi-ranlib /home/user/EGLIBC/eglibc/libc/configure –prefix=/home/user/EGLIBC/eglibc/INSTALL –with-headers=/usr/arm-linux-gnueabi/include –build=i686-linux-gnu –host=arm-linux-gnueabi –enable-kernel=2.6.15–enable-add-ons=libidn,ports,nptl –with-tls –with-__thread

    $ make
    $ sudo make install

    By the above steps got in the prefix directory.

    iii)I checked the library by linking against an example application both statically and dynamically.Below is the steps i followed.

    $ arm-linux-gnueabi-gcc -L/home/user/EGLIBC/eglibc/INSTALL/lib test.c -lc -o dynamic_test

    Into the pandaboard i copied the neccessary libraries and app binary.

    $ ./dynamic_test
    Hello world!!! //It works

    $ arm-linux-gnueabi-gcc -static -L/home/user/EGLIBC/eglibc/INSTALL/lib test.c -lc -o static_test

    Into the pandaboard i copied the static app binary.

    $ ./static_test
    Illegal instruction //It doesn’t work

    The size of the static application binary is only 2.7Mb and the size of the Eglibc static library libc.a is 15.2Mb.

    Even i tried the static compilation of application using the default present in the Linaro tool chain.
    That also gave the same illegal instruction.


    i)Downloaded uClibc
    ii)In the menuconfig,chose some basic options
    iii)make CROSS=arm-linux-gnueabi-
    iv)make PREFIX=/home/user/uClibc- is the library produced.

    v)I checked the library by linking against an example application both statically and dynamically.Below is the steps i followed

    $ export LD_LIBRARY_PATH=/home/nishanthv/uClibc-

    $ arm-linux-gnueabi-gcc test.c -o dynamic_test
    $ file dynamic_test
    dynamic_test: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
    $ objdump -x dynamic_test | grep NEEDED

    It is not taking the that i am including via LD_LIBRARY_PATH. It is taking from the default location of the Linaro tool chain.

    $ arm-linux-gnueabi-gcc -static test.c -o static_test

    If i run it on pandaboard it shows Illegal Instruction

    The thing is only Eglibc/dynamic pair works in the Eglibc,uClibc Dynamic,static pair.

    Please give me your suggestions on it.

    thanks and regards

  10. I don’t know what may cause your problem. It might be a toolchain issue, so It’s quite difficult to debug.

    eglibc library is already used in Linaro Ubuntu LEB, so you don’t really need to compile it:, so you don’t need to cross-compile it.

    If you still have problems check out: You may also try to contact Michael Hope, Linaro toolchain group (contact in that thread).

  11. Hi
    i am doing apt-get install gcc-arm-linux-gnueabi,
    but it is giving
    Couldn’t find package gcc-arm-linux-gnueabi
    Please tell me the solution for it

  12. 1.i need the steps to download and install gcc-arm-none-eabi-5-4-2016q3.tar.bz2 toolchain on ubuntu to build and compile a c program on the above gcc toolchain to execute the program in the toolchain on ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC