[fpc-devel] Native compilers for non-x86

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Tue Mar 2 18:03:08 CET 2010

Henry Vermaak wrote:
> On 25 February 2010 21:22, Mark Morgan Lloyd
> <markMLl.fpc-devel at telemetry.co.uk> wrote:
>> I'm having another of my periodic attempts at getting various systems
>> up-to-date here, and I wonder if I could ask for help with build problems.
>> First machine is an ARM-based Linksys NSLU2 "Slug", running Debian "Squeeze"
>> i.e. little-endian EABI. I've previously managed to build for this using (I
>> think) 2.5.1. I experimentally reverted to 2.4.0 but an attempt at building
>> gave me
> I've managed to build fpc for the slug running debian squeeze (a while
> ago), so there is hope.  I even managed to run the testsuite - you may
> be amused by my fumblings here:
> http://bugs.freepascal.org/view.php?id=14386
>> In both cases the commandline I'm using is
>> make 'NOGDB=1' 'OPT=-O- -gl -vt' 'EXTDEBUG=1' all
> You will have to build the compiler for EABI, so add -dFPC_ARMEL to
> your OPT parameter.  I'm afraid I don't have tips for the build
> failing, but maybe you should try the latest trunk and submit a
> bugreport with the trace.

Thanks Henry, noted. I was able to use a ppcarm from Florian (I think) 
to bootstrap 2.5.1 (about September 11th), after which I could build 
reliably using

make 'GDB_V607=1' 'OPT=-O- -gl -vt NOWPOCYCLE=1' all

Can anybody say whether I still need this NOWPOCYCLE=1?

As you say, running a compilation on a Slug tends to take a while. I've 
got some probably-faster boards badged "iEi" but they're flashed to run 
CE and the manufacturer wanted some extortionate amount for a Linux 
conversion kit. I'm hoping that if I can get something like OpenFirmware 
booting from disc that I can then boot Linux, but it's not going to 
happen overnight.

For other processors (x86, SPARC, PPC) I'm now using

make 'GDB_V607=1' 'OPT=-O- -gl -vt -dEXTDEBUG' all

successfully. Output is piped into Perl which gives me a summary of what 
sources are used- I figured I'd need that for tackling the SPARC IDE 
problem, unfortunately it means I can't use make -j on the larger systems.

On ARMEL I've just run this a couple of times

make 'GDB_V607=1' 'NOWPOCYCLE=1' 'OPT=-O- -gl -vt -dEXTDEBUG' all

which goes further than it did without the NOWPOCYCLE but it 
(eventually) fails with

make[3]: Leaving directory `/usr/local/src/fpc/fpcbuild/fpcsrc/compiler'
/usr/bin/diff ppc3 ppcarm
Binary files ppc3 and ppcarm differ
make[2]: *** [cycle] Error 2
make[2]: Leaving directory `/usr/local/src/fpc/fpcbuild/fpcsrc/compiler'
make[1]: *** [compiler_cycle] Error 2
make[1]: Leaving directory `/usr/local/src/fpc/fpcbuild/fpcsrc'
make: *** [build-stamp.arm-linux] Error 2

[Much later] I think I've got it to work using

make 'GDB_V607=1' 'NOWPOCYCLE=1' 'OPT=-O- -gl -dFPC_ARMEL -vt 

Both the NOWPOCYCLE and FPC_ARMEL appear to be essential, at least with 
the compiler I was starting with.

I've now got a fairly up-to-date 2.5.1. fpc will compile a minimal test 
program but I find that if I force a segv gdb has difficulty getting bt 
parameters. fp also works and shows disassembly etc.

I'll run a few more test compilations since it would be interesting to 
find out whether now that I've got a recent 2.5.1 I can dispense with 
either NOWPOCYCLE or FPC_ARMEL. However my main focus at present is 
checking out Lazarus on the various platforms available to me since I'm 
trying to map out the next couple of months development for management.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list