[fpc-devel] Questions regarding m68k-atari target

Karoly Balogh charlie at scenergy.dfmk.hu
Sat Feb 12 10:54:25 CET 2022


On Sat, 12 Feb 2022, Thorsten Otto via fpc-devel wrote:

> I'm currently trying to set this up and have a problem with the
> cross-compiler. Although that was configured for atari and 68000, it
> still has LINUX and CPU68020 defined while processing the config file.

That probably can't be helped, because LINUX and 68020 is always the
default for the m68k crosscompiler. The crosscompiler for the given CPU
target will be the same, regardless of the OS target. So technically it is
possible to release a 68k crosscompiler package that could target both
Atari and Amiga (sic!), because the only difference is the units. :)

> 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.

> Why are those macros still defined?

See above.

> I also noticed that the cross-compiler still tries to locate units in
> /usr/lib/fpc/3.3.1/units/atari/rtl That does not cause problems (because
> the directory does not exists), but doesn't look quite right.

It seems this global path is hardwired on Unix systems, as the default
unit path. You can overwrite this with the FPCDIR environment variable.
See the relevant code here:


I'm not claiming I like this solution, but I guess the issue is mostly


More information about the fpc-devel mailing list