Recent

Author Topic: Fpcupdeluxe  (Read 792622 times)

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #165 on: December 04, 2016, 01:09:10 am »
Fantastic :) What should I do with the Crossbintools rar?

I've downloaded, but should I put them somewhere specific, or link them, for fcpupdeluxe to find them? (this is my first attempt to cross-compile with lazarus)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #166 on: December 04, 2016, 08:33:01 am »
Nothing !
These files are to be found online by fpcupdeluxe itself.
So, do not download them yourself.
Just press install crosscompiler.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #167 on: December 04, 2016, 11:54:03 am »
Added crossing from Linux i386 to various systems.

See: https://github.com/newpascal/fpcupdeluxe/releases/tag/v1.1.0c

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #168 on: December 04, 2016, 05:04:22 pm »
Nothing !
These files are to be found online by fpcupdeluxe itself.
So, do not download them yourself.
Just press install crosscompiler.

Doh! Thanks... ok so at first I had the same errors but I had some strange packages installed. I've cleared those out and now and fpcupdeluxe reports success :)

Now I've just got some path problems to sort out since "classes" isn't found. I think there's something wrong with the default widgetset (compiling on Linux64 for Linux64). A blank form compiles and runs but I can't add buttons and labels.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #169 on: December 04, 2016, 05:54:54 pm »
Lazarus - Tools - Rescan FPC source directory ?

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #170 on: December 04, 2016, 06:41:35 pm »
Lazarus - Tools - Rescan FPC source directory ?

That does the trick for compiling and cross-compiling!

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #171 on: December 04, 2016, 11:07:15 pm »
When I try to run a program I've cross compiled from Linux 64 to ARM (RPi2) I get an exception before the GUI loads.
The same also happens when I try to run fpcupdeluxe-arm-linux:

Code: Pascal  [Select][+][-]
  1. An unhandled exception occured at $00025F50:
  2. EAccessViolation: Access Violadtion
  3.   $00025F50
  4.  

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #172 on: December 05, 2016, 07:43:23 am »
What distro do you run on your RPi2/3 ?
Hardfloat ? Softfloat.
Does your cross-app run on your RPi3 ?

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #173 on: December 05, 2016, 11:55:05 am »
What distro do you run on your RPi2/3 ?
Hardfloat ? Softfloat.
Does your cross-app run on your RPi3 ?

On my RPI3: Raspbian GNU/Linux 8 (jessie), Hardfloat, cross-compiled app works fine
On my RPI2: Raspbian GNU/Linux 8 (jessie), Hardfloat, exceptions running cross compiled app or fpcupdeluxe

But, if I take the same helloworld app and compile it on the RPI3 then transfer the output binary it to the RPI2 it executes properly.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #174 on: December 05, 2016, 12:57:54 pm »
Thanks for the info.
I think this is a problem that has been here before.

When building cross-binaries, the libraries for the target system have to be present.
However, there a many Linux flavours.
Mine is Arch Linux. So, these libraries are available online for fpcupdeluxe.

Few weeks ago, linux i386 and x86_64 libs were changed towards Mint.
Arch Linux is not a very popular distro.

Now, the libs for Linux Arm have also been changed, towards Raspbian.
So, you can delete the cross/lib/arm-linux directory.
And build yourself a new cross-compiler the same way as you did before with fpcupdeluxe. The Raspbian libs will be downloaded.

Please test to see if this solves your problems.

edit:
And don't link anymore with GLESv2 ... that's an Arch thing.
« Last Edit: December 05, 2016, 01:17:49 pm by DonAlfredo »

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #175 on: December 05, 2016, 01:39:32 pm »
Thanks again for your help :)
At first I had some errors but I tried again and it worked the second time.

I feel like I'm at the last hurdle. Compiling on the native platform works, trying to cross-compile my test app I receive:

    helloworld.lpr(32,0) Warning: Library libc_nonshared.a not found, Linking may fail !

I've googled about but all I can find is instructions to insert:
Code: Pascal  [Select][+][-]
  1. {$ifdef FPC_CROSSCOMPILING}
  2.   {$ifdef Linux}
  3.     {$linklib libc_nonshared.a}
  4.     {$IFDEF CPUARM}
  5.       // for GUI on RPi[1,2,3]
  6.       {$linklib GLESv2}
  7.     {$ENDIF}
  8.   {$endif}
  9. {$endif}
  10.  

Which is in my lpr source, although I've removed GLESv2 as per your comment.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #176 on: December 05, 2016, 02:23:53 pm »
Try also to remove the {$linklib libc_nonshared.a} statement !!

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #177 on: December 05, 2016, 04:49:29 pm »
Try also to remove the {$linklib libc_nonshared.a} statement !!

I appreciate your patience in helping me out.
Here's the output:

Code: Pascal  [Select][+][-]
  1. Compile Project, Mode: RPI, CPU: arm, Target: helloworld-arm-linux: Exit code 256, Errors: 1, Warnings: 2
  2. helloworld.lpr(32,0) Warning: "crti.o" not found, this will probably cause a linking failure
  3. helloworld.lpr(32,0) Warning: "crtn.o" not found, this will probably cause a linking failure
  4. helloworld.lpr(32,0) Error: Error while linking
  5.  

I assumed that was because I was missing target libs so I've put those .o files and .so files from /lib, /usr/lib and /usr/lib/arm-linux-gnueabihf into a folder and added it to the project options (-FL): ../../Apps/fpcup/arm-libs

Now I just get:

Code: Pascal  [Select][+][-]
  1. Compile Project, Mode: RPI, CPU: arm, Target: helloworld-arm-linux: Exit code 256, Errors: 1
  2. helloworld.lpr(32,0) Error: Error while linking
  3.  

