| 
100
 | 
     1 ---
 | 
| 
 | 
     2 layout: post
 | 
| 
 | 
     3 author: Paper
 | 
| 
 | 
     4 title: 'GitHub Actions and ancient toolchains'
 | 
| 
 | 
     5 nowplaying: 'Panchiko - Sodium Chloride'
 | 
| 
 | 
     6 ---
 | 
| 
 | 
     7 <span>
 | 
| 
 | 
     8 	CI is wonderful. I use it basically everywhere, and it's nice to get almost immediate
 | 
| 
 | 
     9 	feedback for whether a commit I made was bogus or not.
 | 
| 
 | 
    10 </span>
 | 
| 
 | 
    11 <br><br>
 | 
| 
 | 
    12 <span>
 | 
| 
 | 
    13 	That being said, it's fun to be able to make builds for weird esoteric platforms no
 | 
| 
 | 
    14 	one except me (and maybe
 | 
| 
 | 
    15 	<a class="prettylink" href="https://repellantmold.neocities.org/">Jade</a>)
 | 
| 
 | 
    16 	care about.
 | 
| 
 | 
    17 </span>
 | 
| 
 | 
    18 <br><br>
 | 
| 
 | 
    19 <h3><strong><u>Building for ancient Windows</u></strong></h3>
 | 
| 
 | 
    20 <span>
 | 
| 
 | 
    21 	MinGW-w64 (the new, modern toolchain for Windows) does not support anything below XP
 | 
| 
 | 
    22 	or systems without SSE2, which means we have to use an older toolchain. Fortunately,
 | 
| 
 | 
    23 	the original MinGW is still very much available, so we can just use its toolchain.
 | 
| 
 | 
    24 </span>
 | 
| 
 | 
    25 <br><br>
 | 
| 
 | 
    26 <span>
 | 
| 
 | 
    27 	This poses a problem though, how are we supposed to compile for subsystems that are
 | 
| 
 | 
    28 	unavailable in the older toolchain? Well, by making a "franken-toolchain" of course! :)
 | 
| 
 | 
    29 </span>
 | 
| 
 | 
    30 <br><br>
 | 
| 
 | 
    31 <span>
 | 
| 
 | 
    32 	What I did was add a configure flag to allow custom CFLAGS during the compilation
 | 
| 
 | 
    33 	of files that need these new headers, and added the new MinGW-w64 headers during that
 | 
| 
 | 
    34 	step. Et voila, it works, and now Schism can be run on as low as Windows 95 or NT 4!
 | 
| 
 | 
    35 </span>
 | 
| 
 | 
    36 <br><br>
 | 
| 
 | 
    37 <h3><strong><u>Building for ancient Mac OS X</u></strong></h3>
 | 
| 
 | 
    38 <span>
 | 
| 
 | 
    39 	Now this is tricky, in particular because I want to support PowerPC, and these systems
 | 
| 
 | 
    40 	never had a compiler version released that could target old versions on PowerPC.
 | 
| 
 | 
    41 </span>
 | 
| 
 | 
    42 <br><br>
 | 
| 
 | 
    43 <span>
 | 
| 
 | 
    44 	I started by simply targeting Leopard, since it was the easiest. I just bundled together
 | 
| 
 | 
    45 	the compilers from mesopotamian-era Xcode, and built Schism with
 | 
| 
 | 
    46 	<a class="prettylink" href="https://gist.github.com/miniupnp/a8f474c504eaa3ad9135">
 | 
| 
 | 
    47 	a custom version of SDL 2 patched for Leopard</a>. It worked, and I was satisfied, until
 | 
| 
 | 
    48 	I had an actual user that wanted to run Schism on Tiger.
 | 
| 
 | 
    49 </span>
 | 
| 
 | 
    50 <br><br>
 | 
| 
 | 
    51 <span>
 | 
| 
 | 
    52 	Since the only machine I had on hand was running Panther, I decided to target it instead
 | 
| 
 | 
    53 	of Tiger. Because the compiler version was simply too new, I had to specifically link
 | 
| 
 | 
    54 	against the Leopard libgcc_s instead of the Panther one, and put the newer one in the
 | 
| 
 | 
    55 	application bundle. And <a class="prettylink" href="/media/cheese/macosx-panther-schism.jpg">
 | 
| 
 | 
    56 	it worked</a>.
 | 
| 
 | 
    57 </span> |