skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.66k stars 185 forks source link

Offering a windows 98 variant #142

Closed Peter0x44 closed 6 days ago

Peter0x44 commented 1 week ago

https://github.com/fsb4000/gcc-for-Windows98 I noticed this, which showcased compiling gcc to run under windows 98!

Perhaps it's worth investigating providing a variant ourselves. Or perhaps a separate build script for a cross-compiler to windows 98, some people may need that.

Obviously a lot of the extra tools will need to be stripped out, but providing vim + gcc would be a good start.

Peter0x44 commented 1 week ago

Of course there's also the possibility that the patches required could be too invasive or maybe not worth the effort. But I still think it would be cool. Already we are some of the last people investigating windows XP, windows 98 surely won't be any easier...

I also read @skeeto's blog post about windows 98 software development before. https://nullprogram.com/blog/2018/04/13/ Which is why I figured maybe the idea is worth bringing up.

Feel free to close if uninterested.

skeeto commented 6 days ago

Interesting find! Though that's an awful lot of changes, and now 3 years later we'd probably need even more. I expect Windows XP support to require such extensive fixes someday, and I'll drop support before it gets to this point. In my 2018 article I unfortunately did not mention which Mingw-w64 version, but it was probably 5.0.3. That i486-w64-mingw32-gcc cross compiler didn't require any special patching, though I only tested C, not C++, and not especially thoroughly.

As you've seen me mention before, 32-bit w64dk can target Windows 98 vintage hosts (-march=i486), like a cross compiler, if you're careful not to link a CRT, and possibly also libgcc. I've done it as a kind of challenge. Though even still, Windows 98 is missing so much functionality we take for granted in NT. Much of the wide API (e.g. WriteConsoleW) is unimplemented (or at least very buggy). The symbols are usually there for compatibility, so programs will load, but the calls will fail. For instance, w64devkit's pkg-config, which otherwise fits the no-runtime constraint, isn't 100% functional on Windows 98 because it cannot print error messages (no WriteConsoleA/WriteFile fallback).

For me, needing to work around pre-NT jankiness — and there's a lot of it — kind of sucks the joy out of targeting these old systems. Honestly, NT 3 or 4 — though older and, designed for workstations, more niche — is a more interesting target because it's such a better foundation. (Visual C++ 4–6 on NT was by far the most advanced, capable development platform of its day, and on some dimensions better than the tools we're using today.)

So thanks for the info, but I'm uninterested in dealing with the maintenance overhead. Though if you were to get it working in a fork, that would be interesting to see...

Peter0x44 commented 6 days ago

Thanks for taking the time to reply anyway, those points were interesting. It does seem it is far more work than XP. I'll put this in my growing TODO list to at least formalize some patches for this.