Skip to content

Commit ac25fe4

Browse files
committed
libpsl: patch to reference the Windows-native stat [ci skip]
Upstream should fix this issue. I consider this a libpsl portability issue that came to the surface when mingw-w64 13 reshuffled its POSIX stat functions, by redirecting them to intrinsics which are missing from earlier mingw-w64 versions. Thus making binaries build with mingw-w64 v13 incompatible with v12. Libraries may be better off calling the native Windows stat functions listed here: https://learn.microsoft.com/cpp/c-runtime-library/reference/stat-functions LibreSSL also references the POSIX stat on Windows from its `RAND_write_file()` API, causing the same issue, but curl doesn't call this function, and thus isn't causing an actual issue in this use-case. Reported-by: Morten / Mac-Fly Reported-by: JackCarterSmith Bug: https://curl.se/mail/lib-2025-10/0007.html Fixes curl/curl#19516 Follow-up to add9e25
1 parent 27fe69e commit ac25fe4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libpsl.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ _VER="$1"
4848
echo "! Error: Our local PSL database filename is leaking into the libpsl code."
4949
exit 1
5050
fi
51+
# Fix to use the Windows-native stat function to avoid mingw-w64 v13
52+
# mapping the POSIX 'stat' one used in libpsl to an intrinsic and breaking
53+
# interoperability with earlier mingw-w64 versions.
54+
# This shall really be fixed upstream in libpsl.
55+
[ "${_OS}" = 'win' ] && echo '#define stat _stati64' >> "${gencsrc}"
5156
fi
5257

5358
mkdir -p "${_BLDDIR}"

0 commit comments

Comments
 (0)