1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: ghc: More robust build with binutils ≥ 2.39.

Future versions of ghc will have more occurrences of the execstack
warning.  Instead of modifying the tests for each new version, a more
robust approach is to explicitely make ghc pass -Wl,-z,noexecstack to
its ld invocations during all tests.  This is what this patch does.

* gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch: New patches.
* gnu/local.mk (disp_path_DATA): Deregister patch.
* gnu/packages/haskell.scm (ghc-8.6, ghc-8.8, ghc-9.0, ghc-9.2,
ghc-9.4): Deregister patch use. Add phase 'fix-tests-with-binutils@2.39.

Change-Id: Ib174c017eef512eda9b4754178a927517c7f05a1
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6651
This commit is contained in:
Nicolas Graves
2024-10-31 13:46:40 +01:00
committed by Ludovic Courtès
parent e8de387e89
commit 88d75f99c3
3 changed files with 13 additions and 22 deletions

View File

@@ -1444,7 +1444,6 @@ dist_patch_DATA = \
%D%/packages/patches/ghc-basement-fix-32-bit.patch \
%D%/packages/patches/ghc-testsuite-dlopen-pie.patch \
%D%/packages/patches/ghc-testsuite-grep-compat.patch \
%D%/packages/patches/ghc-testsuite-recomp015-execstack.patch \
%D%/packages/patches/ghc-aeson-encodeDouble.patch \
%D%/packages/patches/ghc-basement-fix-32bit.patch \
%D%/packages/patches/ghc-bytestring-handle-ghc9.patch \

View File

@@ -1186,8 +1186,7 @@ interactive environment for the functional language Haskell.")
"https://www.haskell.org/ghc/dist/"
version "/" name "-" version "-testsuite.tar.xz"))
(patches (search-patches "ghc-testsuite-dlopen-pie.patch"
"ghc-testsuite-grep-compat.patch"
"ghc-testsuite-recomp015-execstack.patch"))
"ghc-testsuite-grep-compat.patch"))
(sha256
(base32
"0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))
@@ -1241,7 +1240,14 @@ interactive environment for the functional language Haskell.")
(substitute* "libraries/unix/tests/all.T"
(("^test\\('T8108'") "# guix skipped: test('T8108'"))
(substitute* "libraries/unix/tests/libposix/all.T"
(("^test\\('posix010'") "# guix skipped: test('posix010'"))))))))
(("^test\\('posix010'") "# guix skipped: test('posix010'"))))
;; binutils@2.39 warns for execstack deprecation by default, causing
;; some tests to fail ; explicitely disable during linking instead.
(add-after 'unpack-testsuite 'fix-tests-with-binutils@2.39
(lambda _
(substitute* "testsuite/mk/test.mk"
(("^TEST_HC_OPTS = ")
"TEST_HC_OPTS = -optl -Wl,-z,noexecstack "))))))))
(native-search-paths (list (search-path-specification
(variable "GHC_PACKAGE_PATH")
(files (list
@@ -1269,8 +1275,7 @@ interactive environment for the functional language Haskell.")
"https://www.haskell.org/ghc/dist/"
version "/ghc-" version "-testsuite.tar.xz"))
(patches (search-patches "ghc-testsuite-dlopen-pie.patch"
"ghc-testsuite-grep-compat.patch"
"ghc-testsuite-recomp015-execstack.patch"))
"ghc-testsuite-grep-compat.patch"))
(sha256
(base32
"0c55pj2820q26rikhpf636sn4mjgqsxjrl94vsywrh79dxp3k14z"))
@@ -1329,8 +1334,7 @@ interactive environment for the functional language Haskell.")
"https://www.haskell.org/ghc/dist/"
version "/ghc-" version "-testsuite.tar.xz"))
(patches (search-patches "ghc-testsuite-dlopen-pie.patch"
"ghc-testsuite-grep-compat.patch"
"ghc-testsuite-recomp015-execstack.patch"))
"ghc-testsuite-grep-compat.patch"))
(sha256
(base32
"1zl25gg6bpx5601k8h3cqnns1xfc0nqgwnh8jvn2s65ra3f2g1nz"))
@@ -1525,8 +1529,7 @@ interactive environment for the functional language Haskell.")
(sha256
(base32
"1m5fzhr4gjn9ni8gxx7ag3fkbw1rspjzgv39mnfb0nkm5mw70v3s"))
(patches (search-patches "ghc-9.2-grep-warnings.patch"
"ghc-testsuite-recomp015-execstack.patch"))
(patches (search-patches "ghc-9.2-grep-warnings.patch"))
(modules '((guix build utils)))
(snippet
;; collections.Iterable was moved to collections.abc in Python 3.10.
@@ -1612,8 +1615,7 @@ SRC_HC_OPTS += -optc-mno-outline-atomics
(sha256
(base32
"0cmmwhcwv9fjzvmgjj85d354858qqbmqfzaz5160xqj4yl9zk225"))
(patches (search-patches "ghc-9.2-grep-warnings.patch"
"ghc-testsuite-recomp015-execstack.patch"))))
(patches (search-patches "ghc-9.2-grep-warnings.patch"))))
,@(filter (match-lambda
(("ghc-bootstrap" . _) #f)
(("ghc-testsuite" . _) #f)

View File

@@ -1,10 +0,0 @@
--- 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