Skip to content

UCRT#382

Open
Peter0x44 wants to merge 5 commits into
skeeto:masterfrom
Peter0x44:ucrt
Open

UCRT#382
Peter0x44 wants to merge 5 commits into
skeeto:masterfrom
Peter0x44:ucrt

Conversation

@Peter0x44
Copy link
Copy Markdown
Collaborator

For those who would prefer a w64devkit with ucrt instead of msvcrt, I'm throwing up this branch.

@Peter0x44
Copy link
Copy Markdown
Collaborator Author

Huh. The build is failing in vim.

2026-05-11T01:00:53.6682653Z 697.9 /bootstrap/x86_64-w64-mingw32/bin/ld: xpm/x64/lib/libXpm.a(RdFToI.o):RdFToI.c:(.text+0xf2): undefined reference to `__imp___iob_func'
2026-05-11T01:00:53.6684224Z 697.9 /bootstrap/x86_64-w64-mingw32/bin/ld: xpm/x64/lib/libXpm.a(RdFToI.o):RdFToI.c:(.text+0x12f): undefined reference to `__imp___iob_func'

I will investigate later.

Peter0x44 added 3 commits May 17, 2026 17:57
UCRT doesn't work on windows XP anyway, unless you static link it. Only
MSVC is capable of this.
@Peter0x44
Copy link
Copy Markdown
Collaborator Author

Peter0x44 commented May 17, 2026

Vim 9.0 ships prebuilt Windows XPM libraries in its source tarball under src/xpm/, including:
src/xpm/x64/lib/libXpm.a
src/xpm/x86/lib/libXpm.a
matching include files under src/xpm/*/include
Vim’s src/Make_cyg_ming.mak auto-selects these for GUI builds unless XPM=no is passed. For x64 it sets XPM = xpm/x64, then links with:
-L$(XPM)/lib -lXpm
That bundled libXpm.a was built against MSVCRT, so in a UCRT toolchain it pulls unresolved MSVCRT-era symbols like __imp___iob_func.
The XPM=no fix disables only Win32 XPM icon/sign bitmap support in gVim. Vim itself, gVim, and the rest of the GUI build still build.

For some reason, vim has a binary lib committed somewhere. I don't know why...
Disabling XPM does fix this.

@Peter0x44
Copy link
Copy Markdown
Collaborator Author

I'm so confused how this is giving errors in CI, when it builds fine on my machine.

@Peter0x44
Copy link
Copy Markdown
Collaborator Author

Somehow only half the patch was applying or something. @skeeto any ideas?
It's fixed now, but I'm wondering if there's something to do on our end in master.

@skeeto
Copy link
Copy Markdown
Owner

skeeto commented May 18, 2026

Hmm, in CI the patch isn't piped into patch (e.g. if the program providing input crashed we might miss it), but passed via -i. If it didn't apply fully and cleanly, patch should fail, and so the build should fail, too. Does CI not check the result of patch and we missed a write error?

@skeeto
Copy link
Copy Markdown
Owner

skeeto commented May 18, 2026

Ah, so you regenerated the patch to fix it. Patching is done outside a container, using the system's patch, which means, e.g. busybox-w32 if building via w64devkit. Different patch programs handle edge cases differently, and so it can work fine one place but not another. You might have changed enough to produce different results with different patch programs.

@Peter0x44
Copy link
Copy Markdown
Collaborator Author

Yeah I was very confused. It was giving errors that 32 bit support wasn't compiled in gcc, when by all accounts it should be, and when I applied the patch with busybox-w32 on my machine it built totally fine.

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

Successfully merging this pull request may close these issues.

2 participants