]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blobdiff - files/bootstrap-main.c
Merge branch 'ghc-7.4.1'
[pkgsrc-ghc.git] / files / bootstrap-main.c
diff --git a/files/bootstrap-main.c b/files/bootstrap-main.c
new file mode 100644 (file)
index 0000000..ea1d2f8
--- /dev/null
@@ -0,0 +1,17 @@
+#include "Rts.h"
+
+/* A quick and dirty hack to resurrect -fvia-C from bitrot.
+ *
+ * The main function has been removed from rts. It's now generated by
+ * compiler/main/DriverPipeline.hs but that doesn't play nice with
+ * -fvia-C.
+ */
+
+extern StgClosure ZCMain_main_closure;
+
+int main(int argc, char *argv[])
+{
+    RtsConfig __conf = defaultRtsConfig;
+    __conf.rts_opts_enabled = RtsOptsAll;
+    return hs_main(argc, argv, &ZCMain_main_closure, __conf);
+}