Recent

Author Topic: [Tutorial] Cross Compile for arm-linux (Finally it works!)  (Read 179239 times)

thierrybo

  • Full Member
  • ***
  • Posts: 143
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #45 on: May 16, 2010, 08:55:44 am »
I can't extract files :( from lazarus.zip, either from Windows or Linux.

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #46 on: May 16, 2010, 01:58:42 pm »
Please, use latest version of 7-zip.

thierrybo

  • Full Member
  • ***
  • Posts: 143
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #47 on: May 17, 2010, 06:26:08 am »
Thanks,

[rant]  :D
I will try that, but please use compress method where we do not have to use a specific tool version. On linux this is no a standard program, and if so we also do not have necessarily the last version in repositories [/rant].

By the way, how do you "run" you graphical example on  you phone. I used you tutorial to do the same thing on Android emulator (from Android SDK) and I can run console programs that run in android shell FROM the computer, but not from phone screen (inside emulator).

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #48 on: May 17, 2010, 07:00:44 am »
Thanks,

[rant]  :D
I will try that, but please use compress method where we do not have to use a specific tool version. On linux this is no a standard program, and if so we also do not have necessarily the last version in repositories [/rant].

By the way, how do you "run" you graphical example on  you phone. I used you tutorial to do the same thing on Android emulator (from Android SDK) and I can run console programs that run in android shell FROM the computer, but not from phone screen (inside emulator).

Thanks for suggestion ;)
BTW, android is not a real arm-linux machine, so I can't test/help... this tutorial/these scripts is/are for arm-linux machines (like Nokia N900's maemo and, hopefully, for the future MeeGo)

warcode

  • New Member
  • *
  • Posts: 36
quest for arm compilation
« Reply #49 on: May 17, 2010, 01:06:19 pm »
Hi all

i'm trying to make a simple gtk1 or gtk2 for the arm cpu. I'm using a Overo™ Air COM (OMAP 3503 Application Processor with ARM Cortex-A8 CPU) + a 4,3 lcd touchscreen. I'm on ubuntu 10.04 and i dont have installed fpc or lazarus with package manager (synaptic). I using the 2 script here: lazarus_first_time and lazarus_update for getting lazarus + fpc installed on my /home/~ folder

After lauch lazarus_first_time everything look ok, when i try to compli a simple empty form i got this type of error

/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: cannot find -lX11
mb_scan.lpr(16,46) Error: Error while linking
mb_scan.lpr(16,46) Fatal: There were 1 errors compiling module, stopping

What i miss or what i need to make for complet the compilation
Thanks for any help

Christian F

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #50 on: May 17, 2010, 01:17:34 pm »
It seems to be all ok.
So, as there's wrote at the end of "lazarus_first_time" script execution, you need to follow the rest of the tutorial from here:
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Configure_Lazarus_for_cross_Compile

 :)

warcode

  • New Member
  • *
  • Posts: 36
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #51 on: May 17, 2010, 01:39:54 pm »
Hi Kjooow

So after make  lazarus_first_time and lazarus_update i need only to start with Configure Lazarus for cross Compile  on the wiki ?

Set Targets

    * From the IDE:
         1. Set in Project / Compiler Options / Code / Target OS (-T): Linux : DONE
         2. Set in Project / Compiler Options / Code / Target CPU family (-P): arm  : DONE



Add target libs to your project
REMEMBER TO CHANGE EVERY /home/user/ WITH YOUR OWN USER PATH!

    * From the IDE:
         1. Set in Project / Compiler Options / Linking / Options (-k): -L/home/user/lazarus/fpc/libcross
This option have changed on the latest svn version or i can find linking option ? And when i go on my lazarus folder this is what i have
/lazarus/fpc/2.5.1   and i have no libcross folder here


         2. Set in Project / Compiler Options / Compilation / Execute after / Command: arm-linux-strip -s /path/to/your/project/binary (where "binary" is the executable builded with Lazarus)

Thanks for help me

Christian F

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #52 on: May 17, 2010, 01:42:53 pm »
Quote
...skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: cannot find -lX11

Your libX11 located at /usr/lib isn't compatible. Additionally, you don't have one in your toolchain. Binutils and Newlib are needed.
Lazarus 1.7 (SVN) FPC 3.0.0

warcode

  • New Member
  • *
  • Posts: 36
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #53 on: May 17, 2010, 01:45:02 pm »
Thanks for the help guys

So where i can download X11 arm compatible (Binutils and Newlib)

Christian F

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #54 on: May 17, 2010, 01:49:57 pm »
lazarus_first_time is meant to be used just first time, once the script ended you need to follow the tutorial from "Configure Lazarus for cross Compile" from the end of page.

Don't forget the Appendix B!

In the "Appendix B" there are the instructions to find and solve the "problem" of incompatible libs. (In other words you need the target libs to permit lazarus to link these at your binary)

lazarus_update is designed for daily use, so when you run this script fpc and lazarus will be updated to the latest svn automatically.

warcode

  • New Member
  • *
  • Posts: 36
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #55 on: May 17, 2010, 02:16:53 pm »
Ok

