64 Bit is the future
A long time ago I played around with x64 AROS already. Of course I would like to freepascal on it as well. Even on the first implementations of freepascal fr AROS i386 I already enabled and included basics for x64 AROS but I never got it to work, because my freepascal branch didn’t compile for x64 because it was at some broken state. Now at the trunk of course it will work again. In April 2015 I tried again and reached very fast the point to write the assembler startupcode. The same problem as before (with i386) no idea how it should look like. I looked a little bit around (also into the other startupcodes of other x64 fpc platforms, linux mostly) and took a shot. Sadly it didn’t work it always told me „bad load hunk“. So from time to time I looked into when I have only little time (not enough time to do anything useful at LCL) but I didn’t get any idea. Yesterday evening (already in bed just before sleep) I got an idea, and today evening I tried it very shortly and it gives not an error message but crash. YEAH! Never so happy about a crash. But why it crashs? ABIv1 problems? The Stacktrace tells me it crashes inside dos.library/Error with an _aros_not_implemented_ error :-O. This call gets the Error Output filehandle, seems still does not exists on x64 AROS. Easy solution comment out and use the Output stream as Error stream like Amiga and MorphOS do.
And finally it is working đ
Of course its only a very bad hacked version currently and no ABIv1 things are done, so the compiler self does not really work (crashes on linker calling). But it shows that it will be possible to make an fpc for x64 AROS. Of course I have to talk to Charlie to check how to make a syscall for x64 (is even easier than i386) and how to make such ABI difference. but it is not really in hurry.
Yes, you are correct regarding ErrorOutput. It is simply not included in dos.library anymore (even though in ABIv0 it is marked as being compatible with AmigaOS4).
Instead, ABIv1 uses another approach using alib, see here -> http://repo.or.cz/w/AROS.git/blob/HEAD:/compiler/alib/erroroutput.c
Unfortunately there are more function offset incompatibilities between abiv0 and abiv1. Can cause serious headaches đ
Congratulations on this spectacular achievement, if even little steps at a time. Thank you very much for looking into that.
regards,
M.
PS: i’m away for the weekend (but I couldn’t let this pass). Again, congratz!