From 88d75f99c35ae1dae2bec2ebe9229d7c7c988dea Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Thu, 31 Oct 2024 13:46:40 +0100 Subject: [PATCH] =?UTF-8?q?gnu:=20ghc:=20More=20robust=20build=20with=20bi?= =?UTF-8?q?nutils=20=E2=89=A5=202.39.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Merges: #6651 --- gnu/local.mk | 1 - gnu/packages/haskell.scm | 24 ++++++++++--------- .../ghc-testsuite-recomp015-execstack.patch | 10 -------- 3 files changed, 13 insertions(+), 22 deletions(-) delete mode 100644 gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch diff --git a/gnu/local.mk b/gnu/local.mk index 922fbf296e..74de0655d6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -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 \ diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 4aa17d1718..4ade621068 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -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) diff --git a/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch b/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch deleted file mode 100644 index cdaf5b180d..0000000000 --- a/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch +++ /dev/null @@ -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