1: I got the folder lib and /usr/lib (OMAP 3503 SD card) copied on /home/lazarus/libcross
2: added -L/home/user/lazarus/fpc/libcross
3: installed Newlib from synaptic
4: Build LCL + Package registration + press build (Lazarus will restart ? , because it' s not here )

i got the same error

/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: cannot find -lX11
project1.lpr(16,32) Error: Error while linking
project1.lpr(16,32) Fatal: There were 1 errors compiling module, stopping

Does i need to have a folder named lib and one named usr/lin in libcross
I' m a bit lose
Thanks for help
Christian F

Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #56 on: May 17, 2010, 02:20:27 pm »
Do you have checked the Set in Project / Compiler Options / Linking / Options (-k)?

I meant: not only add "-L/home/user/lazarus/fpc/libcross", but check the checkbox "Options (-k)"

warcode

  • New Member
  • *
  • Posts: 36
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #57 on: May 17, 2010, 03:24:52 pm »
Yep

I have a checkbox in option (-k) and -L/home/warlock/lazarus/fpc/libcross in the input
i can compile & run the testarm.pas witout trouble, i think that my probleme in fpc that can' t locate the X11 version arm that i copied in /home/warlock/lazarus/fpc/libcross. In this folder (libcross) i have a folder named X11 so i dont understand what is the error

Thanks for the help

Christian F





Kjooow

  • Jr. Member
  • **
  • Posts: 90
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #58 on: May 17, 2010, 03:31:57 pm »
you need to merge all file of all subdirs to /home/warlock/lazarus/fpc/libcross

So you will have a directory ( /home/warlock/lazarus/fpc/libcross ) which contains all files, without sub-folders.

This isn't an elegant mode, but it works. When I'll have more time I'll try to make this section of the tutorial more clear e more elegant.

e.g.

...
...
...
15/12/2009  15:30            78.048 librtcom-eventlogger.so.0.0.0
15/12/2009  15:30            17.672 libscconf.so.0
15/12/2009  15:30            17.672 libscconf.so.0.1
15/12/2009  15:28           329.492 libSDL-1.2.so.0
15/12/2009  15:28           329.492 libSDL-1.2.so.0.11.1
15/12/2009  15:28            70.548 libSDL_gfx.so.13
15/12/2009  15:28            70.548 libSDL_gfx.so.13.5.1
15/12/2009  15:28            38.916 libSDL_image-1.2.so.0
15/12/2009  15:28            38.916 libSDL_image-1.2.so.0.1.3
15/12/2009  15:28           249.932 libSDL_mixer-1.2.so.0
15/12/2009  15:28           249.932 libSDL_mixer-1.2.so.0.2
15/12/2009  15:28           249.932 libSDL_mixer-1.2.so.0.2.4
15/12/2009  15:28            10.300 libSDL_net-1.2.so.0
15/12/2009  15:28            10.300 libSDL_net-1.2.so.0.0.7
15/12/2009  15:28            17.992 libSDL_ttf-2.0.so.0
15/12/2009  15:28            17.992 libSDL_ttf-2.0.so.0.6.3
15/12/2009  15:43             9.700 libSegFault.so
15/12/2009  15:30            13.680 libshadowapp.so.0
...
...
...
15/12/2009  15:30           125.408 libwbxml2.so.0
15/12/2009  15:30           125.408 libwbxml2.so.0.0.0
15/12/2009  15:30           144.624 libwidgetutils.so
15/12/2009  15:30           144.624 libwidgetutils.so.0
15/12/2009  15:30           144.624 libwidgetutils.so.0.0.0
15/12/2009  15:30            18.524 libwl1251.so.0
15/12/2009  15:30            18.524 libwl1251.so.0.0.0
15/12/2009  15:30           100.640 libwpeditor.so.0
15/12/2009  15:30           100.640 libwpeditor.so.0.0.0
15/12/2009  15:28           945.616 libX11.so
15/12/2009  15:28           945.616 libX11.so.6
15/12/2009  15:28           945.616 libX11.so.6.2.0
15/12/2009  15:28             8.336 libXau.so.6
15/12/2009  15:28             8.336 libXau.so.6.0.0
15/12/2009  15:30            20.756 libxcb-randr.so.0
15/12/2009  15:30            20.756 libxcb-randr.so.0.0.0
15/12/2009  15:30             5.840 libxcb-shm.so.0
15/12/2009  15:30             5.840 libxcb-shm.so.0.0.0
15/12/2009  15:30            18.516 libxcb-xv.so.0
15/12/2009  15:30            18.516 libxcb-xv.so.0.0.0
15/12/2009  15:30            88.100 libxcb.so.1
15/12/2009  15:30            88.100 libxcb.so.1.0.0
...
...
...
« Last Edit: May 17, 2010, 03:36:17 pm by Kjooow »

warcode

  • New Member
  • *
  • Posts: 36
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #59 on: May 17, 2010, 03:44:29 pm »
So i need to copy only .so , .so.0 , .so.1 , ect file in libcross right ?
if yes do you know a linux command for copy my lib + usr/lib (arm folder) to my libcross ?

After try all what you telling me this what i got

/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /home/warlock/lazarus/fpc/libcross/libX11.so when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /home/warlock/lazarus/fpc/libcross/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11
/home/warlock/lazarus/fpc/binutils/ld: cannot find -lX11
project1.lpr(16,32) Error: Error while linking
project1.lpr(16,32) Fatal: There were 1 errors compiling module, stopping

i rename libX11.so.6.3.0 to libX11.so but witout effect
i search for a file libX11.a but find anyting in libcross



i wish i will be able to compile my first arm +gtk2 application today :)

Christian F
« Last Edit: May 17, 2010, 04:05:33 pm by warcode »

 

TinyPortal © 2005-2018