From a7ab161602aa0b5833d22c66e64eebb1d9275235 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 9 Jun 2014 09:18:12 +0100 Subject: Replace hooks by callbacks in RtsConfig (#8785) Summary: Hooks rely on static linking semantics, and are broken by -Bsymbolic which we need when using dynamic linking. Test Plan: Built it Reviewers: austin, hvr, tibbe Differential Revision: https://phabricator.haskell.org/D8 --- ghc/hschooks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ghc/hschooks.c') 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' 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); +} -- cgit v1.2.1