diff options
author | Tamar Christina <tamar@zhox.com> | 2016-06-13 13:29:17 +0200 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2016-06-13 13:35:21 +0200 |
commit | 5cee88d766723929f789ffcd2ef24d8b5ef62a16 (patch) | |
tree | b5547621eabd5bc8435b5c79cd3cc0497273c0a0 /testsuite | |
parent | 1dcb32ddba605bced2e0e0ce3f52b58e8ff33f5b (diff) | |
download | haskell-5cee88d766723929f789ffcd2ef24d8b5ef62a16.tar.gz |
Add thin library support to Windows too
Summary:
Code already existed in the RTS to add thin library support for non-Windows
operating systems. This adds it to Windows as well.
ar thin libraries have the exact same format as normal archives except they
have a different magic string and they don't copy the object files into the
archive.
Instead each header entry points to the location of the object file on disk.
This is useful when a library is only created to satisfy a compile time dependency
instead of to be distributed. This saves the time required for copying.
Test Plan: ./validate and new test T11788
Reviewers: austin, bgamari, simonmar, erikd
Reviewed By: bgamari, simonmar
Subscribers: thomie, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2323
GHC Trac Issues: #11788
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/rts/Makefile | 6 | ||||
-rw-r--r-- | testsuite/tests/rts/T11788.c | 14 | ||||
-rw-r--r-- | testsuite/tests/rts/T11788.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/rts/T11788.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/rts/all.T | 3 |
5 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile index e9cce901b0..d3231b862c 100644 --- a/testsuite/tests/rts/Makefile +++ b/testsuite/tests/rts/Makefile @@ -162,3 +162,9 @@ linker_error3: "$(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 -threaded ./linker_error3 linker_error3_o.o + + .PHONY: T11788 +T11788: + "$(TEST_HC)" -c T11788.c -o T11788_obj.o + "$(AR)" rsT libT11788.a T11788_obj.o 2> /dev/null + echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) T11788.hs -lT11788 -L"$(PWD)" diff --git a/testsuite/tests/rts/T11788.c b/testsuite/tests/rts/T11788.c new file mode 100644 index 0000000000..cd6e4aca4c --- /dev/null +++ b/testsuite/tests/rts/T11788.c @@ -0,0 +1,14 @@ +int a() +{ + return 4; +} + +int b() +{ + return a()*a(); +} + +int c() +{ + return a()*b(); +} diff --git a/testsuite/tests/rts/T11788.hs b/testsuite/tests/rts/T11788.hs new file mode 100644 index 0000000000..ff7aa58ba4 --- /dev/null +++ b/testsuite/tests/rts/T11788.hs @@ -0,0 +1,5 @@ +module Main where + +foreign import ccall "c" c_exp :: Int + +main = print c_exp diff --git a/testsuite/tests/rts/T11788.stdout b/testsuite/tests/rts/T11788.stdout new file mode 100644 index 0000000000..900731ffd5 --- /dev/null +++ b/testsuite/tests/rts/T11788.stdout @@ -0,0 +1 @@ +64 diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 334862c602..de11b3f3ec 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -342,6 +342,9 @@ test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])], test('T9405', [extra_clean(['T9405.ticky'])], run_command, ['$MAKE -s --no-print-directory T9405']) +test('T11788', when(ghc_dynamic(), skip), + run_command, ['$MAKE -s --no-print-directory T11788']) + test('T10296a', [extra_clean(['T10296a.o','T10296a_c.o','T10296a'])], run_command, ['$MAKE -s --no-print-directory T10296a']) |