guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: ghc: Really disable test that fails with glibc 2.30 and late


From: guix-commits
Subject: 01/03: gnu: ghc: Really disable test that fails with glibc 2.30 and later.
Date: Tue, 24 Mar 2020 13:03:36 -0400 (EDT)

mbakke pushed a commit to branch core-updates
in repository guix.

commit c75db693713e74a632bafe849de68a87ee7e34eb
Author: Marius Bakke <address@hidden>
AuthorDate: Tue Mar 24 17:58:20 2020 +0100

    gnu: ghc: Really disable test that fails with glibc 2.30 and later.
    
    This follows up commit 2e9c43aa9adac2bd6bcf92373d1cf9f322afa5a3, which was
    incomplete.  Fixes <https://bugs.gnu.org/39358>.
    
    * gnu/packages/patches/ghc-testsuite-dlopen-pie.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Adjust accordingly.  Also use tabs instead
    of spaces on surrounding patches.
    * gnu/packages/haskell.scm (ghc-8.6)[native-inputs]: Add patch for
    "ghc-testsuite".
    [arguments]: Remove incomplete workaround for the same issue.
---
 gnu/local.mk                                       |  5 +-
 gnu/packages/haskell.scm                           |  9 +---
 .../patches/ghc-testsuite-dlopen-pie.patch         | 54 ++++++++++++++++++++++
 3 files changed, 59 insertions(+), 9 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 38dec7f..f335ee1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -930,9 +930,10 @@ dist_patch_DATA =                                          
\
   %D%/packages/patches/gd-fix-tests-on-i686.patch              \
   %D%/packages/patches/gd-freetype-test-failure.patch          \
   %D%/packages/patches/geoclue-config.patch                    \
-  %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
-  %D%/packages/patches/ghc-diff-swap-cover-args.patch           \
+  %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch        \
+  %D%/packages/patches/ghc-testsuite-dlopen-pie.patch          \
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch     
\
+  %D%/packages/patches/ghc-diff-swap-cover-args.patch          \
   %D%/packages/patches/ghc-haddock-api-fix-haddock.patch       \
   %D%/packages/patches/ghc-hpack-fix-tests.patch               \
   %D%/packages/patches/ghc-microlens-aeson-fix-tests.patch     \
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 8a33263..a11b699 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -19,7 +19,7 @@
 ;;; Copyright © 2018, 2019 Gabriel Hondet <address@hidden>
 ;;; Copyright © 2019 Robert Vollmert <address@hidden>
 ;;; Copyright © 2019 Jacob MacDonald <address@hidden>
-;;; Copyright © Marius Bakke <address@hidden>
+;;; Copyright © 2020 Marius Bakke <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -568,6 +568,7 @@ interactive environment for the functional language 
Haskell.")
            (uri (string-append
                  "https://www.haskell.org/ghc/dist/";
                  version "/" name "-" version "-testsuite.tar.xz"))
+           (patches (search-patches "ghc-testsuite-dlopen-pie.patch"))
            (sha256
             (base32
              "0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))))
@@ -591,12 +592,6 @@ interactive environment for the functional language 
Haskell.")
                  (("^test\\('T8108'") "# guix skipped: test('T8108'"))
                (substitute* "libraries/unix/tests/libposix/all.T"
                  (("^test\\('posix010'") "# guix skipped: test('posix010'"))
-               ;; This test attempts to dlopen() a position-independent
-               ;; executable(!), which is disallowed since glibc 2.30.  See
-               ;; https://sourceware.org/bugzilla/show_bug.cgi?id=24323
-               (substitute* "testsuite/tests/dynlibs/Makefile"
-                 (("\\./T13702a")
-                  "# ./T13702a"))
                #t))))))
     (native-search-paths (list (search-path-specification
                                 (variable "GHC_PACKAGE_PATH")
diff --git a/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch 
b/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
new file mode 100644
index 0000000..99ba3ac
--- /dev/null
+++ b/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
@@ -0,0 +1,54 @@
+Do not attempt to dlopen PIE objects, which was disallowed with glibc 2.30.
+
+https://gitlab.haskell.org/ghc/ghc/issues/17952
+https://sourceware.org/bugzilla/show_bug.cgi?id=24323
+
+Patch submitted upstream:
+https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2947
+
+diff --git a/testsuite/tests/dynlibs/Makefile 
b/testsuite/tests/dynlibs/Makefile
+--- a/testsuite/tests/dynlibs/Makefile
++++ b/testsuite/tests/dynlibs/Makefile
+@@ -60,6 +60,4 @@ T5373:
+ .PHONY: T13702
+ T13702:
+       '$(TEST_HC)' -v0 -dynamic -rdynamic -fPIC -pie T13702.hs
+-      '$(TEST_HC)' -v0 -dynamic T13702a.hs
+-      ./T13702  # first make sure executable itself works
+-      ./T13702a # then try dynamically loading it as library
++      ./T13702
+diff --git a/testsuite/tests/dynlibs/T13702.hs 
b/testsuite/tests/dynlibs/T13702.hs
+--- a/testsuite/tests/dynlibs/T13702.hs
++++ b/testsuite/tests/dynlibs/T13702.hs
+@@ -2,8 +2,3 @@
+ 
+ main :: IO ()
+ main = putStrLn "hello world"
+-
+-foreign export ccall "hello" hello :: IO ()
+-
+-hello :: IO ()
+-hello = putStrLn "hello world again"
+diff --git a/testsuite/tests/dynlibs/T13702.stdout 
b/testsuite/tests/dynlibs/T13702.stdout
+--- a/testsuite/tests/dynlibs/T13702.stdout
++++ b/testsuite/tests/dynlibs/T13702.stdout
+@@ -1,2 +1 @@
+ hello world
+-hello world again
+diff --git a/testsuite/tests/dynlibs/T13702a.hs 
b/testsuite/tests/dynlibs/T13702a.hs
+deleted file mode 100644
+--- a/testsuite/tests/dynlibs/T13702a.hs
++++ /dev/null
+@@ -1,12 +0,0 @@
+-{-# LANGUAGE ForeignFunctionInterface #-}
+-
+-import Foreign
+-import System.Posix.DynamicLinker
+-
+-main :: IO ()
+-main = do
+-    dl <- dlopen "./T13702" [RTLD_NOW]
+-    funptr <- dlsym dl "hello" :: IO (FunPtr (IO ()))
+-    mkAction funptr
+-
+-foreign import ccall "dynamic" mkAction :: FunPtr (IO ()) -> IO ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]