Changeset d44e001 in buchla-68k
side by side
lines around each change
Show the changes in full context
White space changes
07/29/2017 11:05:41 PM (
Thomas Lopatic <thomas@…>
repository. Just in case you are interested in them, but would prefer
not to go through the emulator exercise.
There are a few differences between the Alcyon compiler and a
modern-day GCC cross-compiler for the Motorola 68k.
* Alcyon uses 16-bit integers, whereas GCC defaults to 32-bit
integers. That's why we pass the -mshort option to GCC.
* The Alcyon compiler's ABI assumes that registers A2 and D2 are
saved by the caller of a function, if needed. GCC, however,
assumes that it's the called function that is responsible for
preserving A2 and D2.
Right now, we work around this issue by passing the -ffixed-d2 and
-ffixed-a2 options to GCC. This prevents GCC from using these two
registers at all when generating code.
Ultimately, we should fix the hand-written assembly language
functions to preserve A2 and D2, so that GCC code generation can
use all registers.
* The hand-written assembly language code expects C function names
to be prefixed with an underscore. That's why we pass the
-fleading-underscore option to GCC. However, this breaks linking
with libgcc, which doesn't use leading underscores.
Currently, we work around this issue by stripping the leading
underscore from references to libgcc functions using objcopy. See
misc/rewrite.txt for the function name mapping.
Ultimately, we should fix any references to C functions in the
hand-written assembly language code.
for help on using the changeset viewer.
Download in other formats: