summary refs log tree commit diff
path: root/gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-24 17:58:20 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-24 18:02:43 +0100
commitc75db693713e74a632bafe849de68a87ee7e34eb (patch)
tree5596fe00aab0e7aa7ad41f15c7e3d8ee7d67aa97 /gnu/packages/patches/ghc-testsuite-dlopen-pie.patch
parent53de3e74fac862bc07de160e8e226372de213dd1 (diff)
downloadguix-c75db693713e74a632bafe849de68a87ee7e34eb.tar.gz
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.
Diffstat (limited to 'gnu/packages/patches/ghc-testsuite-dlopen-pie.patch')
-rw-r--r--gnu/packages/patches/ghc-testsuite-dlopen-pie.patch54
1 files changed, 54 insertions, 0 deletions
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 0000000000..99ba3ac42f
--- /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 ()