view _posts/2024-12-27-github-actions-and-ancient-toolchains.html @ 102:06b5c11f33df

blog: forgot prettylink here !
author Paper <paper@tflc.us>
date Fri, 27 Dec 2024 20:29:44 -0500
parents d9223d9ab9ba
children
line wrap: on
line source

---
layout: post
author: Paper
title: 'GitHub Actions and ancient toolchains'
nowplaying: 'Panchiko - Sodium Chloride'
---
<span>
	CI is wonderful. I use it basically everywhere, and it's nice to get almost immediate
	feedback for whether a commit I made was bogus or not.
</span>
<br><br>
<span>
	That being said, it's fun to be able to make builds for weird esoteric platforms no
	one except me (and maybe
	<a class="prettylink" href="https://repellantmold.neocities.org/">Jade</a>)
	care about.
</span>
<br><br>
<h3><strong><u>Building for ancient Windows</u></strong></h3>
<span>
	MinGW-w64 (the new, modern toolchain for Windows) does not support anything below XP
	or systems without SSE2, which means we have to use an older toolchain. Fortunately,
	the original MinGW is still very much available, so we can just use its toolchain.
</span>
<br><br>
<span>
	This poses a problem though, how are we supposed to compile for subsystems that are
	unavailable in the older toolchain? Well, by making a "franken-toolchain" of course! :)
</span>
<br><br>
<span>
	What I did was add a configure flag to allow custom CFLAGS during the compilation
	of files that need these new headers, and added the new MinGW-w64 headers during that
	step. Et voila, it works, and now Schism can be run on as low as Windows 95 or NT 4!
</span>
<br><br>
<h3><strong><u>Building for ancient Mac OS X</u></strong></h3>
<span>
	Now this is tricky, in particular because I want to support PowerPC, and these systems
	never had a compiler version released that could target old versions on PowerPC.
</span>
<br><br>
<span>
	I started by simply targeting Leopard, since it was the easiest. I just bundled together
	the compilers from mesopotamian-era Xcode, and built Schism with
	<a class="prettylink" href="https://gist.github.com/miniupnp/a8f474c504eaa3ad9135">
	a custom version of SDL 2 patched for Leopard</a>. It worked, and I was satisfied, until
	I had an actual user that wanted to run Schism on Tiger.
</span>
<br><br>
<span>
	Since the only machine I had on hand was running Panther, I decided to target it instead
	of Tiger. Because the compiler version was simply too new, I had to specifically link
	against the Leopard libgcc_s instead of the Panther one, and put the newer one in the
	application bundle. And <a class="prettylink" href="/media/cheese/macosx-panther-schism.jpg">
	it worked</a>.
</span>
<br><br>
<h3><strong><u>Why?</u></strong></h3>
<span>
	Because doing pointless things are fun, and
	<a class="prettylink" href="https://youtu.be/o3Zx_q8OVcc">fun things are fun.</a>
</span>