[fpc-devel] Questions regarding m68k-atari target

Karoly Balogh charlie at scenergy.dfmk.hu
Sat Feb 12 11:46:06 CET 2022


Hi,

On Sat, 12 Feb 2022, Florian Klämpfl via fpc-devel wrote:

> >> My config file has -Tatari set, so the LINUX define is no issue. But if
> >> i invoke the compiler without excplicit -Cp<x>, it will generate code
> >> for 68000, but take the libraries from the 68020 directory. It works as
> >> intended if i explictly specify -Cp68000.
> >
> > Yes, and I agree this is a valid issue, because apparently it only sets
> > the target CPU subarch and target FPU settings after the entire config
> > file was processed. We probably have to set these when the -T argument is
> > first encountered.
>
> Note that this should work if the target is passed on the command line
> because the command line is parsed twice to avoid exactly this. If you
> need to set the target in the config, just set the target cpu and target
> fpu (-Cp and -Cf) as well. As the workings of the switches is
> interwinded there is unfortunatly no good other solution.

I'm thinking about refactoring this.

Couldn't we include the default CPU/FPU subatch in target_info? That would
simplify away a bunch of platforms, which is now dealt with in a huge
case-switch.

Alternatively, we could add a "reevaluate CPUs" function and move the
switch there, and call it whenever the target OS and the ABI is set, which
is really the two only cases where target CPUs have to be set, as far as I
can see from the code.

Charlie


More information about the fpc-devel mailing list