[fpc-devel] Questions regarding m68k-atari target

Marcus Sackrow alb42 at web.de
Tue Jan 25 09:34:19 CET 2022


Am 24.01.2022 um 11:03 schrieb Thorsten Otto via fpc-devel:
>  (I'm new to this list so please forgive me if i'm asking questions
> that have already been answered elsewhere, and just point me to the
> right direction)
very unlikely, since we implemented that atari interface there was
little feedback about it ;)

> Inspired by some thread on the atari-forum
> (https://www.atari-forum.com/viewtopic.php?f=16&t=41476&sid=cd858e109f7cd4f1cae6c597ea35b66f
> <https://www.atari-forum.com/viewtopic.php?f=16&t=41476&sid=cd858e109f7cd4f1cae6c597ea35b66f>
> )
> i recently tried to cross-compile freepascal for atari (using linux as
> host), and encountered a few problems. First off, a guy pointed me to
> the nightly build page (which i could not find btw. on the freepascal
> home page). That one also includes atari binaries which don't seem to
> be available elsewhere, but they are somewhat broken. All of the
> executables (not only the compiler) have $0c set in the program flags.
> The $08 bit of that value is interpreted by MiNT to allocate only a
> minimum TPA (which is the memory needed by the text+data+bss
> sections), but the startup code of fpc tries to increase that in order
> to allocate the stack. That causes all of the binaries to immediately
> fail with an out-of-memory error.
We both (Charlie and me) are Amiga users, so not so used to the Atari
stuff, so very likely something is wrong.

yes the Atari version is compiled by Jenkins every commit
https://build.alb42.de:8081/job/FPC_m68k-atari/ (to make sure the
changes does not break the target) it uses the command line:

make zipinstall OS_TARGET=atari CPU_TARGET=m68k 'CROSSOPT=-Cp68000 -Avasm -XV'

Since the Atari interface was implemented there was a little bit
reaction to it, but not very much, so I don't think the the compiler was
ever tested or used on actual Atari (I just compile them to make sure
they don't break)

The main work on this was done by Charlie (I'm really more an
Amiga-user, he is more like a retro computer guy), I'm not sure he reads
here, so I will trigger him later to check it out, I'm sure he is happy
if someone wants to help and improve it.

btw. you know this:



> The next problem is the way the assembler and linker are invoked. I
> realize that in the daily builds, vasm/vlink are used, but i would
> really prefer to use gas/ld instead (which are also the defaults if
> you don't use -Avasm). When generating the cross-compiler, they are
> invoked as m68k-atari-as and m68k-atari-ld, however the standard
> binutils for atari are actually named different (m68k-atari-mint-as
> and m68k-atari-mint-ld). As a workaround, i now created symlinks for
> these, but this should actually be fixed.
> Also, the commandline for the linker is wrong in that case, it is
> invoked as
the prefix $CPU-$OS is just the default prefix for every cross
compiling, if you need an other, you can supply it with e.g.

> m68k-atari-ld -d -n -o <exe> <scriptfile>
> where scriptfile is a generated linker script. That is missing the -T
> switch, which causes ld to accept <scriptfile> as object-file to link
> (and causing it to core-dump).
I guess, because we use vasm and vlink the gnu as/ld is not properly
implemented atm. At least for Amiga vasm and vlink work much better than
gas/ld, not sure about the situation on Atari.

> Another thing: that linker expects the first object to start at text
> address 0xe4, not 0. That is normally achieved by some statements in
> the script, but those are missing.
> A thing that is definitely missing is support for the ARGV argument
> passing. Without this, commandlines are limited to 126 chars, and
> tools like fpc.ttp are not able to locate their own directory (needed
> for example to find the fpc.cfg file). If you want, i can try to
> implement that.
I think you can just do that and make a pull request on Gitlab.


Marcus "ALB42"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220125/2237436f/attachment.htm>

More information about the fpc-devel mailing list