diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/rts/Makefile | 8 | ||||
-rw-r--r-- | testsuite/tests/rts/T2615.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/rts/rdynamic.hs | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile index 8a7cb8af02..c943bb4135 100644 --- a/testsuite/tests/rts/Makefile +++ b/testsuite/tests/rts/Makefile @@ -124,7 +124,7 @@ linker_unload: $(RM) Test.o Test.hi "$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 # -rtsopts causes a warning - "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS)) linker_unload.c -o linker_unload -no-hs-main -optc-Werror -debug -optc-g + "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS)) linker_unload.c -o linker_unload -no-hs-main -optc-Werror -threaded ./linker_unload $(BASE) $(GHC_PRIM) $(INTEGER_GMP) # ----------------------------------------------------------------------------- @@ -142,7 +142,7 @@ linker_unload: .PHONY: linker_error1 linker_error1: "$(TEST_HC)" -c linker_error.c -o linker_error1.o - "$(TEST_HC)" linker_error1.o -o linker_error1 -no-hs-main -optc-g -debug + "$(TEST_HC)" linker_error1.o -o linker_error1 -no-hs-main -optc-g -debug -threaded ./linker_error1 linker_error.c # linker_error2: the object file has an unknown symbol (fails in @@ -152,7 +152,7 @@ linker_error1: linker_error2: "$(TEST_HC)" -c linker_error.c -o linker_error2.o "$(TEST_HC)" -c linker_error2.c -o linker_error2_o.o - "$(TEST_HC)" linker_error2.o -o linker_error2 -no-hs-main -optc-g -debug + "$(TEST_HC)" linker_error2.o -o linker_error2 -no-hs-main -optc-g -debug -threaded ./linker_error2 linker_error2_o.o # linker_error3: the object file duplicates an existing symbol (fails @@ -162,5 +162,5 @@ linker_error2: linker_error3: "$(TEST_HC)" -c linker_error.c -o linker_error3.o "$(TEST_HC)" -c linker_error3.c -o linker_error3_o.o - "$(TEST_HC)" linker_error3.o -o linker_error3 -no-hs-main -optc-g -debug + "$(TEST_HC)" linker_error3.o -o linker_error3 -no-hs-main -optc-g -debug -threaded ./linker_error3 linker_error3_o.o diff --git a/testsuite/tests/rts/T2615.hs b/testsuite/tests/rts/T2615.hs index ee04d93bcf..53c2d13ceb 100644 --- a/testsuite/tests/rts/T2615.hs +++ b/testsuite/tests/rts/T2615.hs @@ -3,6 +3,7 @@ import ObjLink library_name = "libfoo_script_T2615.so" -- this is really a linker script main = do + initObjLinker result <- loadDLL library_name case result of Nothing -> putStrLn (library_name ++ " loaded successfully") diff --git a/testsuite/tests/rts/rdynamic.hs b/testsuite/tests/rts/rdynamic.hs index 5fb4651ff9..17f8df76cd 100644 --- a/testsuite/tests/rts/rdynamic.hs +++ b/testsuite/tests/rts/rdynamic.hs @@ -26,6 +26,7 @@ loadFunction :: Maybe String -> String -> IO (Maybe a) loadFunction mpkg m valsym = do + c_initLinker let symbol = prefixUnderscore ++ maybe "" (\p -> zEncodeString p ++ "_") mpkg ++ zEncodeString m ++ "_" ++ zEncodeString valsym @@ -39,3 +40,4 @@ loadFunction mpkg m valsym = do prefixUnderscore = if elem os ["darwin","mingw32","cygwin"] then "_" else "" foreign import ccall safe "lookupSymbol" c_lookupSymbol :: CString -> IO (Ptr a) +foreign import ccall safe "initLinker" c_initLinker :: IO () |