Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows XP Support ? #11

Closed
a-p-jo opened this issue Sep 15, 2021 · 19 comments
Closed

Windows XP Support ? #11

a-p-jo opened this issue Sep 15, 2021 · 19 comments

Comments

@a-p-jo
Copy link

a-p-jo commented Sep 15, 2021

Windows XP is the earliest target that most devs care that their executable build for. It's still very widely used and simply abandoning anything older than Vista/7 is not a great option.

It's also an incredibly easy to run in a VM for a *nix user to test/compile for Windows platforms. Not to mention nearly anything that runs on XP will run on the latest Windows just fine. So it would be incredibly useful if w64devkit binaries ran on XP.

So, would it be possible to release XP-compatible binaries ? Or are there major impediments in achieving this ...

Running on a XP Pro SP3 Version 2002 VM gives :

image

@skeeto
Copy link
Owner

skeeto commented Sep 15, 2021 via email

@skeeto
Copy link
Owner

skeeto commented Sep 15, 2021

Curiosity got the best of me, and indeed the latest w64devkit works just fine (aside from the expected console limitations) on Windows XP x64 Edition.
w64devkit-xp-x64

@skeeto
Copy link
Owner

skeeto commented Sep 17, 2021

Impressed with how well it was working, I spent some time actually programming on Windows XP with w64devkit over the past couple of days. The main downside was missing quality-of-life features that I now take for granted, like the text box on the start menu.

However, the most striking difference was how much faster and snappier Windows XP feels compared to Windows 10. The difference is night and day. I knew the performance situation had gotten bad over the years, but seeing and using them side by side really put it in perspective. The console and Vim come up so quickly on XP that it almost feels like something's wrong, but that's just how much I'm accustomed to bad performance in modern software. I've captured a comparison recording below. These are both virtual machines with the same configuration running on the same machine recorded one after another.

windows-10-vs-xp.mp4

Walking through this frame-by-frame:

  • Windows 10: It takes 17 frames for the console window to appear after clicking the shortcut. At this point it can probably start accepting input. However, it takes another 14 frames to finish animating, during which you can't really see what you're doing. At 60 FPS, that's about half a second for a console window to come fully up. Starting gvim similarly takes 13 frames, plus another 14 animation frames. I can really feel each of those half seconds when I'm working.

  • Windows XP: The console window appears exactly 1 frame after clicking the shortcut, no animation. It's at least 30x faster than Windows 10, probably more. Same story for starting gvim. The second time I start it, it comes up so fast that the console doesn't even have time to render another prompt. This feels so nice.

Now shown: Bringing up the explorer window with W-e is similarly sooo much better on Windows XP, essentially instant. While on Windows 10 it takes nearly a second to come up.

@a-p-jo
Copy link
Author

a-p-jo commented Sep 17, 2021

It's always nice to get an involved response to an issue , thanks :)

The major hurdle is that the community has already moved on. This project
is very much a built-on-the-shoulders-of-giants thing, and I depend on the
broader open source community to solve issues, leaving only a handful to
fix myself. Autoconf configure scripts operate on a combination of luck
and duct tape. They tend to fail as soon as they face anything off the
community's beaten path, and an i686 Windows cross compiler is no longer
on that path

Do note that Code::Blocks still supports 32-bit XP binaries as well as produces them from I can understand.

But I understand. TBH, Being able to compile to 32-bit XP compatible binaries from 64-bit w64devkit would still be quite aweomse, because I want to say goodbye to the bloated, fragile systems of both Cygwin and Visual Studio.

AFAIK, using :

#define _WIN32_WINNT _WIN32_WINNT_WINXP

works cleanly with w64devkit's gcc on my Windows 7 machine , but from what you've said above I suspect the binaries are 64-bit.

Despite the effort I've put into this project, I actually hate Windows

I understand and agree. Unfortunately, that 80% market share isn't going to go away overnight and while I don't distribute binaries (at all) I'd like it if I could test and make sure my programs compiled and ran on Windows should someone want that. Personally, I just use *nix because all I need to do is program C and Python in neovim (any plans to offer neovim ;) ?)

Curiosity got the best of me, and indeed the latest w64devkit works just fine (aside from the expected console limitations) on Windows XP x64 Edition.

This is perfect. I'll switch to 64-bit XP for my VM.

the most striking difference was how much faster and snappier Windows XP feels compared to Windows 10. The difference is night and day.

Indeed, XP was the last trivially embeddable, virtualizable, reliable OS that M$ produced. Windows Vista/7 are also exponentially more resource greedy. The only sensible option for a cheap Windows VM is XP. This is why I'm glad that w64devkit will run on it, at least the 64-bit version.

You realise how cool this is ?

