Recent

Author Topic: How to convert lazarus.win32 into linux-arm  (Read 22353 times)

assembly84

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
How to convert lazarus.win32 into linux-arm
« on: February 18, 2014, 06:30:53 am »
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
try to be better

motaz

  • Hero Member
  • *****
  • Posts: 508
    • http://code.sd
Re: How to convert lazarus.win32 into linux-arm
« Reply #1 on: February 18, 2014, 08:52:02 am »
listening..

Laksen

  • Hero Member
  • *****
  • Posts: 617
    • J-Software
Re: How to convert lazarus.win32 into linux-arm
« Reply #2 on: February 18, 2014, 08:54:16 am »
You don't have to change compiler. Fpc automatically does that.

Usually Lazarus builds a new LCL automatically. Which version are you using?

assembly84

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #3 on: February 18, 2014, 09:35:10 am »
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. %)

try to be better

assembly84

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #4 on: February 18, 2014, 09:38:31 am »
I'd set from Lazarus 1.30 IDE :

Target Platform :

Target OS         : linux
Target uP          : arm

help me please ...  :(


 

try to be better

Laksen

  • Hero Member
  • *****
  • Posts: 617
    • J-Software
Re: How to convert lazarus.win32 into linux-arm
« Reply #5 on: February 18, 2014, 04:44:44 pm »
How did you build the FPC crosscompiler?

assembly84

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #6 on: February 18, 2014, 10:54:47 pm »
How 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.
try to be better

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to convert lazarus.win32 into linux-arm
« Reply #7 on: February 19, 2014, 02:43:54 am »
Quote
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.
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

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #8 on: February 19, 2014, 03:26:28 am »
Quote
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.
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
try to be better

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to convert lazarus.win32 into linux-arm
« Reply #9 on: February 19, 2014, 11:42:21 am »
Quote
it's means i've to build one according my need ?
yes
Quote
install 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

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #10 on: February 22, 2014, 07:35:10 am »
Quote
it's means i've to build one according my need ?
yes
Quote
install 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(208,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
« Last Edit: February 23, 2014, 04:46:24 am by assembly84 »
try to be better

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to convert lazarus.win32 into linux-arm
« Reply #11 on: February 22, 2014, 08:02:53 am »
Quote
C:\development\fpc\bin\arm-linux\arm-linux-ld.exe: cannot open linker script file linux: No such file or directory
No idea. What version of binutils are you building?

assembly84

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #12 on: February 22, 2014, 08:24:19 am »
Quote
C:\development\fpc\bin\arm-linux\arm-linux-ld.exe: cannot open linker script file linux: No such file or directory
No 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    <DIR>          .
02/21/2014  12:01 PM    <DIR>          ..
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.
« Last Edit: February 23, 2014, 04:47:02 am by assembly84 »
try to be better

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to convert lazarus.win32 into linux-arm
« Reply #13 on: February 22, 2014, 09:27:26 am »
Quote
i'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

  • New Member
  • *
  • Posts: 31
  • Just Programmer
    • assembly84.net
Re: How to convert lazarus.win32 into linux-arm
« Reply #14 on: February 22, 2014, 09:33:17 am »
Quote
i'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  :D
try to be better