[fpc-pascal] FPC 2.x for old Solaris

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Jan 16 00:38:17 CET 2011


On 14 Jan 2011, at 15:02, Mark Morgan Lloyd wrote:

> Does anybody have an archived copy of FPC 2.x for SPARC Solaris v8 or older? The ones available by FTP (2.1.1 and 2.4.2) both appear to be for Solaris 10, i.e. expect newer libraries.
> 
> I suspect that it was available or at least built and tested at some point because the enabled packages appear to be a fairly good match to what's in v8.

I perform nightly regression testing on Solaris 9, and it works fine. I don't actually use it though, and I've never tested any of the packages (someone else did the Sparc Solaris port and enabled the packages).

It's not that hard to bootstrap everything for another system even without a cross-toolchain, only a bit labour-intensive:

a) build a SPARC cross-compiler (prerequisite: a native compiler compiled from the same FPC sources, replace ppcarch with ppc386 or equivalent)
cd fpc/compiler
make FPC=/path/to/fpc/with/same/version/ppcarch PPC_TARGET=sparc OPT="-O2" clean all
mv ppcsparc somewhereelse

b) compile the RTL into assembler files (note that this step won't work without extra preparation for all targets due to RTL assembler startup files; it does for Solaris though):
cd fpc/rtl/solaris
make FPC=somewhereelse/ppcsparc OPT="-O2 -a -s" clean all

c) compile the compiler into assembler files
cd fpc/compiler
make FPC=somewhereelse/ppcsparc OPT="-O2 -a -st" OS_TARGET=solaris clean all (ignore the error message at the end about the makefile being unable to find "pp")

d) transfer all compiled sources to your target system (make sure to create the "units" directories on the target system first)
scp -r fpc/rtl/units/sparc-solaris solarisbox:fpc/rtl/units
scp -r fpc/compiler/sparc/units/solaris-sparc solarisbox:fpc/compiler/sparc/units
scp fpc/compiler/pp_* solarisbox:fpc/compiler

e) assemble the RTL
Execute the following command in solarisbox:fpc/rtl/units/sparc-solaris directory:
for file in *.s ; do gas -o `basename $file`.o $file ; done

f) assemble and link the compiler
1) edit solarisbox:fpc/compiler/pp_link.res and perform a global search/replace to fix the absolute paths pointing to the RTL object files so they match your solaris box dir layout
2) change to the solarisbox:fpc/compiler directory and execute "./pp_ppas.sh"
3) rename the generated pp to ppcsparc


Jonas


More information about the fpc-pascal mailing list