× CodeTyphon Cross-Build Development, discussions and problems

Question Cross-compile linker error

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 2 weeks ago #15430 by Francesco Salvi
Cross-compile linker error was created by Francesco Salvi
Hello, happy new year to all and stay healthy!

I've got a problem with the linker during a cross-compilation from Win64 to ARM32 on Linux (Raspberry PI2 and PI3 too).
Explanation: after having succesfully compiled all the units of my customer's project (which I can't disclose),
the linker gives the following error:

c:\codetyphon\fpc\fpc32\bin\i386-win32\arm-linux-ld.exe: C:\codetyphon\binLibraries\arm-linux-Raspbian2\crtbegin.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
C:\codetyphon\binLibraries\arm-linux-Raspbian2\crtbegin.o: error adding symbols: Bad value
screensimulatorraspberrypi2.ppr(27,0) Error: Error while linking

When linking for Win32 or Win64, all goes ok.
After searching info about the -fPIC option, I've found the following info "add --enable-shared at ./configure options".
This info is on page stackoverflow.com/questions/13812185/how-to-recompile-with-fpic
but unfortunately I don't know how to configure it.
Please tell me what menu to open and what setting to look for.
Sorry for wasting your time: please just point me in the right direction.

Thanks, Francesco.

 

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 1 week ago #15439 by Sternas Stefanos
Replied by Sternas Stefanos on topic Cross-compile linker error
Thanks Sir
I think is a load Library problem.
Please check your external libraries your program use

PilotLogic Architect and Core Programmer

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

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #15440 by Francesco Salvi
Replied by Francesco Salvi on topic Cross-compile linker error
Thanks, unfortunately my code contains only dynamically loaded DLL and not any statically-linked DLL, so I am sure that some third party library or component causes the error. Will try to erase almost all working code, leaving just "empty" units and then remove the uses, one by one, until the error disappears. This check will require some time to complete.
Question: does any setting affect the linker optimization during this phase, kind of a "automatically skip unused libraries while linking"?
 

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 1 week ago #15441 by Sternas Stefanos
Replied by Sternas Stefanos on topic Cross-compile linker error
No
in cross-build way these "tricks" are very limited.

My suggestion is to try CT and your App to a real PI4,
CT works OK, to Arm32 and Arm64 Raspberry Pi OS.
 

PilotLogic Architect and Core Programmer
The following user(s) said Thank You: Francesco Salvi

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

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #15443 by Francesco Salvi
Replied by Francesco Salvi on topic Cross-compile linker error
Thanks for the clue: will try and give feedback later this week.

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

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 week ago #15447 by Francesco Salvi
Replied by Francesco Salvi on topic Cross-compile linker error
I don't have a real PI4 at the moment: will try tomorrow on an Odroid xu4, Armbian, CPU Cortex-A7 (32 bit), but will have to install CT for this task only ...

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

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 day ago #15481 by Francesco Salvi
Replied by Francesco Salvi on topic Cross-compile linker error
 Success!
It took some days for setting up the whole environment.Success! See attached picture for details.   
Attachments:

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

More
4 months 1 day ago - 4 months 1 day ago #15482 by Matis A.
Replied by Matis A. on topic Cross-compile linker error
Thanks
CT ver 7.30 is our suggestion.

PS: please, your arm board ?

PilotLogic Core Programmer
Last edit: 4 months 1 day ago by Matis A..

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

  • Francesco Salvi
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 months 1 day ago #15483 by Francesco Salvi
Replied by Francesco Salvi on topic Cross-compile linker error
Odroid xu4, Armbian, CPU Cortex-A7 (32 bit)

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

More
4 months 1 day ago #15485 by Matis A.
Replied by Matis A. on topic Cross-compile linker error
Thanks Sir

PilotLogic Core Programmer

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