[fpc-pascal] Running FPC on a system that supports multiple architectures

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Tue Oct 9 10:20:29 CEST 2012


Mark Morgan Lloyd wrote:
> Marco van de Voort wrote:
>> In our previous episode, Mark Morgan Lloyd said:
>>>> IIRC there is also a CROSSBINUTILSPREFIX in case you only have to 
>>>> override
>>>> it for the "cross" part.
>>> Thanks Marco, I'd missed -XP since I was mistakenly looking at the -A 
>>> section.
>>>
>>> For information, it works, but I'm getting an error when it calls the 
>>> linker. If I link using a script it's fine:
>>
>> 1. IIRC FPC uses a builtin list of paths and -FD paths
>>
>> 2. The shell might use its own $PATH.
>>  
>> Solution, pass -FD or CROSSBINDIR (or something, search in makefile)
> 
> I'd not expect this to be a path problem since I've symlinked the 
> assemblers into /usr/local/bin which is where ppc386 is, -vt output says 
> that it's finding the binary and using an explicit -FD doesn't have an 
> obvious effect.

I don't believe that this is a path problem since the assembler pass 
works, but I can make it fail by specifying the -a parameter:

$ fpc -XPi486-linux- -a test.pas
Free Pascal Compiler version 2.6.0 [2012/05/05] for i386
Copyright (c) 1993-2011 by Florian Klaempfl and others
Note: Switching assembler to default source writing assembler
Target OS: Linux for i386
Compiling test.pas
Assembling test
test.pas(4,26) Error: Can't call the assembler, error -9 switching to 
external assembling
test.pas(4,26) Error: Error while linking
test.pas(4,26) Fatal: There were 3 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you 
did not specify a source file to be compiled)

So it appears to be something to do with how the compiler communicates 
with as or ld.

This was on an IA-64 system using its hardware emulation of x86. I think 
there's a potential that this could also occur on an x86-64 system, but 
I don't have one to test it on.

-- 
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-pascal mailing list