Skip to content
Snippets Groups Projects
Commit 0b266acc authored by Simon Marlow's avatar Simon Marlow
Browse files

Fix T4464 for the new way of handling main() and -rtsopts

parent 52678794
No related branches found
No related tags found
No related merge requests found
......@@ -18,16 +18,16 @@ T4464:
$(RM) T4464B.o T4464C.o T4464H.hi T4464H.o
$(RM) T4464H_stub.c T4464H_stub.h T4464H_stub.o
$(RM) HS4464.dll HS4464.dll.a t4464.exe
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o HS4464.dll
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -optc-DRTSOPTS=RtsOptsSafeOnly -o HS4464.dll
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe -no-hs-main
-./t4464.exe
echo "====="
echo "=====" >&2
$(RM) T4464B.o T4464C.o T4464H.hi T4464H.o
$(RM) T4464H_stub.c T4464H_stub.h T4464H_stub.o
$(RM) HS4464.dll HS4464.dll.a t4464.exe
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o HS4464.dll -rtsopts
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -optc-DRTSOPTS=RtsOptsAll -o HS4464.dll
'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe -no-hs-main
./t4464.exe
.PHONY: T5373
......
......@@ -9,7 +9,16 @@ void HsStart(void) {
// Initialize Haskell runtime
char** args = argv;
#if __GLASGOW_HASKELL__ >= 703
{
RtsConfig conf = defaultRtsConfig;
conf.rts_opts_enabled = RTSOPTS; // RTSOPTS defined on the
// command line with -DRTSOPTS=...
hs_init_ghc(&argc, &args, conf);
}
#else
hs_init(&argc, &args);
#endif
// Tell Haskell about all root modules
hs_add_root(__stginit_T4464H);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment