summaryrefslogtreecommitdiff
path: root/compiler/ghci/keepCAFsForGHCi.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ghci/keepCAFsForGHCi.c')
-rw-r--r--compiler/ghci/keepCAFsForGHCi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/ghci/keepCAFsForGHCi.c
new file mode 100644
index 0000000000..0aabbedea0
--- /dev/null
+++ b/compiler/ghci/keepCAFsForGHCi.c
@@ -0,0 +1,15 @@
+#include "Rts.h"
+#include "Storage.h"
+
+// This file is only included when GhcBuildDylibs is set in mk/build.mk.
+// It contains an __attribute__((constructor)) function (run prior to main())
+// which sets the keepCAFs flag in the RTS, before any Haskell code is run.
+// This is required so that GHCi can use dynamic libraries instead of HSxyz.o
+// files.
+
+static void keepCAFsForGHCi() __attribute__((constructor));
+
+static void keepCAFsForGHCi()
+{
+ keepCAFs = 1;
+}