summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/linkwhole/Makefile
blob: 6f4086f50c3bffe4dbef8629cf3e5eb6e58b2d7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

# Test for -fwhole-archive-hs-libs

ifeq "$(HostOS)" "darwin"
NO_GC_SECTIONS=
else
NO_GC_SECTIONS=-optl-Wl,--no-gc-sections
endif

linkwhole:
	"$(TEST_HC)" $(TEST_HC_OPTS) -c Types.hs
	"$(TEST_HC)" $(TEST_HC_OPTS) -c Main.hs
	"$(TEST_HC)" $(TEST_HC_OPTS) -o host Main.o Types.o -fwhole-archive-hs-libs -package ghci -rdynamic $(NO_GC_SECTIONS)
	"$(TEST_HC)" $(TEST_HC_OPTS) -c MyCode.hs
	"$(TEST_HC)" $(TEST_HC_OPTS) -c Handles.hs
	ld -r -o lib.so MyCode.o Handles.o
	./host lib.so