Forum
× Cross-Build discussions that don't fit in any of the other specific forum categories

Topic-icon Solved GTK2 ScrollBar CrossCompile for ARM

  • Juanjo
  • Juanjo's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
3 years 6 months ago #3449

Hi to everybody.

This is my first post.

I have CorssCompiled one simple form application for ARM-Linux with CodeTyphon 4.10.

In a form i drop one scrollbar without any behind code. When the application is executed in the host system(x86-64) works as expected. If i crosscompile the application from x86-64 to ARM then one SIGSEV crash is in the unit gtk2callback.inc only when the scrollbar is clicked:

function Gtk2RangeScrollCB(ARange: PGtkRange; AScrollType: TGtkScrollType; AValue: gdouble; AWidgetInfo: PWidgetInfo): gboolean; cdecl;

AWidgetInfo^.LCLObject is an invalid object. This is the reason of the fail. This problem has been reported to http://forum.lazarus.freepascal.org/index.php/topic,20129.0.html also.

If the application is compiled in the ARM system then works as expected also. The problem with the scrollbar is only if the application is crosscompiled. I have tested the application with GNU toolchain externally to CodeTyphon and the problem persists.

This is a hard problem.

Some erudite please ??

Last Edit: 3 years 6 months ago by Juanjo.

Please Log in or Create an account to join the conversation.

  • Juanjo
  • Juanjo's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
3 years 6 months ago #3464

Problem Solved


forum.lazarus.freepascal.org/index.php/topic,19827.15.html

The problem was the compiler options and for this reason errors in the calling conventions.

Regards

The following user(s) said Thank You: Avra

Please Log in or Create an account to join the conversation.

  • Fredy Caballero
  • Fredy Caballero's Avatar
  • Offline
  • Junior Boarder
  • Database/Developer
More
3 years 6 months ago #3465

:cheer: great news

the script must be modified on other parts more of the script

Can you suggest the modifications you made for future reference?

please.

thanks

Please Log in or Create an account to join the conversation.

  • Juanjo
  • Juanjo's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
3 years 6 months ago #3496

Yes, the script mus be modified in all "make" instructions in their respective OS script. For example in linux could be ln_FPCx_Build_Cross.sh for arm.

Regards

Last Edit: 3 years 6 months ago by Juanjo.

Please Log in or Create an account to join the conversation.

More
3 years 3 days ago #4529

I built an app for raspberry pi using CT 4.5. The app had a scrollbar. Basically, the app was working on the raspberry pi, but the app crashed if I changed the scrollbar.

It looks like this thread is the solution.

Would you teach me how to avoid the app crash when the scrollbar is changed?

Last Edit: 3 years 3 days ago by chulwoong.

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #4989

I had the same problem !!

Please look at:
forum.lazarus.freepascal.org/index.php/topic,23075.0.html
reply #27 and #30

In short:
Make the following changes to the script "x_FPC_Build_Cross.bat" inside "ScriptsWin/Crossbuild":

Inside Stage 1:
START /D C:\codetyphon\fpcsrc\ /B /WAIT C:\codetyphon\fpc\bin\%2\make.exe all CPU_TARGET=%4 OS_TARGET=%5 BINUTILSPREFIX=%4-%5- OPT="-dFPC_ARMHF" FPC=%3.exe

Inside stage 2:
START /D C:\codetyphon\fpcsrc\ /B /WAIT C:\codetyphon\fpc\bin\%2\make.exe -C rtl clean CPU_TARGET=%4 OS_TARGET=%5 BINUTILSPREFIX=%4-%5- OPT="-dFPC_ARMHF" FPC=%6.exe
START /D C:\codetyphon\fpcsrc\ /B /WAIT C:\codetyphon\fpc\bin\%2\make.exe -C packages clean CPU_TARGET=%4 OS_TARGET=%5 BINUTILSPREFIX=%4-%5- OPT="-dFPC_ARMHF" FPC=%6.exe
START /D C:\codetyphon\fpcsrc\ /B /WAIT C:\codetyphon\fpc\bin\%2\make.exe rtl packages CPU_TARGET=%4 OS_TARGET=%5 BINUTILSPREFIX=%4-%5- OPT="-dFPC_ARMHF" FPC=%6.exe

As you can see, in fact, 4 very simple changes: add OPT="-dFPC_ARMHF" to enable hardfloat.
(I use Arch Linux hardfloat for the BBB).

Also include "-dFPC_ARMHF" in your project options (Compiler Options / Other / Custom options).

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.