Skip to content

Fix unix-time in TH code when cross compiling for windows #2237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions overlays/patches/ghc/ghc-8.10-win-add-tzset-to-rtssyms.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 348e5ccc21..339d169c89 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -149,7 +149,11 @@
@@ -149,7 +149,12 @@
RTS_WIN64_ONLY(SymI_HasProto_redirect( \
__imp___acrt_iob_func, __rts_iob_func, true)) \
RTS_WIN32_ONLY(SymI_HasProto_redirect( \
Expand All @@ -11,7 +11,8 @@ index 348e5ccc21..339d169c89 100644
+ SymI_NeedsProto(_tzset) \
+ /* ^^ This one needed for time, tzset deprecated */\
+ SymI_NeedsProto(tzset) \
+ /* ^^ This one needed for unix-time */
+ SymI_HasProto(strtoll) \
+ /* ^^ These two are needed for unix-time */

#define RTS_MINGW_COMPAT_SYMBOLS \
SymI_HasProto_deprecated(access) \
5 changes: 3 additions & 2 deletions overlays/patches/ghc/ghc-9.2-win-add-tzset-to-rtssyms.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 534f30cd4c..9ec7e3a1e4 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -183,7 +183,11 @@ extern char **environ;
@@ -183,7 +183,12 @@ extern char **environ;
SymI_HasProto(__mingw_vsnwprintf) \
/* ^^ Need to figure out why this is needed. */ \
SymI_HasProto(__mingw_vfprintf) \
Expand All @@ -11,7 +11,8 @@ index 534f30cd4c..9ec7e3a1e4 100644
+ SymI_NeedsProto(_tzset) \
+ /* ^^ This one needed for time, tzset deprecated */\
+ SymI_NeedsProto(tzset) \
+ /* ^^ This one needed for unix-time */
+ SymI_HasProto(strtoll) \
+ /* ^^ These two are needed for unix-time */

#define RTS_MINGW_COMPAT_SYMBOLS \
SymI_HasProto_deprecated(access) \
5 changes: 3 additions & 2 deletions overlays/patches/ghc/win-add-tzset-to-rtssyms.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 10efb2a..d8ea070 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -163,7 +163,11 @@ extern char **environ;
@@ -163,7 +163,12 @@ extern char **environ;
SymI_HasProto(__mingw_vfprintf) \
/* ^^ Need to figure out why this is needed. */ \
SymI_HasProto(closure_sizeW_) \
Expand All @@ -11,7 +11,8 @@ index 10efb2a..d8ea070 100644
+ SymI_NeedsProto(_tzset) \
+ /* ^^ This one needed for time, tzset deprecated */\
+ SymI_NeedsProto(tzset) \
+ /* ^^ This one needed for unix-time */
+ SymI_HasProto(strtoll) \
+ /* ^^ These two are needed for unix-time */
#else
#define RTS_MINGW_ONLY_SYMBOLS /**/
#endif
1 change: 1 addition & 0 deletions test/th-dlls/th-dlls.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ library
, template-haskell
, text
, double-conversion
, unix-time
exposed-modules: Lib
hs-source-dirs: src
default-language: Haskell2010
Expand Down