[fpc-devel] M68k: important milestone reached

Sven Barth pascaldragon at googlemail.com
Sat Feb 22 16:48:53 CET 2014


Hello together!

With revision 26849 which I just committed a few minutes ago an imporant 
milestone was reached for reviving the M68k port: the cross compiled 
compiler is now not only able to compile a program, but this program is 
also able to run correctly!

See here:

=== shell begin ===

$ cat ./fpctests/helloworld.pas
program helloworld;

begin
   Writeln('Hello World');
end.
$ ../run-qemu-m68k ./compiler/ppc68k -iSPSO
m68k linux
$ ../run-qemu-m68k compiler/ppc68k -n -Furtl/units/m68k-linux -viwn 
-Cpisac -O- -FEtestoutput -XPm68k-elf- -sh ./fpctests/helloworld.pas
$ ./testoutput/ppas.sh
Assembling helloworld
Linking testoutput/helloworld
m68k-elf-ld: warning: testoutput/link.res contains output sections; did 
you forget -T?
$ ../run-qemu-m68k ./testoutput/helloworld
Hello World

=== shell end ===

Notes:
- run-qemu-m68k is a shell script that calls qemu-m68k which allows me 
to run m68k-linux binaries on my x86_64 linux system (works on any other 
Linux architecture supported by QEMU as well) [this is QEMU's user space 
emulation]
- I need to use -sh (thus generating the ppas.sh script), because QEMU 
does not seem to allow me to exec a non m68k program

That the compiler is now working shows already that the work Charlie and 
me have done on the code generator has finally paid of and that it's 
nearing production quality again. There are still around 210 test suite 
errors for the full suite, but quite some are related to the one main 
problem that still exists: linking to libraries. Once Charlie and/or me 
have managed to set up the necessary C libraries we can fix this problem 
to have the m68k port reach the state of the old times again. :D

After that the main work on m68k will switch to optimizations and 
maybe/likely revival of other m68k RTLs (Amiga, Atari, Mac OS, NetBSD) 
:D Of course an embedded target will be a nice to have as well ;)

Regards,
Sven



More information about the fpc-devel mailing list