gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / ghc-testsuite-dlopen-pie.patch
1 Do not attempt to dlopen PIE objects, which was disallowed with glibc 2.30.
2
3 https://gitlab.haskell.org/ghc/ghc/issues/17952
4 https://sourceware.org/bugzilla/show_bug.cgi?id=24323
5
6 Patch submitted upstream:
7 https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2947
8
9 diff --git a/testsuite/tests/dynlibs/Makefile b/testsuite/tests/dynlibs/Makefile
10 --- a/testsuite/tests/dynlibs/Makefile
11 +++ b/testsuite/tests/dynlibs/Makefile
12 @@ -60,6 +60,4 @@ T5373:
13 .PHONY: T13702
14 T13702:
15 '$(TEST_HC)' -v0 -dynamic -rdynamic -fPIC -pie T13702.hs
16 - '$(TEST_HC)' -v0 -dynamic T13702a.hs
17 - ./T13702 # first make sure executable itself works
18 - ./T13702a # then try dynamically loading it as library
19 + ./T13702
20 diff --git a/testsuite/tests/dynlibs/T13702.hs b/testsuite/tests/dynlibs/T13702.hs
21 --- a/testsuite/tests/dynlibs/T13702.hs
22 +++ b/testsuite/tests/dynlibs/T13702.hs
23 @@ -2,8 +2,3 @@
24
25 main :: IO ()
26 main = putStrLn "hello world"
27 -
28 -foreign export ccall "hello" hello :: IO ()
29 -
30 -hello :: IO ()
31 -hello = putStrLn "hello world again"
32 diff --git a/testsuite/tests/dynlibs/T13702.stdout b/testsuite/tests/dynlibs/T13702.stdout
33 --- a/testsuite/tests/dynlibs/T13702.stdout
34 +++ b/testsuite/tests/dynlibs/T13702.stdout
35 @@ -1,2 +1 @@
36 hello world
37 -hello world again
38 diff --git a/testsuite/tests/dynlibs/T13702a.hs b/testsuite/tests/dynlibs/T13702a.hs
39 deleted file mode 100644
40 --- a/testsuite/tests/dynlibs/T13702a.hs
41 +++ /dev/null
42 @@ -1,12 +0,0 @@
43 -{-# LANGUAGE ForeignFunctionInterface #-}
44 -
45 -import Foreign
46 -import System.Posix.DynamicLinker
47 -
48 -main :: IO ()
49 -main = do
50 - dl <- dlopen "./T13702" [RTLD_NOW]
51 - funptr <- dlsym dl "hello" :: IO (FunPtr (IO ()))
52 - mkAction funptr
53 -
54 -foreign import ccall "dynamic" mkAction :: FunPtr (IO ()) -> IO ()