from the command line I saw:

Code: Pascal  [Select][+][-]
  1. [TCompiler.Compile] CmdLine="/home/mike/Apps/lazarus/fpc/bin/x86_64-linux/fpc.sh  -Tlinux -Parm -MObjFPC -Scghi -O1 -l -vewnhibq -Fi/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux -Fl/home/mike/Apps/fpcup/arm-libs -Fl/opt/gnome/lib -Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux/gtk2 -Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux -Fu/home/mike/Apps/lazarus/lazarus/components/lazutils/lib/arm-linux -Fu/home/mike/Apps/lazarus/lazarus/packager/units/arm-linux -Fu/home/mike/source/Lazarus/CrossCompHW2/ -FU/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux/ -ohelloworld-arm-linux -dLCL -dLCLgtk2 helloworld.lpr"
  2. Info: (lazarus) Execute Title="Compile Project, Mode: RPI, CPU: arm, Target: helloworld-arm-linux"
  3. Info: (lazarus) Working Directory="/home/mike/source/Lazarus/CrossCompHW2/"
  4. Info: (lazarus) Executable="/home/mike/Apps/lazarus/fpc/bin/x86_64-linux/fpc.sh"
  5. Info: (lazarus) Param[0]="-Tlinux"
  6. Info: (lazarus) Param[1]="-Parm"
  7. Info: (lazarus) Param[2]="-MObjFPC"
  8. Info: (lazarus) Param[3]="-Scghi"
  9. Info: (lazarus) Param[4]="-O1"
  10. Info: (lazarus) Param[5]="-l"
  11. Info: (lazarus) Param[6]="-vewnhibq"
  12. Info: (lazarus) Param[7]="-Fi/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux"
  13. Info: (lazarus) Param[8]="-Fl/home/mike/Apps/fpcup/arm-libs"
  14. Info: (lazarus) Param[9]="-Fl/opt/gnome/lib"
  15. Info: (lazarus) Param[10]="-Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux/gtk2"
  16. Info: (lazarus) Param[11]="-Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux"
  17. Info: (lazarus) Param[12]="-Fu/home/mike/Apps/lazarus/lazarus/components/lazutils/lib/arm-linux"
  18. Info: (lazarus) Param[13]="-Fu/home/mike/Apps/lazarus/lazarus/packager/units/arm-linux"
  19. Info: (lazarus) Param[14]="-Fu/home/mike/source/Lazarus/CrossCompHW2/"
  20. Info: (lazarus) Param[15]="-FU/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux/"
  21. Info: (lazarus) Param[16]="-ohelloworld-arm-linux"
  22. Info: (lazarus) Param[17]="-dLCL"
  23. Info: (lazarus) Param[18]="-dLCLgtk2"
  24. Info: (lazarus) Param[19]="helloworld.lpr"
  25. [TCompiler.Compile] end
  26. Hint: (lazarus) [TMainIDE.DoBuildProject] compiler time in s: 0.362000148743391
  27. Error: (lazarus) [TMainIDE.DoBuildProject] Compile failed
  28.  

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1738
Re: Fpcupdeluxe
« Reply #178 on: December 05, 2016, 05:33:27 pm »
@macmike
These errors are getting impossible ... :-(

Quote
helloworld.lpr(32,0) Warning: "crti.o" not found, this will probably cause a linking failure
helloworld.lpr(32,0) Warning: "crtn.o" not found, this will probably cause a linking failure
is impossible ... these files are available in the libraries for Arm [as was libc_nonshared.a btw] !!

Quote
Info: (lazarus) Executable="/home/mike/Apps/lazarus/fpc/bin/x86_64-linux/fpc.sh"
Info: (lazarus) Param[0]="-Tlinux"
Info: (lazarus) Param[1]="-Parm"
Info: (lazarus) Param[2]="-MObjFPC"
Info: (lazarus) Param[3]="-Scghi"
Info: (lazarus) Param[4]="-O1"
Info: (lazarus) Param[5]="-l"
Info: (lazarus) Param[6]="-vewnhibq"
Info: (lazarus) Param[7]="-Fi/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux"
Info: (lazarus) Param[8]="-Fl/home/mike/Apps/fpcup/arm-libs"
Info: (lazarus) Param[9]="-Fl/opt/gnome/lib"
Info: (lazarus) Param[10]="-Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux/gtk2"
Info: (lazarus) Param[11]="-Fu/home/mike/Apps/lazarus/lazarus/lcl/units/arm-linux"
Info: (lazarus) Param[12]="-Fu/home/mike/Apps/lazarus/lazarus/components/lazutils/lib/arm-linux"
Info: (lazarus) Param[13]="-Fu/home/mike/Apps/lazarus/lazarus/packager/units/arm-linux"
Info: (lazarus) Param[14]="-Fu/home/mike/source/Lazarus/CrossCompHW2/"
Info: (lazarus) Param[15]="-FU/home/mike/source/Lazarus/CrossCompHW2/lib/arm-linux/"
All the above directories are unrecognizable for something that has been installed by fpcupdeluxe !

So, for me, it is now unclear how you have been able to setup fpcupdeluxe like this !
The directory structure for fpcupdeluxe is like this:
installdir/config_lazarus
installdir/cross (with lib and bin directory)
installdir/fpc
installdir/fpcbootstrap
installdir/lazarus
installdir/projects

So again, I do not understand your system anymore.

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Fpcupdeluxe
« Reply #179 on: December 05, 2016, 05:36:05 pm »
My installDir is /home/mike/Apps/lazarus, that's perhaps why it looks odd.
Shall I try to empty it all out and start again?

 

TinyPortal © 2005-2018