Commit f4056324 authored by Tamar Christina's avatar Tamar Christina

Fix sporadic failing ghci/Linker/Dyn tests

Multiple tests use the same source C file.
GHC was previously writing the resulting .o files
in the same folder as the source. When these tests
are run in parallel, sometimes one of the calls would
use the partial .o file and throw an error.

The .o files are moved into different folders with this

Test Plan: make test -C testsuite/tests/ghci/linking/dyn

Reviewers: thomie, austin, bgamari

Reviewed By: bgamari

Differential Revision:
parent 2b7d9c2b
......@@ -30,7 +30,7 @@ MY_TEST_HC_OPTS = $(filter-out -rtsopts,$(TEST_HC_OPTS)) $(CFLAGS)
rm -rf bin_short
mkdir bin_short
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o "bin_short/$(call DLL,A)"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_short" -shared A.c -o "bin_short/$(call DLL,A)"
rm -f bin_short/*.a
echo ":q" | "$(TEST_HC)" --interactive -L"./bin_short" -lA -v0
......@@ -43,16 +43,16 @@ compile_libAS:
rm -rf bin_dep
mkdir bin_dep
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o "bin_dep/$(call DLL,A)"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared B.c -o "bin_dep/$(call DLL,B)" -lA -L"./bin_dep"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dep" -shared A.c -o "bin_dep/$(call DLL,A)"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dep" -shared B.c -o "bin_dep/$(call DLL,B)" -lA -L"./bin_dep"
rm -f bin_dep/*.a
.PHONY: compile_libAB_dyn
rm -rf bin_dyn
mkdir bin_dyn
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o "bin_dyn/$(call DLL,A)"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared B.c -o "bin_dyn/$(call DLL,B)" -lA -L"./bin_dyn"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -shared A.c -o "bin_dyn/$(call DLL,A)"
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -shared B.c -o "bin_dyn/$(call DLL,B)" -lA -L"./bin_dyn"
rm -f bin_dyn/*.a
'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -v0 -o "bin_dyn/$(call EXE,T10955dyn)" -L./bin_dyn -lB -lA T10955dyn.hs -v0
LD_LIBRARY_PATH=./bin_dyn ./bin_dyn/$(call EXE,T10955dyn)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment