Cross platform Mega Drive / 32X toolchain
C23 #embed didn't make it into GCC 13.1.0 and unfortunately neither did Rust, but the constexpr and explicitly typed enums did so go play with those.
This version is a bit of an overhaul that changes some directories around, something I hopefully won't have to do again for a long time because it breaks things. However, now that the SGDK integration is a thin wrapper, there is less worry about weird unexplainable bugs, and even when those come up, you don't have to rearrange all your project paths just to verify whether it's an issue with SGDK itself or not.
GENERAL:
/opt/toolchains/mars
instead of ~/mars
install
step is separate and should be run with a privileged user after compiling as a normal userTOOLCHAIN:
SGDK:
OTHER TARGETS:
flamewing-tools
target, please build from upstream if you want to use these toolsz80-tools
, sjasm is now installed along with SGDKx68k-tools
target, builds libdos-gcc (Human68k and Newlib integration) and png2xsp
Extract to /opt/toolchains
so the contents are in /opt/toolchains/mars
. There should be only one "mars" directory.
Included targets:
make m68k-toolchain-newlib sh-toolchain-newlib sgdk sik-tools x68k-tools
Another release only a week after the last one, because of a critical bug with the libmd built in 2022.09. Bank switching support for SGDK will be split out into libmd-far(-debug).a
from now on.
Extract to your home directory so the contents are in ~/mars. There should be just one "mars" folder.
Software versions: GCC 12.2.0 Newlib 4.2.0 SGDK 1.80
Included targets:
make m68k-toolchain-newlib LANGS=c,c++ sh-toolchain-newlib LANGS=c,c++ z80-tools sgdk sik-tools flamewing-tools m68k-gdb sh-gdb
(My Macbook crashed during the second pass of sh-toolchain-newlib and I don't want the thing to burn to a crisp so the macos build only has basic C support for SH-2)
Note about the compressor tools in flamewing-tools
: I could not figure out how to convince cmake to statically link these, so manual intervention is required if you intend to use these tools. sudo mv ~/mars/lib/*.so /usr/lib/
aught to be enough, or if you don't have root access, export LD_LIBRARY_PATH=${HOME}/mars/lib
IMPORTANT NOTE ABOUT GCC 10.X: Since GCC 10, -fno-common is set by default, which results in SGDK (and many of my own projects) throwing "multiple definition" errors during the linking stage. To work around this, you can either add -fcommon to the CFLAGS in your Makefile, or fix your headers so that global variables are defined as extern. See: GCC Documentation for the flag
Extract to your home directory so the contents are in ~/mars
. There should be just one "mars" folder.
Software versions: GCC 12.2.0 Newlib 4.2.0 SGDK 1.80
Included targets:
m68k-toolchain-newlib LANGS=c,c++
sh-toolchain-newlib LANGS=c,c++
z80-tools
(Sjasm only, z80asm is no longer needed)
sgdk
(w/ bank switching)
sik-tools
I didn't include flamewing-tools
because my computer is not from the future.
IMPORTANT NOTE ABOUT GCC 10.X:
Since GCC 10, -fno-common
is set by default, which results in SGDK (and many of my own projects) throwing "multiple definition" errors during the linking stage. To work around this, you can either add -fcommon
to the CFLAGS in your Makefile, or fix your headers so that global variables are defined as extern
. See: GCC Documentation for the flag
Extract to your home directory so the contents are in ~/mars. There should be just one "mars" folder.
GCC 10.3.0 SGDK 1.70 M68K + SH-2 compilers with Newlib
IMPORTANT NOTE ABOUT GCC 10.X: GCC 10 sets -fno-common by default, which results in SGDK (and many of my own projects) to throw "multiple definition" errors during the linking stage. To work around this please add -fcommon to the CFLAGS in your Makefile.
Extract to your home directory so the contents are in ~/mars
. There should be just one "mars" folder.
GCC 10.3.0 SGDK 1.62 M68K + SH-2 compilers with Newlib
IMPORTANT NOTE ABOUT GCC 10.X:
GCC 10 sets -fno-common
by default, which results in SGDK (and many of my own projects) to throw "multiple definition" errors during the linking stage. To work around this please add -fcommon
to the CFLAGS in your Makefile.
Extract to your home directory so the contents are in ~/mars
. There should be just one "mars" folder.
New stuff:
Included targets make m68k-toolchain-newlib LANGS=c,c++ z80-tools sgdk sik-tools flamewing-tools
(flamewing-tools
not included in MacOS due to compile errors possibly related to LLVM)
Mega Drive only while 32X support remains experimental.
Extract to your home directory (so you have ~/mars).
Just the toolchain & SGDK included, all x86_64.
Extract this to your home directory (use "extract here", not "extract to mars-blabla") so that all the stuff is in ~/mars. Then you should be able to "make" any of my projects that use it.
For now, this is x86_64 only.