Skip to content

Commit cd556c0

Browse files
committed
Fix for windows cross compilation
1 parent 9788b83 commit cd556c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/ghc/default.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ let
333333
# `-fexternal-dynamic-refs` causes `undefined reference` errors when building GHC cross compiler for windows
334334
+ lib.optionalString (enableRelocatedStaticLibs && targetPlatform.isx86_64 && !targetPlatform.isWindows)
335335
" '*.*.ghc.*.opts += -fexternal-dynamic-refs'"
336+
# With the latest nixpkgs mixing `struct utimbuf` and `struct _utimbuf` causes an error without this
337+
+ lib.optionalString (targetPlatform.isWindows) (
338+
if builtins.compareVersions ghc-version "9.10" >= 0
339+
then " '*.ghc-internal.ghc.*.opts += -optc-Wno-incompatible-pointer-types'"
340+
else " '*.base.ghc.*.opts += -optc-Wno-incompatible-pointer-types'")
336341
# The fact that we need to set this here is pretty idiotic. GHC should figure this out on it's own.
337342
# Either have a runtime flag/setting to disable it or if dlopen fails, remember that it failed and
338343
# fall back to non-dynamic. We only have dynamic linker with musl if host and target arch match.

0 commit comments

Comments
 (0)