aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorJosselin Poiret <dev@jpoiret.xyz>2024-01-15 23:05:37 +0100
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:44:27 +0200
commit13b5b5d10f32fde3543e7346c776f5734e6c9a6e (patch)
tree4ba7e6d9e92a73b97ec40885baff23eb13f6c6fc /gnu/packages/patches
parent4840707013ead04c661d5cd3fe78b871254af895 (diff)
downloadguix-13b5b5d10f32fde3543e7346c776f5734e6c9a6e.tar
guix-13b5b5d10f32fde3543e7346c776f5734e6c9a6e.tar.gz
gnu: ghc: Fix build with binutils ≥ 2.39.
ld warns about exec stack now, making some tests fail. Fix them (and also remove an unwarranted exec stack from libHSrts along with it). * gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch * gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch: New patches. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/haskell.scm (ghc-8.6, ghc-8.8, ghc-8.10, ghc-9.0, ghc-9.2, ghc-9.4): Use them. Change-Id: I8e5fc71d7394527d44ff37b1f9bd59d4971ec010
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch33
-rw-r--r--gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch10
2 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch b/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch
new file mode 100644
index 0000000000..3e40da4cc6
--- /dev/null
+++ b/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch
@@ -0,0 +1,33 @@
+From d61f742876bdf2cd32e76f7bca389106ad99a316 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Tue, 3 May 2022 12:40:43 -0400
+Subject: [PATCH] rts/ghc.mk: Only build StgCRunAsm.S when it is needed
+
+Previously the make build system unconditionally included StgCRunAsm.S
+in the link, meaning that the RTS would require an execstack
+unnecessarily.
+
+Fixes #21478.
+---
+ rts/ghc.mk | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rts/ghc.mk b/rts/ghc.mk
+index 36a82f9f2c8..0e56515a569 100644
+--- a/rts/ghc.mk
++++ b/rts/ghc.mk
+@@ -57,8 +57,11 @@ ifneq "$(PORTING_HOST)" "YES"
+
+ # unregisterised builds use the mini interpreter
+ ifneq "$(GhcUnregisterised)" "YES"
++# use StgCRunAsm.S on ppc, ppc64, s390x, and riscv64
++ifneq "$(findstring $(TargetArch_CPP), ppc)$(findstring $(TargetArch_CPP), ppc64)$(findstring $(TargetArch_CPP), s390x)$(findstring $(TargetArch_CPP), riscv64)" ""
+ rts_S_SRCS += rts/StgCRunAsm.S
+ endif
++endif
+
+ # select adjustor implementation. This much match the logic in rts.cabal.in.
+ ifneq "$(CLEANING)" "YES"
+--
+GitLab
+
diff --git a/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch b/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch
new file mode 100644
index 0000000000..cdaf5b180d
--- /dev/null
+++ b/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch
@@ -0,0 +1,10 @@
+--- a/testsuite/tests/driver/recomp015/Makefile 2024-01-13 16:22:42.643106725 +0100
++++ b/testsuite/tests/driver/recomp015/Makefile 2024-01-13 16:23:18.406867917 +0100
+@@ -26,6 +26,7 @@
+ # number of sections)
+ '$(TEST_HC)' $(TEST_HC_OPTS) Generate.hs
+ ./Generate > ManySections.s
++ echo '.section .note.GNU-stack,"",@progbits' > ManySections.s
+ echo 'main = putStrLn "Running main..."' > Main.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c ManySections.s
+ '$(TEST_HC)' $(TEST_HC_OPTS) --make -O Main.hs ManySections.o