Recent

Author Topic: Lazarus and cross-compilation  (Read 341 times)

MarkMLl

  • Full Member
  • ***
  • Posts: 134
Lazarus and cross-compilation
« on: September 11, 2019, 08:37:50 pm »
Working on Debian "Buster" AMD64 with Lazarus 2.1.0 and FPC 3.0.4, with Debian's multi-arch installed and installed. No known configuration problems compiling and running 64-bit programs.

A simple LCL program cross-compiled to i386 runs without problems, but a more complex one using TAChart and a few TPaintboxes fails with

[FORMS.PP] ExceptionOccurred
  Sender=Exception
  Exception=Could not load OpenGL from libGL.so.1
  Stack trace:
  $088F8F43  LOADOPENGL,  line 1895 of ./opengl/src/gl.pp
  $088FAF47  GL_$$_init$,  line 2273 of ./opengl/src/gl.pp
  $084F9271  fpc_initializeunits,  line 886 of /usr/local/src/fpc/fpcbuild-3.0.4/fpcsrc/rtl/inc/system.inc
  $084E0FDA  main,  line 81 of dsocat.lpr
Exception at 088F8F43: Exception:
Could not load OpenGL from libGL.so.1.

ldd output doesn't show anything unexpected.

I know that this is an issue that others have seen in the past, but have yet to see a definitive solution. Has anybody actually cracked it?

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

jamie

  • Hero Member
  • *****
  • Posts: 1990
Re: Lazarus and cross-compilation
« Reply #1 on: September 11, 2019, 08:46:14 pm »
somewhere you included the GL library which most likely is failing due to not being installed I guess.

MarkMLl

  • Full Member
  • ***
  • Posts: 134
Re: Lazarus and cross-compilation
« Reply #2 on: September 11, 2019, 09:32:36 pm »
somewhere you included the GL library which most likely is failing due to not being installed I guess.

It's definitely not imported explicitly, and I've tried installing Debian's libopengl0:i386 which didn't change the symptom.

What's more, as I've already said, ldd output didn't show anything missing,

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

wp

  • Hero Member
  • *****
  • Posts: 6231
Re: Lazarus and cross-compilation
« Reply #3 on: September 11, 2019, 10:55:12 pm »
A simple LCL program cross-compiled to i386 runs without problems, but a more complex one using TAChart and a few TPaintboxes fails with [...]
I thought that TAChart by itself does not use OpenGL and its OpenGL drawingbackend is contained in a separate package. But this is not true...

Please open the TAChartLazarusPackage.lpk file and remove the units TADrawerOpenGL and TAOpenGL from the file list. Recompile the package (or better: do a clean recompilation of the IDE) and try again. Report back if this fixes the issue.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

MarkMLl

  • Full Member
  • ***
  • Posts: 134
Re: Lazarus and cross-compilation
« Reply #4 on: September 12, 2019, 09:31:56 am »
Please open the TAChartLazarusPackage.lpk file and remove the units TADrawerOpenGL and TAOpenGL from the file list. Recompile the package (or better: do a clean recompilation of the IDE) and try again. Report back if this fixes the issue.

I'll try that and report back, but it will probably take me a couple of days due to other commitments.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

MarkMLl

  • Full Member
  • ***
  • Posts: 134
Re: Lazarus and cross-compilation
« Reply #5 on: September 12, 2019, 06:31:22 pm »
Please open the TAChartLazarusPackage.lpk file and remove the units TADrawerOpenGL and TAOpenGL from the file list. Recompile the package (or better: do a clean recompilation of the IDE) and try again. Report back if this fixes the issue.

Yes, that fixes it with full recompilation from latest trunk. Only noteworthy thing is that when switching from debugging 64-bit to debugging 32-bit the debugger needs to be reset.

I anticipated that getting trunk recompiled might take me a bit longer than it actually did, since I had to go back to Debian "Stretch's" repository to get a copy of libqt4pas-dev ("Buster" has moved on to libqt5pas-dev).

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.