[fpc-devel] Porting fpc to linux-sparc64

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Mon May 29 15:59:37 CEST 2017


Hi,

On Mon, 29 May 2017, John Paul Adrian Glaubitz wrote:

> In the end, I want to build the Debian package. So, the patches have
> to apply against that version.

Well. I applied a 1 line patch against rtl/linux/Makefile.fpc, to append
-32 when it builds the startup code, regenerated the Makefile using
fpcmake -Tall, then started a the build like this in ~/fpc/trunk/:

 make all OPT="-ao-32"

Obviously, the startup compiler doesn't have the -32 fix, so this is why
it failed for you, but this option inject this option externally.

Then the build initial phase where it rebuilds a new compiler, and starts
to use it succeeds. Which is the good news! And then it went through the
point where it wants to build fpmake natively with the new compiler. Where
it fails with:

/home/charlie/fpc/trunk/compiler/ppcsparc fpmake.pp
-Fu/home/charlie/fpc/trunk/packages/fpmkunit/units_bs/sparc-linux
-Fu/home/charlie/fpc/trunk/rtl/units/sparc-linux  -ao-32
Free Pascal Compiler version 3.1.1 [2017/05/29] for sparc
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for SPARC
Compiling fpmake.pp
fpmake.pp(16,3) Note: Local variable "T" is assigned but never used
Assembling fpmake
Linking fpmake
fpmake.pp(49) Warning: "crti.o" not found, this will probably cause a
linking failure
fpmake.pp(49) Warning: "crtbegin.o" not found, this will probably cause a
linking failure
fpmake.pp(49) Warning: "crtend.o" not found, this will probably cause a
linking failure
fpmake.pp(49) Warning: "crtn.o" not found, this will probably cause a
linking failure
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lc
fpmake.pp(49) Error: Error while linking
fpmake.pp(49) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Makefile:1712: recipe for target 'fpmake' failed

Which is because the buildbox doesn't have these 32bit libraries
installed, so FPC obviously cannot link against them. This is because the
very limited multiarch you mentioned before I guess. Now, FPC doesn't need
Libc on linux for its own functionality, but it needs it for FPmake.

Now, FPMake is not to be mixed with FPCMake, the former is a package build
system which is used for the Packages and the IDE. It needs
libc/libpthreads for the parallel builds... (Multithreaded applications
link against libc/libpthreads with FPC under Linux, single threaded
normally do not.)

Charlie



More information about the fpc-devel mailing list