[Lazarus] Help needed for issue #20311: IDE always tailors "Target processor" options for Intel CPUs

Sven Barth pascaldragon at googlemail.com
Fri Sep 13 10:25:00 CEST 2013


Am 13.09.2013 09:50, schrieb Juha Manninen:
> On Fri, Sep 13, 2013 at 12:10 AM, Mark Morgan Lloyd
> <markMLl.lazarus at telemetry.co.uk> wrote:
>> What do you need for this: fpc -i output?
> Yes, running on different CPUs. It is this section:
>    Supported CPU instruction sets:
>
> My version shows only "ATHLON64" which I fixed now in the code for x86_64 CPU.
>
> Mattias earlier told me about "fpc -P" option for selecting the CPU,
> but it would require a cross-compiled fpc or something. For me only
> this works:
>   $ fpc -i -Px86_64
>
> Other values like "fpc -i -Pi386" or "fpc -i -Parm" give an error:
>    Error: ppc386 can't be executed, error message: Failed to execute
> "ppc386", error code: 127
>
> One thing is that selecting a different CPU family and processor type
> in Lazarus IDE is not supported by FPC in most cases, but at least we
> should see realistic choices in the list.
When you only do a

make all CPU_TARGET=Whatever_CPU OS_TARGET=Whatever_Target

then a compiler for that target will be created (e.g. ppc386, ppcx64, 
ppc68k, etc.). You should not use that compiler for production however 
as it is compiled using the RTL of your starting compiler. For checking 
the supported CPUs using "-i" this will be sufficient however.

Thereby "Whatever_CPU" is one of FPC's supported CPUs (e.g. i386, 
x86_64, m68k, mips, etc.) and "Whatever_Target" is a target supported on 
that CPU (mostly you can use "linux", for AVR you'll need to use 
"embedded" AFAIK).

Alternatively you can just take a look at the compiler/$cpu/cpuinfo.pas 
units where there is a tcpuinfo enum and a cputypestr array. The latter 
is what you can pass using -Cp.

Regards,
Sven




More information about the Lazarus mailing list