[fpc-pascal] x86-linux-gnu cross

Adriaan van Os fpc at microbizz.nl
Tue Sep 1 20:28:25 CEST 2020


On Mac OS X 10.8, I have built an fpc-3.0.4  runtime-library for CPU_TARGET=x86_64 OS_TARGET=linux 
BINUTILSPREFIX=x86_64-linux-gnu- after building gnu binutils-2.34 for  --target=x86_64-linux-gnu 
--host=i686-apple-darwin --build=i686-apple-darwin --prefix=/usr/local.

Now the following program crashes when compiled on OSX and executed on 64-bit debian 6.0.7.

{$linklib libgcc_s.so}
program Hello;
   uses
     cmem;
   begin
     writeln
       ( 'Hello');
   end.

but this runs fine

{$linklib libgcc.a}
{$linklib libgcc_eh.a}
{$linklib libc.a}
program Hello;
   uses
     cmem;
   begin
     writeln
       ( 'Hello');
   end.

Linking with other shared libs (maybe dependent on libgcc_so?) also causes a segmentation fault on 
start. All the libs are from <https://packages.debian.org/>.

My impression is that somehow linking-in the c-libs causes the entry-point of the program to be 
wrong. Maybe there is a linker option (I don't know of) to prevent this ?

Regards,

Adriaan van Os


More information about the fpc-pascal mailing list