summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc')
-rw-r--r--ghc/ghc.mk4
-rw-r--r--ghc/hschooks.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index 49c82185a4..0ad059f7ff 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -51,6 +51,10 @@ ghc_stage1_C_FILES_NODEPS = ghc/hschooks.c
ghc_stage2_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
ghc_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
+ghc_stage1_MORE_HC_OPTS += -no-hs-main
+ghc_stage2_MORE_HC_OPTS += -no-hs-main
+ghc_stage3_MORE_HC_OPTS += -no-hs-main
+
ifeq "$(GhcDebugged)" "YES"
ghc_stage1_MORE_HC_OPTS += -debug
ghc_stage2_MORE_HC_OPTS += -debug
diff --git a/ghc/hschooks.c b/ghc/hschooks.c
index 67cdd57ab9..2ebbace136 100644
--- a/ghc/hschooks.c
+++ b/ghc/hschooks.c
@@ -54,3 +54,15 @@ StackOverflowHook (StgWord stack_size) /* in bytes */
fprintf(stderr, "GHC stack-space overflow: current limit is %zu bytes.\nUse the `-K<size>' option to increase it.\n", (size_t)stack_size);
}
+int main (int argc, char *argv[])
+{
+ RtsConfig conf = defaultRtsConfig;
+#if __GLASGOW_HASKELL__ >= 711
+ conf.defaultsHook = defaultsHook;
+ conf.rts_opts_enabled = RtsOptsAll;
+ conf.stackOverflowHook = StackOverflowHook;
+#endif
+ extern StgClosure ZCMain_main_closure;
+
+ hs_main(argc, argv, &ZCMain_main_closure, conf);
+}