diff options
author | howard_b_golden <howard_b_golden@yahoo.com> | 2009-12-16 21:12:20 +0000 |
---|---|---|
committer | howard_b_golden <howard_b_golden@yahoo.com> | 2009-12-16 21:12:20 +0000 |
commit | 25414b7919ee5606b44792952544a025c12fe0b9 (patch) | |
tree | bb8bde8b8c0981eec1302aac593327f2562da831 /testsuite/tests/ghc-regress/rts/Makefile | |
parent | fbf93183ef8065e3b400ae33f4858b17bcf1fefe (diff) | |
download | haskell-25414b7919ee5606b44792952544a025c12fe0b9.tar.gz |
FIX #2615 (linker scripts in .so files)
This is the regression test for FIX #2615 (linker scripts in .so files).
It does NOT apply to Windows. It applies only to systems using ELF files.
In order for this test to work on all ELF systems, no assumption is
made about whether or not real ELF shared libraries and linker scripts
exist. Instead, this patch compiles a trivial C program into an ELF shared
library. Also, a mock linker script (libfoo_script_T2615.so) is included in
the patch. Note: This is marked as a binary, but it is a text file.
Test approach:
A small Haskell program (T2615.hs) imports the ObjLink module from GHC.
It then calls the loadDLL function with the name of the mock linker script
(libfoo_script_T2615.so). This mock script contains a link to a real
shared library (libfoo_T2615.so) which the test has already created. If
the dlopen (in the addDLL function in rts/Linker.c) works, the Haskell
program will return a success message. Otherwise, it will return the error
message it receives from loadDLL (which is actually the dlerror() message
received by addDLL).
Diffstat (limited to 'testsuite/tests/ghc-regress/rts/Makefile')
-rw-r--r-- | testsuite/tests/ghc-regress/rts/Makefile | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/rts/Makefile b/testsuite/tests/ghc-regress/rts/Makefile index 1fd620b629..2fe0f1723e 100644 --- a/testsuite/tests/ghc-regress/rts/Makefile +++ b/testsuite/tests/ghc-regress/rts/Makefile @@ -2,6 +2,14 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk +.SUFFIXES: .so + +.o.so: + '$(TEST_HC)' -shared -no-auto-link-packages -o $@ $< + +.c.o: + '$(TEST_HC)' -fPIC -c -o $@ $< + outofmem-prep:: '$(TEST_HC)' --make -fforce-recomp outofmem.hs -o outofmem @@ -15,3 +23,6 @@ outofmem2-prep:: outofmem2:: @$(MAKE) outofmem2-prep >prep.out 2>prep.out @ulimit -v 1000000 2>/dev/null; ./outofmem2 +RTS -M5m -RTS || echo "exit($$?)" + +T2615-prep: libfoo_T2615.so + |