niXman / mingw-builds

Scripts for building the 32 and 64-bit MinGW-W64 compilers for Windows
Other
290 stars 107 forks source link

Building a toolchain for Windows 2000? #657

Closed jdpatdiscord closed 11 months ago

jdpatdiscord commented 1 year ago

Hi, thank you for this project, it makes things a lot easier on Windows. However, I ran into an issue which it looks like you may have experience with based on my searching around.

Building GCC 12.3.0 works for Windows Server 2003 / XP, and I can use C++20/23 library features just fine. But, I am on a journey to NT 4.0 on modern compilers.

As a stepping stone I am trying to compile for Windows 2000 SP4. On SourceForge it says "mingw-w64 supports Windows OSes starting from Windows 2000 onwards."

I have tried --with-default-win32-winnt=0x0500 with these scripts. No luck. I tried MinGW v11 and latest v5.*. Something that might be noteworthy is that the major / minor versions marked on the PE's are 0x0400, like it got ignored.

The synopsis is all of these executables require exports _strtoi64 and maybe other some exports from msvcrt.dll. However, since my system is updated with various service packs and runtimes, there are various msvcr* which DO have the exports but aren't being linked to. Additionally, replacing msvcrt.dll with a renamed one of these runtimes complains about an export that stopped being exported in a newer version. This is very confusing.

Sorry about making a support issue!!! Thank you for any help.

starg2 commented 1 year ago

Is this issue on SourceForge relevant?

IIRC, mingw-w64 no longer supports Windows XP, let alone Windows 2000.

Something that might be noteworthy is that the major / minor versions marked on the PE's are 0x0400, like it got ignored.

--with-default-win32-winnt= option only affects the _WIN32_WINNT macro. It doesn't change the OS/subsystem version numbers embedded in the PE headers.

niXman commented 1 year ago

@jdpatdiscord please close the issue if you have no additional questions.

jdpatdiscord commented 1 year ago

I do have further questions, because as I listed in the issue, I had tried MinGW versions back to v5 and it still has the same dependency. The issue on SourceForge is relevant but the commit is very new.

starg2 commented 1 year ago

Have you tried --bootstrapall?