Skip to content

Commit df1e5fe

Browse files
committed
Fixes for mingwW64
1 parent 50a38bb commit df1e5fe

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

ci.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,30 @@
8282
let lib = nixpkgs.lib;
8383
in lib.optionalAttrs (nixpkgsName == "unstable"
8484
&& (__match ".*llvm" compiler-nix-name == null)
85-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
86-
|| (system == "aarch64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
87-
|| (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"])
88-
|| (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"])
85+
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"])
86+
|| (system == "aarch64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"])
87+
|| (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"])
88+
|| (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc982" "ghc983" "ghc984"])
8989
)) {
9090
inherit (lib.systems.examples) ghcjs;
9191
} // lib.optionalAttrs (
9292
(__match ".*llvm" compiler-nix-name == null)
93-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc91220241014" "ghc91320241101"]) # Including GHC HEAD here because the patches for rts/RtsSymbols.c no longer apply and mingwW64 GHC build fails without them
93+
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928"]) # Including GHC HEAD here because the patches for rts/RtsSymbols.c no longer apply and mingwW64 GHC build fails without them
9494
|| (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
9595
inherit (lib.systems.examples) mingwW64;
9696
} // lib.optionalAttrs (nixpkgsName == "unstable"
9797
&& (__match ".*llvm" compiler-nix-name == null)
98-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc8107" "ghc902" "ghc928" "ghc948"])
98+
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc8107" "ghc902" "ghc928" "ghc948"])
9999
|| (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
100100
inherit (lib.systems.examples) ucrt64;
101-
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"]) {
101+
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) {
102102
# Musl cross only works on linux
103103
# aarch64 cross only works on linux
104104
inherit (lib.systems.examples) musl64 aarch64-multiplatform;
105105
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && builtins.elem compiler-nix-name ["ghc927" "ghc928"]) {
106106
# TODO fix this for the compilers we build with hadrian (ghc >=9.4)
107107
inherit (lib.systems.examples) aarch64-multiplatform-musl;
108-
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc884" "ghc8107" "ghc902"]) {
108+
} // lib.optionalAttrs (system == "aarch64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc8107" "ghc902"]) {
109109
inherit (lib.systems.examples) aarch64-multiplatform-musl;
110110
};
111111
isDisabled = d: d.meta.disabled or false;

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ in {
157157
++ onWindows (fromUntil "9.8.1" "9.8.2" ./patches/ghc/win-linker-no-null-deref-9.6.patch)
158158
++ onWindows (until "9.0" ./patches/ghc/ghc-8.10-windres-invocation.patch)
159159
++ onWindows (fromUntil "9.0" "9.4" ./patches/ghc/ghc-9.0-windres-invocation.patch)
160+
++ onWindows (from "9.12" ./patches/ghc/ghc-9.12-windows-rts-symbols.patch)
160161
++ fromUntil "9.4.5" "9.4.9" ./patches/ghc/ghc-9.4.5-include-order-fix.patch
161162
++ fromUntil "9.6.2" "9.8" ./patches/ghc/ghc-9.4.5-include-order-fix.patch
162163
++ fromUntil "9.6.1" "9.9.20231203" ./patches/ghc/MR10116.patch
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
2+
index a447f126bd..93af0f511f 100644
3+
--- a/rts/RtsSymbols.c
4+
+++ b/rts/RtsSymbols.c
5+
@@ -165,15 +165,21 @@ extern char **environ;
6+
SymI_HasProto(rts_ConsoleHandlerDone) \
7+
SymI_NeedsProto(__mingw_module_is_dll) \
8+
RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
9+
- SymI_HasProto(__stdio_common_vswprintf_s) \
10+
- SymI_HasProto(__stdio_common_vswprintf) \
11+
SymI_HasProto(_errno) \
12+
/* see Note [Symbols for MinGW's printf] */ \
13+
SymI_HasProto(_lock_file) \
14+
SymI_HasProto(_unlock_file) \
15+
/* See Note [_iob_func symbol] */ \
16+
SymI_HasProto_redirect( \
17+
- __imp___acrt_iob_func, __rts_iob_func, STRENGTH_WEAK, SYM_TYPE_INDIRECT_DATA)
18+
+ __imp___acrt_iob_func, __rts_iob_func, STRENGTH_WEAK, SYM_TYPE_INDIRECT_DATA) \
19+
+ SymI_HasProto(__mingw_vsnwprintf) \
20+
+ SymI_HasProto(__mingw_vfprintf) \
21+
+ SymI_HasProto(closure_sizeW_) \
22+
+ SymI_NeedsProto(_tzset) \
23+
+ /* ^^ This one needed for time, tzset deprecated */\
24+
+ SymI_NeedsProto(tzset) \
25+
+ SymI_HasProto(strtoll)
26+
+ /* ^^ These two are needed for unix-time */
27+
#else
28+
#define RTS_MINGW_ONLY_SYMBOLS /**/
29+
#endif

0 commit comments

Comments
 (0)