LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   linux arm cross compiler (https://www.linuxquestions.org/questions/linux-software-2/linux-arm-cross-compiler-822053/)

habeshkumar 07-25-2010 10:14 AM

linux arm cross compiler
 
i want to cross compile gtk program from linux to arm..
i am using ubuntu10.04.. how can i cross compile it for arm

i have tried this.. but this is my output

root@habesh-laptop:~/habesh/gtk# /root/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -o trail1 base1.c `pkg-config --cflags --libs gtk+-2.0`
cc1: warning: include location "/usr/include/gtk-2.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/atk-1.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/cairo" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/pango-1.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/gio-unix-2.0/" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/glib-2.0" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/pixman-1" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/freetype2" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/directfb" is unsafe for cross-compilation
cc1: warning: include location "/usr/include/libpng12" is unsafe for cross-compilation
/root/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status

Elv13 07-25-2010 01:02 PM

You need to compile all of the dependencies first (the first level is listed above, the will have to go deeper). Those libraries are x86, they need to be recompiled for arm

*Be sure not to replace the existing one

habeshkumar 07-26-2010 01:44 AM

gcc cross compile
 
hi.. good day..
working in ubuntu10.04
initially i created a gtk application..
name of the source base.c

#gcc -o base base.c `pkg-config --cflags --libs gtk+-2.0`

it compiles well and i can run it in ubuntu..

now i need to cross compile it to run for target board ARM926..
can you tell me toolchain for cross compiling it succesfully

habeshkumar 07-26-2010 07:24 AM

gtk ubuntu ARM
 
i want to create application in ARM board..
so i used the tool gtk for creating application..

my source file is base.c
root@habesh-laptop:~# cd habesh/gtk/
root@habesh-laptop:~/habesh/gtk# ls
base.c

i compiled it for ubuntu using
root@habesh-laptop:~/habesh/gtk#gcc -o base base.c `pkg-config --cflags --libs gtk+-2.0`

i can compile it for ubuntu and it works...
this is where the toolchain is available...
root@habesh-laptop:/opt/ARTOS_toolchain_1.3/bin# ls
arm-linux-addr2line arm-linux-c++filt arm-linux-gcc-3.4.4 arm-linux-nm arm-linux-readelf ld pam_tally
arm-linux-ar arm-linux-cpp arm-linux-gccbug arm-linux-objcopy arm-linux-size libpng12-config unix_chkpwd
arm-linux-as arm-linux-g++ arm-linux-gcov arm-linux-objdump arm-linux-strings libpng-config
arm-linux-c++ arm-linux-gcc arm-linux-ld arm-linux-ranlib arm-linux-strip mkimage

so i cross compiled for target using
root@habesh-laptop:~/habesh/gtk# /opt/ARTOS_toolchain_1.3/bin/arm-linux-gcc -o trail base.c `pkg-config --cflags --libs gtk+-2.0`
/opt/ARTOS_toolchain_1.3/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status

what is the problem..
please help me...

knudfl 07-26-2010 07:52 AM

Please read post # 2 again : Everything required for building
your file must be for arm.

Start with glib, atk, cairo, pango for gtk. Then gtk.
Use your cross compiler = 'arm-linux-gcc' etc. for that.

Configure it all for e.g. --prefix=/opt/arm/ , and when glib
has been built to /opt/arm/, the next command is :
export PKG_CONFIG_LIBDIR=/opt/lib/pkgconfig
&& cd atk-<version>/ && ./configure --prefix=/opt/arm/
.. .. etc. etc.

Then you can later use it all with this command :
export LD_LIBRARY_PATH=/opt/arm/lib && <other-command>
..


All times are GMT -5. The time now is 09:43 AM.