Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: nejemia on December 10, 2012, 01:25:17 AM

Title: cross-compilation in Debian
Post by: nejemia on December 10, 2012, 01:25:17 AM
Dear all:
May be this is an already answered question but the issue is driving me nuts.
I have a host running Debian Linux and I need to compile several C programs to be run in the Olinuxino iMX233 Max running the ARCHLINUX last version.
I can not get the toolchain for my Debian, can someone guide me through the process of getting the cross-compiler and installing it ?
Thank you very much in advance.
Nelson -


Title: Re: cross-compilation in Debian
Post by: jlumme on December 10, 2012, 06:21:13 AM
Cross compiler is already available in aptitude in Debian:
sudo apt-get install gcc-arm-linux-gnueabi

And, when you make something:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
Title: Re: cross-compilation in Debian
Post by: nejemia on December 10, 2012, 03:27:20 PM
Obviously I am missing something or doing something wrong ...  :-\
Any other option for getting the toolchain?
I am using a graphic IDE (Netbeans) so installing the cross-compiler tools in a special directory will be very easy to integrate with the Netbeans.

I already have it working nice with the Raspberry and the Glomation boards.


root@debianMAC:/home/nejemia# apt-get install gcc-arm-linux-gnueabi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-arm-linux-gnueabi
root@debianMAC:/home/nejemia#


Title: Re: cross-compilation in Debian
Post by: jeroends on December 10, 2012, 04:39:00 PM
try the following:

make backup of file: /etc/apt/sources.list
   create new /etc/apt/sources.list as follow:

      #
      # -- Emdebian cross toolchains
      #
      deb http://www.emdebian.org/debian squeeze main

   install Emdebian package:

      sudo apt-get install emdebian-archive-keyring
      sudo apt-get update
      sudo apt-get install gcc-4.4-arm-linux-gnueabi
      sudo apt-get install g++-4.4-arm-linux-gnueabi

   restore your original /etc/apt/sources.list

This was suggested by Fadil Berisha, if you'll search the forum, you can find the original post.
Title: Re: cross-compilation in Debian
Post by: nejemia on December 10, 2012, 09:13:15 PM
No luck ... :-\
I am using "arm-none-linux-gnueabi-gcc-4.6.3" to do cross compilation on my HOST Debian for the Glomation GESBC-3130S.
The Glomation SBC board uses the LPC-3130 uC which is based on ARM926EJ-S.
It is my guess that the same toolchain can do the job for the OLINUXINO iMX233. However, I tried de most famous code in the history "Hello World" compiled for the Glomation but the Olinuxino did not run it ...
If someone has any idea, suggestion or recommendation on how to proceed it will be very appreciated. May be some sort of option in the compiler line, or something else...
Thanks a lot indeed !!
Nelson -
Title: Re: cross-compilation in Debian
Post by: jlumme on December 11, 2012, 04:29:46 AM
Nejimia, can you please post the results (what is the error from console?) when you try to install applications from aptitude ?
I think Jeroends suggestion should work..

I'm sorry my advice was not very good, default sources.list probably indeed doesn't have that package I suggested.
Title: Re: cross-compilation in Debian
Post by: nejemia on December 11, 2012, 08:34:54 PM
Dear jlumme:
I followed the instructions but i get
oot@debianMAC:/home/nejemia# apt-get install gcc-arm-linux-gnueabi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-arm-linux-gnueabi
Perhaps the best is to download an already precompiled toolchain that works for the Olinuxino and install it manually in my i686 Debian Host where I have the IDE.
For the Glomation I am using this and works nice.
Thank you very much.

Title: Re: cross-compilation in Debian
Post by: jeroends on December 11, 2012, 08:54:37 PM
use apt-get install gcc-4.4-arm-linux-gnueabi instead of apt-get install gcc-arm-linux-gnueabi
Title: Re: cross-compilation in Debian
Post by: nejemia on December 12, 2012, 03:23:04 AM
Ooops// bad luck again.


root@debianMAC:/home/nejemia# apt-get install gcc-4.4-arm-linux-gnueabi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-4.4-arm-linux-gnueabi
E: Couldn't find any package by regex 'gcc-4.4-arm-linux-gnueabi'
root@debianMAC:/home/nejemia#

