cross-compilation in Debian

Started by nejemia, December 10, 2012, 01:25:17 AM

Previous topic - Next topic

nejemia

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 -



jlumme

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-

nejemia

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#



jeroends

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.

nejemia

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 -

jlumme

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.

nejemia

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.


jeroends

use apt-get install gcc-4.4-arm-linux-gnueabi instead of apt-get install gcc-arm-linux-gnueabi

nejemia

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 !

jlumme

Can you show us the content of /etc/apt/sources.list ?
cat /etc/apt/sources.list

nejemia

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#

jlumme

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


nejemia

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.


jeroends

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).

nejemia

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