Codesourcery toolchain

From OK6410 wiki

Jump to: navigation, search

Codesourcery Lite G++ ARM toolchain

Go to the following website:

http://www.codesourcery.com/sgpp/lite/arm/

And download the Linux installer of the GNU/Linux version. (I used arm-2010q1-202-arm-none-linux-gnueabi.bin)

IMPORTANT: If you want to build U-boot as well using the Codesourcery toolchain, you need to download the (older) 2010q1-202 version because otherwise U-boot will not find the RAM memory of the OK6410 Board and the kernel can't be loaded. You can see it on the bootscreen of U-boot if the RAM is properly loaded.

After downloading the package open a terminal and go to the directory where the file is saved and type:

$ chmod a+x arm-2010.......bin
$ sudo ./arm-2010.........bin

64-bit Linux users must make a few changes to their system. You can read them here on the Codesourcery website!

If you get an error message in the terminal, type:

$ sudo dpkg-reconfigure -plow dash

And in the window that appears, choose No, and rerun the ./arm-2010.....bin command.

During the installation select the following options:

  • Typical installation
  • Install directory, change to: /usr/local/Codesourcery....
  • Do not Modify PATH
  • Binary Directory, change to: usr/local/Codesourcery....

After the installation is complete you need to add the new location to your PATH. In your home directory type:

$ gedit .bashrc

Add the bottom of the file add the following line:

  1. export PATH=$PATH:/usr/local/CodeSourcery/Sourcery_G++_Lite/bin/

Reload your path by using the command (the command is WITH the dot and space!):

$ . .bashrc

Then you can try if the ARM toolchain works by typing:

$ arm-none-linux-gnueabi-gcc -v

Which results in

hacor@intel-i7:~$ arm-none-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/2010q1-release-linux-lite/src/gcc-4.4-2010q1/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2010q1-202' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/2010q1-release-linux-lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2010q1-release-linux-lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/2010q1-release-linux-lite/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202)

And on the last line you can read the used GCC version for the cross-compiler

Personal tools