Cross compiler - compiled unable to run on QSB

cancel
Showing results for 
Search instead for 
Did you mean: 

Cross compiler - compiled unable to run on QSB

Jump to solution
1,131 Views
haryono
Contributor III

Dear All,

I tried to search in the forum, but I didn't find the exact answer I'm looking for.

Is there a cross-compiler gcc included in the Ubuntu VMWare image for PC in i.MX53 QSB Getting-Started-DVD?

I assume the gcc is cross-compiler.

I installed QT Creator, and I assume when I compile, it automatically use the cross-compiler gcc.

Is my assumption correct? If not, where's the location for the cross-compiler gcc?

Thanks a lot.

Labels (1)
0 Kudos
1 Solution
77 Views
JasonLiu
NXP Employee
NXP Employee

you can use the following command to search the cross-compile package:

sudo apt-cache search arm-linux

in my ubuntu system, I get: gcc-arm-linux-gnueabi - The GNU C compiler for armel architecture

And then you can use the following command to install it:

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

For the build of your software code, we can't assume it will use the cross-compile automatically. You need check the Makefile or ./configure to make sure the build is using the cross-compiler. You may need add some build-option to the make command for example ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-. But again, this really depends on the Makefile of your software package. For some software package which using ./configure, typically, you need put some build-option to the ./configure to configure the target build is a cross-compiler. You can search the web to get some detailed information about how to configure it.

View solution in original post

0 Kudos
11 Replies
78 Views
JasonLiu
NXP Employee
NXP Employee

you can use the following command to search the cross-compile package:

sudo apt-cache search arm-linux

in my ubuntu system, I get: gcc-arm-linux-gnueabi - The GNU C compiler for armel architecture

And then you can use the following command to install it:

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

For the build of your software code, we can't assume it will use the cross-compile automatically. You need check the Makefile or ./configure to make sure the build is using the cross-compiler. You may need add some build-option to the make command for example ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-. But again, this really depends on the Makefile of your software package. For some software package which using ./configure, typically, you need put some build-option to the ./configure to configure the target build is a cross-compiler. You can search the web to get some detailed information about how to configure it.

View solution in original post

0 Kudos
77 Views
haryono
Contributor III

Finally, I found the answer. i.MX53 Ubuntu version is Lucid, which doesn't have gcc-arm-linux-gnueabi.

I need to get it from Linaro PPA.

Complete answers are in here. Hopefully it will be useful for everybody else:

http://askubuntu.com/questions/123835/gcc-arm-linux-gnueabi-package-not-found-on-10-04-lts-lucid

https://launchpad.net/~linaro-maintainers/+archive/toolchain

Step-by-step:

https://wiki.linaro.org/Resources/ToolchainInstall-10

77 Views
aksispd
Contributor II

Is it possible to use the tool chain what the the ltib is using? It's all the same isn't it? If so how to compile an application with that gcc and where it is located?

0 Kudos
77 Views
haryono
Contributor III

Hi Hui,

I didn't find gcc-arm-linux-gnueabi. And when I tried to install it, it couldn't find it in Ubuntu repository.

Any idea?

0 Kudos
77 Views
Rooney
Contributor III

Hello haryono!

Try to add the following new source to /etc/apt/sources.list:

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

This must be of course adapted to fit your Ubuntu distro!!! As Ubuntu is debian based there should be available something similar.

After that execute sudo apt-cache update and sudo apt-cache search arm | grep gcc. The available ARM compilers should be listed.

To cross-compile a Qt application you need the whole Qt framework cross-compiled, as you need the libraries on your target system. I've wirtten a tutorial to do so, but only in German...

Regards,

Rooney

77 Views
haryono
Contributor III

Hi Bob,

Thank you for shedding a new light.

Maybe I can translate your tutorial using Google Translate :smileyhappy:

Regards,

Haryono

0 Kudos
77 Views
Rooney
Contributor III

Find attached the PDF version (German) of the tutorial to install Qt on the host and target.

Keep in mind, that I'm using a full-blown Debian Squeeze distro on the target (host uses same distro) created with debootstrap.

If you want to use LTIB I'm not really sure if the tutorial will work!!!

Qt installation in a nutshell:

# Get an ARM compiler, either through apt-get or the included compiler in LTIB or whatever.

# It is preferred to use the Qt sources and compile them for the host. Do not use the Qt version you may get via apt-get.

# Compile Qt for the host using gcc.

# Compile Qt for the target using arm-linux-gnueabi-gcc (or similar).

# Copy target version to host and target rootfs. On the host it is required to cross-compile the target application. On the target the libraries are used by the application.

# Define the different Qt versions in Qt Creater so you can select them during development.

# Have fun!!!

I hope you can use the German tutorial. If there is increasing interest I may find the time to translate the tutorial to English.

Regards,

Rooney

0 Kudos
77 Views
haryono
Contributor III

Thank you so much, Bob!

Awesome! I really appreciate it.

Regards,

Hary

0 Kudos
77 Views
haryono
Contributor III

Hi Hui,

Thank you so much for the clear explanation.

Btw, does gcc-arm-linux-gnueabi support all ARM architecture?

Will it be able to take advantage certain feature appear in certain ARM architecture?

I was wondering why Freescale doesn't include it in their iMX Ubuntu VMWare image.....

0 Kudos
77 Views
zhenyong_chen
Contributor III

Why not build your program natively on QSB ubuntu?

0 Kudos
77 Views
haryono
Contributor III

Hi Zhen Yong,

Thank you for the advice.

I did that, yes it worked, but I don't want to do my development on QSB board.

I want to develop on the PC, which has more CPU power.

0 Kudos