[fpc-devel] Cross-compiling and warnings from linker

Pierre Muller pierre at freepascal.org
Fri Nov 12 10:20:02 CET 2021



Le 10/11/2021 à 21:19, Sergey Organov via fpc-devel a écrit :
> Hello,
> 
> Using cross-compiler from x86-linux to arm-linux, I keep getting a lot
> of warnings at the linking stage of my programs, in the form:
> 
> /opt/[...]/arm-linux-gnueabihf-ld: warning: library search path "/usr/lib/eject/" is unsafe for cross-compilation
> /opt/[...]/arm-linux-gnueabihf-ld: warning: warning: library search path "/usr/lib/console-setup/" is unsafe for cross-compilation
> [...]
> 
> for virtually every sub-directory in /usr/lib. FPC 3.2.0 and 3.2.2 both
> have this issue.
> 
> This makes me suspect FPC cross produces instructions for the linker to
> search for files in wrong directories, where host libraries reside, that
> could lead to unpredictable results, and then tons of the warnings are
> really annoying.
> 
> What's the way to fix this?

   Try to use -Xd compiler option
~/bin$ fpc -h | grep -- -Xd
       -Xd        Do not search default library path (sometimes required for cross-compiling when not using -XR)


Pierre


More information about the fpc-devel mailing list