diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2022-09-11 13:08:37 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-09-12 13:29:41 -0400 |
commit | 3a815f30bcba5672085e823aeef90863253b0b1a (patch) | |
tree | 24a05e2a5283a93d86e0e88014ff3980a457a30c /m4 | |
parent | a5f9c35f5831ef5108e87813a96eac62803852ab (diff) | |
download | haskell-3a815f30bcba5672085e823aeef90863253b0b1a.tar.gz |
Windows: Always define _UCRT when compiling C code
As seen in #22159, this is required to ensure correct behavior when MinGW-w64
headers are in the `C_INCLUDE_PATH`.
Fixes #22159.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/fp_setup_windows_toolchain.m4 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/m4/fp_setup_windows_toolchain.m4 b/m4/fp_setup_windows_toolchain.m4 index e1a2244c37..1f44a388fe 100644 --- a/m4/fp_setup_windows_toolchain.m4 +++ b/m4/fp_setup_windows_toolchain.m4 @@ -82,7 +82,11 @@ AC_DEFUN([FP_SETUP_WINDOWS_TOOLCHAIN],[ CC="${mingwbin}clang.exe" CXX="${mingwbin}clang++.exe" - cflags="--rtlib=compiler-rt" + + # Signal that we are linking against UCRT with the _UCRT macro. This is + # necessary to ensure correct behavior when MinGW-w64 headers are in the + # header include path (#22159). + cflags="--rtlib=compiler-rt -D_UCRT" CFLAGS="$cflags" CONF_CC_OPTS_STAGE1="$cflags" CONF_CC_OPTS_STAGE2="$cflags" |