I would like to try again with my 4.6.3 toolchain, I need the right option for the compiler in order to generate code for the Olinuxino.

Thanks !
Title: Re: cross-compilation in Debian
Post by: jlumme on December 12, 2012, 03:30:59 AM
Can you show us the content of /etc/apt/sources.list ?
cat /etc/apt/sources.list
Title: Re: cross-compilation in Debian
Post by: nejemia on December 12, 2012, 01:59:50 PM
Hello again:
This is my sources.list file //



# deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 NETINST Binary-1 20120512-20:43]/ squeeze main

#deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 NETINST Binary-1 20120512-20:43]/ squeeze main

deb http://ftp.us.debian.org/debian/ squeeze main
deb http://ftp.uk.debian.org/embedian/toolchains testing main

deb-src http://ftp.us.debian.org/debian/ squeeze main

deb http://ftp.us.embedian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

deb http://www.embedian.org/debian/ squeeze main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ squeeze-updates main
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main
root@debianMAC:/home/nejemia#
Title: Re: cross-compilation in Debian
Post by: jlumme on December 12, 2012, 02:09:43 PM
There seems to be a typo in your sources list, you have:
deb http://www.embedian.org/debian/ squeeze main

you should have:
deb http://www.emdebian.org/debian squeeze main

Title: Re: cross-compilation in Debian
Post by: nejemia on December 12, 2012, 04:17:15 PM
Oh Oh ... You are 100% right -
Here is the corrected sources.list --

#

# deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 NETINST Binary-1 20120512-20:43]/ squeeze main

#deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 NETINST Binary-1 20120512-20:43]/ squeeze main

deb http://ftp.us.debian.org/debian/ squeeze main
deb http://ftp.uk.debian.org/embedian/toolchains testing main

deb-src http://ftp.us.debian.org/debian/ squeeze main

deb http://ftp.us.emdebian.org/debian/ squeeze main

deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main

deb http://www.emdebian.org/debian/ squeeze main

# squeeze-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ squeeze-updates main
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main
root@debianMAC:/home/nejemia#

HOWEVER ----

root@debianMAC:/home/nejemia# apt-get install gcc-4.4-arm-linux-gnueabi
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc-4.4-arm-linux-gnueabi
E: Couldn't find any package by regex 'gcc-4.4-arm-linux-gnueabi'
root@debianMAC:/home/nejemia#

May be now we are 2 drove nuts ...

Thanks a million any way...
Nelson.

Title: Re: cross-compilation in Debian
Post by: jeroends on December 12, 2012, 04:52:57 PM
have you already tried to do it exactly like I discibed above? Replace your whole list instead of adding the line.

I've never had problems installing it that way (neihter in debian, neither in ubuntu).
Title: Re: cross-compilation in Debian
Post by: nejemia on December 13, 2012, 02:59:46 AM
Gentlemen:
It is a privilege working with you !
Tool is installed and working - My Olinuxino is now very happy running the cross-compiled code.
I am using extensive math calculations and it works nice and smooth.
Next step -> i2c ... Wish me luck -
THANK YOU ALL !!  ;D
Title: Re: cross-compilation in Debian
Post by: jlumme on December 13, 2012, 03:02:42 AM
great :)
Title: Re: cross-compilation in Debian
Post by: jeroends on December 13, 2012, 09:13:56 AM
congrats, can you tell us how you've mannaged to install it, could be usefull for others.

btw: i2c isn't that hard, be sure to examine the examples + hardware notes and you're on track right away
Title: Re: cross-compilation in Debian
Post by: nejemia on December 13, 2012, 01:50:33 PM
Procedure followed:
1) Realize that I am a retired 55 y.o electronic engineer with almost zero knowledge in Linux and very basic experience in "C".
2) Once step 1 is completed, follow -exactly- the instructions and double check 4 times for typos.
If the abovementioned steps are carefully completed, then everything has a very high probability to work as desired.
3) Do not miss the opportunity to thank the people who really knows what they are doing and work hard to make this world a better place.
I am delighted with the prduct and feel happy working with you.
Thanks again.
Will take a look on i2c I am planning to use it for a 4 7-seg led display.
Nelson.