[fpc-devel] Questions regarding m68k-atari target

Florian Klämpfl florian at freepascal.org
Sat Feb 12 12:51:11 CET 2022

> Am 12.02.2022 um 11:46 schrieb Karoly Balogh <charlie at scenergy.dfmk.hu>:
> 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.

I think it must be tried, in practice one hits also some strange obstacle one never things before ... I would also expect that the former works and is the better solution though it requires also that the CPU/FPU/ABI are immediately set.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220212/9f9429c2/attachment.htm>

More information about the fpc-devel mailing list