Welcome, Guest

Author Topic: cross-compilation in Debian  (Read 20816 times)

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
cross-compilation in Debian
« 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 -



jlumme

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +1/-1
Re: cross-compilation in Debian
« Reply #1 on: December 10, 2012, 06:21:13 AM »
Cross compiler is already available in aptitude in Debian:
Code: [Select]
sudo apt-get install gcc-arm-linux-gnueabi
And, when you make something:
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #2 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#



jeroends

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +2/-0
Re: cross-compilation in Debian
« Reply #3 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.

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #4 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 -
 

jlumme

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +1/-1
Re: cross-compilation in Debian
« Reply #5 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.

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #6 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.


jeroends

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +2/-0
Re: cross-compilation in Debian
« Reply #7 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

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #8 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 !

jlumme

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +1/-1
Re: cross-compilation in Debian
« Reply #9 on: December 12, 2012, 03:30:59 AM »
Can you show us the content of /etc/apt/sources.list ?
Code: [Select]
cat /etc/apt/sources.list

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #10 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#

jlumme

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +1/-1
Re: cross-compilation in Debian
« Reply #11 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


nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #12 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.


jeroends

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +2/-0
Re: cross-compilation in Debian
« Reply #13 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).

nejemia

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: cross-compilation in Debian
« Reply #14 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