Visual Studio 2010 is the last msvc compiler I can get there, and that doesn't properly support ISO C89 .
Code::Block's latest has gcc 8.1, and is way larger than what I need , and has no CLI interface that I could get to work. Cygwin is clunky.

w64devkit is brilliantly simple and just what I need. Thanks again for it, as well as you awesome blog, nullprogram.

@a-p-jo
Copy link
Author

a-p-jo commented Sep 17, 2021

If I might also ask, where did you get an installation copy for XP ? Those are not so easily available, especially the 64-bit one

@skeeto
Copy link
Owner

skeeto commented Sep 17, 2021 via email

@a-p-jo
Copy link
Author

a-p-jo commented Sep 17, 2021

It's always refreshing to see fellow developers who care about binary sizes being reasonable these days.

However, especially after my experience here, I am not opposed to figuring
a pure 32-bit w64devkit build: all 32-bit tools, producing only 32-bit
binaries

Interesting, and very nice if it could be achieved. Here's hoping those autoconf srcipts can be arm-twisted to work. On the other hand, your Dockerfile seems to be cross-compiling the toolchain on Debian. How about natively building it on Windows , would that help the fragile build configuration scripts behave better ? Perhaps with a cygwin installation to compiler it to bootstrap then use the old devkit to compile the new releases (something tells me the cygwin people ought to be able to compile their binaries on their setup with all that bloat they have).

While you do not use Windows regularly and detest it in general, the above could be tried in a VM, depending on your hardware.

Then again , I don't know much about build systems or building large (GNU-sized ;) ) projects and am only guessing.

w64devkit linked against a newer msvcrt.dll, and so it wouldn't run on XP
due to a missing symbol. I didn't try, but I believe this would have fixed
it.

At the very least it should cause the build to fail if the source requires dependencies that are not possible to furnish on Windows XP.

And another Windows-XP-support question if you don't mind - How did you install anything onto the VM ? XP comes with an outdatedIE that can't load basic modern websites anymore.

@skeeto
Copy link
Owner

skeeto commented Sep 17, 2021 via email

@skeeto
Copy link
Owner

skeeto commented Sep 17, 2021 via email

@raysan5
Copy link

raysan5 commented Sep 17, 2021

@skeeto Wow! That's very nice! So, #6 could be addresses with this improvement?

@skeeto
Copy link
Owner

skeeto commented Sep 18, 2021 via email

@a-p-jo
Copy link
Author

a-p-jo commented Sep 18, 2021

now it works on i686 Windows XP ... I've also built an official 32-bit 1.9.0 release with Windows XP support

Incredible ! Thanks a lot !

Tell me how that works for you.

Sure will :)

EDITS :

  • The ability to run 32-bit gfortran would also be much appreciated , from what I can see the i686 version has doesn't have it right now ...
  • Indeed a bunch of my C programs do compile and run just fine :)

@raysan5
Copy link

raysan5 commented Sep 19, 2021

@skeeto Wow! This is really amazing! Thank you very much for working on it! I'll be using your release for the next raylib Windows Installer package! Thanks! :D

@a-p-jo
Copy link
Author

a-p-jo commented Sep 21, 2021

@skeeto Would it be possible to include gfortran in the i686 build ?

@raysan5
Copy link

raysan5 commented Sep 21, 2021

@a-p-jo Personally, I prefer a minimal package with only the minimal required tools.

@skeeto
Copy link
Owner

skeeto commented Sep 21, 2021 via email

@a-p-jo
Copy link
Author

a-p-jo commented Sep 22, 2021

I prefer a minimal package with only the minimal required tools

Understandable, @raysan5 . Skeeto's idea of separate builds comes handy here.

I've found that gfortran-compiled programs have
absolutely abysmal performance

That's strange.

The C/C++ programs are reasonably fast though, yes ? Don't gcc/g++/gfortran have the same backend...

P.S: Now that there is a 32-bit build, I suppose you can close this issue anytime you wish to.

@a-p-jo a-p-jo closed this as completed Sep 23, 2021
@skeeto
Copy link
Owner

skeeto commented Sep 23, 2021 via email

@a-p-jo
Copy link
Author

a-p-jo commented Sep 23, 2021

my current plan is to target "pentium4" for i686 builds

Considering the first Windows XP came out near the terminal end of 2001, and the Pentium 4 series shipped at the end of 2000, and they were both dropped in mid 2008, that seems like a sensible decision, great work !

This seems to explain the floating point performance difference with and without SSE2 in the C code.

Considering the mandelbrot code in Fortran uses a lot of real and complex types, maybe there is some language strictness or lack of developer interest so maybe gfortran does not allow some performance trickery that gcc is able to employ, making the hardware level performance difference glaringly visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants