Welcome, Guest
Username: Password: Remember me
CodeTyphon Cross-Build Development, discussions and problems
  • Page:
  • 1

TOPIC:

Cross-compile linker error 3 years 11 months ago #15430

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
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.

Cross-compile linker error 3 years 11 months ago #15439

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4540
  • Thank you received: 1117
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.

Cross-compile linker error 3 years 11 months ago #15440

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
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.

Cross-compile linker error 3 years 11 months ago #15441

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4540
  • Thank you received: 1117
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.

Cross-compile linker error 3 years 11 months ago #15443

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
Thanks for the clue: will try and give feedback later this week.

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

Cross-compile linker error 3 years 11 months ago #15447

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
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.

Cross-compile linker error 3 years 11 months ago #15481

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
 Success!
It took some days for setting up the whole environment.Success! See attached picture for details.   

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

Cross-compile linker error 3 years 11 months ago #15482

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1132
  • Thank you received: 170
Thanks
CT ver 7.30 is our suggestion.

PS: please, your arm board ?
PilotLogic Core Programmer

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

Last edit: by Matis A..

Cross-compile linker error 3 years 11 months ago #15483

  • Francesco Salvi
  • Francesco Salvi's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 17
  • Thank you received: 0
Odroid xu4, Armbian, CPU Cortex-A7 (32 bit)

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

Cross-compile linker error 3 years 11 months ago #15485

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1132
  • Thank you received: 170
Thanks Sir
PilotLogic Core Programmer

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

  • Page:
  • 1