How to convert lazarus.win32 into linux-arm lazarus / 37-Linux PDAs ---------------------------------------------------------------------- assembly84 · 2014-02-18 05:30 Hi,     I'm new in linux-arm. Try to convert win32 project to linux-arm; use to programming Raspberry-pi i'm using lazarus 1.3.0 and fpc 2.6.2. Target platform has set to linux, uP to arm and compiler path fpc.exe hasc hange--> to ppcrossarm.exe so error message : fcllaz.pas(0,0) Fatal: Can not find unit system used by fcllaz of package FCL. thanks for helping me ---------------------------------------------------------------------- motaz · 2014-02-18 07:52 listening.. ---------------------------------------------------------------------- Laksen · 2014-02-18 07:54 You don't have to change compiler. Fpc automatically does that. Usually Lazarus builds a new LCL automatically. Which version are you using? ---------------------------------------------------------------------- assembly84 · 2014-02-18 08:35 thanks for comments. I've use Lazarus 1.30 and FPC 2.6.2 .... i'd hard try to compile from win32 --> linux-arm, but always failed . fcllaz.pas(0,0) Fatal: Can not find unit system used by fcllaz of package FCL. ---------------------------------------------------------------------- assembly84 · 2014-02-18 08:38 I'd set from Lazarus 1.30 IDE : Target Platform : Target OS         : linux Target uP          : arm help me please ... ---------------------------------------------------------------------- Laksen · 2014-02-18 15:44 How did you build the FPC crosscompiler? ---------------------------------------------------------------------- assembly84 · 2014-02-18 21:54 Quote from: Laksen on February 18, 2014, 04:44:44 pmHow did you build the FPC crosscompiler? Hi Laksen, I do know what the good step.  May be i doing it wrong. First, I set from Target Platform to : linux ; uP to ARM so i try to build my test application from Run menu. then this FATAL error message show again. I try to build application from win32  to arm-linux, how is the correct step ? Thank for helping me. ---------------------------------------------------------------------- Leledumbo · 2014-02-19 01:43 QuoteHi Laksen, I do know what the good step.  May be i doing it wrong. First, I set from Target Platform to : linux ; uP to ARM so i try to build my test application from Run menu. then this FATAL error message show again.Then I'm sure you don't have the cross compiler. FPC (standalone installation package or bundled with Lazarus) doesn't ship with ALL cross compilers precompiled, you have to build one according to your needs (FPC supports >20 combinations of architecture and OS, it would be overkill to distribute all cross compilers). This is the wiki article to read for building a cross compiler: http://wiki.lazarus.freepascal.org/Cross_compiling ---------------------------------------------------------------------- assembly84 · 2014-02-19 02:26 Quote from: Leledumbo on February 19, 2014, 02:43:54 amQuoteHi Laksen, I do know what the good step.  May be i doing it wrong. First, I set from Target Platform to : linux ; uP to ARM so i try to build my test application from Run menu. then this FATAL error message show again.Then I'm sure you don't have the cross compiler. FPC (standalone installation package or bundled with Lazarus) doesn't ship with ALL cross compilers precompiled, you have to build one according to your needs (FPC supports >20 combinations of architecture and OS, it would be overkill to distribute all cross compilers). This is the wiki article to read for building a cross compiler: http://wiki.lazarus.freepascal.org/Cross_compiling Hi Leledumbo, it's means i've to build one according my need ? i'd installed lazarus1.3 with FPC 2.6.2 from lazmirror. then continue install ugraded fpc262_cross_arm_wince_win32.exe ? Is there enough to build it self ? i'm going to build application from win32 which run on linux_arm in raspberry. thanks for helping me ---------------------------------------------------------------------- Leledumbo · 2014-02-19 10:42 Quote it's means i've to build one according my need ?yes Quoteinstall ugraded fpc262_cross_arm_wince_win32.exe ? Is there enough to build it self ?you don't need arm-wince cross compiler (this one has prepackaged installer fortunately) if your target is arm- linux. for arm-linux, however, you need more than just fpc and its COMPLETE source (Lazarus installer for windows only ships rtl and packages, you'll need to download the full source). You'll need arm- linux cross binutils, which you also have to built from binutils source. The article above should explain it all. Even more, you'll need target system libraries as well (it's the requirement of unix binaries that all shared libraries must be present at link time). If your target is raspberrypi (with raspbian OS), then it's better to get lazarus for raspbian instead. Lazarus is capable to run directly there, no need for cross compilation (it's not a simple task after all). ---------------------------------------------------------------------- assembly84 · 2014-02-22 06:35 Quote from: Leledumbo on February 19, 2014, 11:42:21 amQuote it's means i've to build one according my need ?yes Quoteinstall ugraded fpc262_cross_arm_wince_win32.exe ? Is there enough to build it self ?you don't need arm-wince cross compiler (this one has prepackaged installer fortunately) if your target is arm- linux. for arm-linux, however, you need more than just fpc and its COMPLETE source (Lazarus installer for windows only ships rtl and packages, you'll need to download the full source). You'll need arm- linux cross binutils, which you also have to built from binutils source. The article above should explain it all. Even more, you'll need target system libraries as well (it's the requirement of unix binaries that all shared libraries must be present at link time). If your target is raspberrypi (with raspbian OS), then it's better to get lazarus for raspbian instead. Lazarus is capable to run directly there, no need for cross compilation (it's not a simple task after all). thanks for suggest ya.... but i've update from svn to build complete lazarus. but found error after this like ? How to solve it ? thanks alot target: ARM os: linux "Compiling package FCL 1.0.1" completed C:\development\lazarus\components\lazutils\unixlazfileutils.inc(128,8) Hint: User defined: use GetEnvironmentVariableUTF8 C:\development\lazarus\components\lazutils\laz2_xmlread.pas(1151,7) Hint: Mixing signed expressions and longwords gives a 64bit result "Compiling package LazUtils 1.0" completed C:\development\lazarus\lcl\include\customform.inc(734,3) Warning: unreachable code C:\development\lazarus\lcl\dialogs.pp(630,5) Warning: unreachable code C:\development\lazarus\lcl\dbctrls.pp(1337,56) Warning: Symbol "Lookup" is deprecated C:\development\lazarus\lcl\dbgrids.pas(1149,18) Warning: Symbol "Lookup" is deprecated C:\development\lazarus\lcl\dbgrids.pas(2996,54) Warning: Symbol "Lookup" is deprecated C:\development\lazarus\lcl\dbgrids.pas(3017,28) Warning: Symbol "Lookup" is deprecated C:\development\lazarus\lcl\dbgrids.pas(3697,30) Warning: Symbol "Lookup" is deprecated "Compiling package LCLBase 1.3" completed C:\development\lazarus\lcl\interfaces\gtk2\gtk2listviewtreemodel.pas(2 08,12) Hint: Mixing signed expressions and longwords gives a 64bit result C:\development\lazarus\lcl\interfaces\gtk2\gtk2pagecontrol.inc(531,36) Hint: Mixing signed expressions and longwords gives a 64bit result C:\development\lazarus\lcl\interfaces\gtk2\gtk2wsdialogs.pp(1160,62) Hint: Local variable "colors" does not seem to be initialized C:\development\lazarus\lcl\interfaces\gtk2\gtk2wsforms.pp(941,8) Note: User defined: test with smaller minor versions and check where LM_CONFIGUREEVENT is needed. C:\development\lazarus\lcl\interfaces\gtk2\gtk2wsmenus.pp(203,33) Hint: Mixing signed expressions and longwords gives a 64bit result C:\development\lazarus\lcl\interfaces\gtk2\gtk2widgetset.inc(2828,22) Hint: Mixing signed expressions and longwords gives a 64bit result C:\development\lazarus\lcl\interfaces\gtk2\gtk2widgetset.inc(3565,14) Hint: Converting the operands to "Int64" before doing the subtract could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2widgetset.inc(3566,15) Hint: Converting the operands to "Int64" before doing the subtract could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2winapi.inc(2136,29) Hint: The left operand of the IN operator should be byte sized C:\development\lazarus\lcl\interfaces\gtk2\gtk2proc.inc(2677,34) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2proc.inc(2723,39) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2proc.inc(2772,58) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2proc.inc(2929,37) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors. C:\development\lazarus\lcl\interfaces\gtk2\gtk2proc.inc(3412,46) Hint: Mixing signed expressions and longwords gives a 64bit result C:\development\lazarus\lcl\interfaces\gtk2\gtk2callback.inc(2189,30) Hint: Mixing signed expressions and longwords gives a 64bit result "Compiling package LCL 1.3" completed Options changed, recompiling clean with -B cross1lib.pas(8,39) Hint: Unit "strutils" not used in cross1lib cross1.lpr(22) Warning: "crti.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtbegin.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtend.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtn.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crti.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtbegin.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtend.o" not found, this will probably cause a linking failure cross1.lpr(22) Warning: "crtn.o" not found, this will probably cause a linking failure C:\development\fpc\bin\arm-linux\arm-linux-ld.exe: cannot open linker script file linux: No such file or directory cross1.lpr(22) Error: Error while linking cross1.lpr(22) Fatal: There were 1 errors compiling module, stopping ---------------------------------------------------------------------- Leledumbo · 2014-02-22 07:02 QuoteC:\development\fpc\bin\arm-linux\arm-linux-ld.exe: cannot open linker script file linux: No such file or directoryNo idea. What version of binutils are you building? ---------------------------------------------------------------------- assembly84 · 2014-02-22 07:24 Quote from: Leledumbo on February 22, 2014, 08:02:53 amQuoteC:\development\fpc\bin\arm-linux\arm-linux-ld.exe: cannot open linker script file linux: No such file or directoryNo idea. What version of binutils are you building? binutils -->  i've  download following from wikilazarus Directory of C:\development\cross\bin\arm-linux 02/21/2014  12:01 PM              . 02/21/2014  12:01 PM              .. 02/16/2014  08:59 PM           580,622 arm-linux-ar.exe 02/16/2014  08:59 PM           990,734 arm-linux-as.exe 02/16/2014  09:00 PM           988,686 arm-linux-ld.exe 02/16/2014  09:00 PM           567,822 arm-linux-nm.exe 02/16/2014  09:01 PM           553,998 arm-linux-oabi-ar.exe 02/16/2014  09:03 PM           965,134 arm-linux-oabi-as.exe 02/16/2014  09:06 PM           992,782 arm-linux-oabi-ld.exe 02/16/2014  09:01 PM           829,966 arm-linux-oabi-objdump.e 02/16/2014  09:02 PM           685,070 arm-linux-oabi-strip.exe 02/16/2014  09:02 PM           707,598 arm-linux-objcopy.exe 02/16/2014  09:03 PM           864,270 arm-linux-objdump.exe 02/16/2014  09:03 PM           708,110 arm-linux-strip.exe               12 File(s)      9,434,792 bytes thanks leledumbo. i realy appreciate for your help. ---------------------------------------------------------------------- Leledumbo · 2014-02-22 08:27 Quotei've  download following from wikilazarus Again, no idea. I've always built binutils from source myself. Probably the package is incomplete, because you'll actually require a linker script. I have mine in /usr/lib/linkerscripts. ---------------------------------------------------------------------- assembly84 · 2014-02-22 08:33 Quote from: Leledumbo on February 22, 2014, 09:27:26 amQuotei've  download following from wikilazarus Again, no idea. I've always built binutils from source myself. Probably the package is incomplete, because you'll actually require a linker script. I have mine in /usr/lib/linkerscripts. a lot thanks, leledumbo. .. i'try ---------------------------------------------------------------------- assembly84 · 2014-02-22 18:18 Quote from: Laksen on February 18, 2014, 08:54:16 amYou don't have to change compiler. Fpc automatically does that. Usually Lazarus builds a new LCL automatically. Which version are you using?   Hi Sir ... I almost completed to build arm-linux with lazarus-win32 LCL.. but still error  Executing "C:/development/cross/bin/arm-linux/arm-linux-ld.exe" with command line "  -s -Tlinux -Parm --dynamic-linker=/lib/ld-linux- armhf.so.3 --rpath-link C:/development/fpc/lib/arm-linux/rtl/  --gc- sections  -L. -o E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm-linux\cross210 -T E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm- linux\link.res"   thanks for your suggest, I try not to change FPC, but download from http://svn.freepascal.org/svn/lazarus/ using fcupgui.exe instead. ---------------------------------------------------------------------- assembly84 · 2014-02-22 18:20 Quote from: Leledumbo on February 22, 2014, 09:27:26 amQuotei've  download following from wikilazarus Again, no idea. I've always built binutils from source myself. Probably the package is incomplete, because you'll actually require a linker script. I have mine in /usr/lib/linkerscripts. thanks leledumbo,  i have download from :  http://svn.freepascal.org/svn/lazarus/ and look good to compile, btw  Executing "C:/development/cross/bin/arm-linux/arm-linux-ld.exe" with command line "  -s -Tlinux -Parm --dynamic-linker=/lib/ld-linux- armhf.so.3 --rpath-link C:/development/fpc/lib/arm-linux/rtl/  --gc- sections  -L. -o E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm-linux\cross210 -T E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm- linux\link.res"     get this error ---------------------------------------------------------------------- Leledumbo · 2014-02-23 02:17 Quotethanks leledumbo,  i have download from :  http://svn.freepascal.org/svn/lazarus/There's no binutils source there. Unless you follow the exact same step as I did, I cannot help. If I say I build binutils from source, you have to do the same. ---------------------------------------------------------------------- assembly84 · 2014-02-23 03:43 Quote from: Leledumbo on February 23, 2014, 03:17:34 amQuotethanks leledumbo,  i have download from :  http://svn.freepascal.org/svn/lazarus/There's no binutils source there. Unless you follow the exact same step as I did, I cannot help. If I say I build binutils from source, you have to do the same. Hi LeleDumbo, thanks ... I'd follow your step to make script; Is a FCP.cfg script ? Until now I'm trying to write it, because still have a error. like here Using util C:/development/cross/bin/arm-linux/arm-linux-ld.exe Executing "C:/development/cross/bin/arm-linux/arm-linux-ld.exe" with command line "  -s -Tlinux -Parm --dynamic- linker=C:\development\fpc\lib\arm-linux\ --rpath-link C:/development/fpc/lib/arm-linux/rtl/  --gc-sections  -L. -o E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm-linux\cross210 -T E:\CODING\LAZARUS\ASSEMBLE\2014\p201402\cross1\lib\arm- linux\link.res" cross210.lpr(22) Error: Error while linking cross210.lpr(22) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: C:\development\fpc\bin\i386-win32\ppcrossarm.exe returned an error exitcode thanks alot for your suggest ---------------------------------------------------------------------- Leledumbo · 2014-02-23 04:16 Looks like you don't understand what I'm saying. It's useless to continue then. ---------------------------------------------------------------------- assembly84 · 2014-02-23 04:40 Quote from: Leledumbo on February 23, 2014, 05:16:37 amLooks like you don't understand what I'm saying. It's useless to continue then. Sorry Sir, I think, I do not understand .. ---------------------------------------------------------------------- BigChimp · 2014-02-23 10:34 Quote from: Leledumbo on February 22, 2014, 09:27:26 amQuotei've  download following from wikilazarus Again, no idea. I've always built binutils from source myself. Probably the package is incomplete, because you'll actually require a linker script. I have mine in /usr/lib/linkerscripts. Well, I seem to be able to cross compile from win32=>arm-linux without linker script. See the fpcup wiki page on how I set things up (and which binutils I used). @assembly84: cross compiling is a complicated subject. It's much easier to compile directly on the device if you can. If you are still interested in cross compiling, please read all the relevant wiki pages on cross compiling. AFAIR, linker scripts are covered there, too. ---------------------------------------------------------------------- assembly84 · 2014-02-27 07:10 Quote from: BigChimp on February 23, 2014, 11:34:50 amQuote from: Leledumbo on February 22, 2014, 09:27:26 amQuotei've  download following from wikilazarus Again, no idea. I've always built binutils from source myself. Probably the package is incomplete, because you'll actually require a linker script. I have mine in /usr/lib/linkerscripts. Well, I seem to be able to cross compile from win32=>arm-linux without linker script. See the fpcup wiki page on how I set things up (and which binutils I used). @assembly84: cross compiling is a complicated subject. It's much easier to compile directly on the device if you can. If you are still interested in cross compiling, please read all the relevant wiki pages on cross compiling. AFAIR, linker scripts are covered there, too. thanks BigChimp, please help me about Reff Link about linkerscripts etc ? last try with [i386-win32] to [linux-arm] ==> still error on linux- arm-ld.exe to open link  ld-arm-linux.o3 thanks alot ! ---------------------------------------------------------------------- BigChimp · 2014-02-27 08:10 If you used the way fpcup does the cross compile (same binutils, no linker script, same fpc.cfg settings) there should be no problem. I'd suggest you try fpcup. ---------------------------------------------------------------------- assembly84 · 2014-03-02 17:48 Quote from: BigChimp on February 27, 2014, 09:10:13 amIf you used the way fpcup does the cross compile (same binutils, no linker script, same fpc.cfg settings) there should be no problem. I'd suggest you try fpcup. Thanks BigChimp,  I had try to build using fpcup_linux_x86, use no linkerscript, but lazarus failed to load "interfaces.ppu" ? Running on i386-linux --> arm-linux ---------------------------------------------------------------------- BigChimp · 2014-03-03 07:55 Does this help: http://forum.lazarus.freepascal.org/index.php/topic,23787.msg142538.ht ml#msg142538 ? Again: please post in one thread if you have problems. Please open a new thread if you have a different problem than the original thread covers. See the first link in my signature for more details. Thanks.