<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">(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)</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Inspired by some thread on the atari-forum (<a href="https://www.atari-forum.com/viewtopic.php?f=16&t=41476&sid=cd858e109f7cd4f1cae6c597ea35b66f"><span style=" text-decoration: underline; color:#0057ae;">https://www.atari-forum.com/viewtopic.php?f=16&t=41476&sid=cd858e109f7cd4f1cae6c597ea35b66f</span></a> )</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Also, the commandline for the linker is wrong in that case, it is invoked as</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">m68k-atari-ld -d -n -o <exe> <scriptfile></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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).</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">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.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p></body></html>