summaryrefslogtreecommitdiffstats
path: root/bindings/ocaml/executionengine/executionengine_ocaml.c
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/ocaml/executionengine/executionengine_ocaml.c')
-rw-r--r--bindings/ocaml/executionengine/executionengine_ocaml.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bindings/ocaml/executionengine/executionengine_ocaml.c b/bindings/ocaml/executionengine/executionengine_ocaml.c
index ec40338..647759f 100644
--- a/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ b/bindings/ocaml/executionengine/executionengine_ocaml.c
@@ -16,6 +16,7 @@
\*===----------------------------------------------------------------------===*/
#include "llvm-c/ExecutionEngine.h"
+#include "llvm-c/Target.h"
#include "caml/alloc.h"
#include "caml/custom.h"
#include "caml/fail.h"
@@ -23,6 +24,12 @@
#include <string.h>
#include <assert.h>
+/* Force the LLVM interpreter, JIT, and native target to be linked in. */
+void llvm_initialize(void) {
+ LLVMLinkInInterpreter();
+ LLVMLinkInJIT();
+ LLVMInitializeNativeTarget();
+}
/* Can't use the recommended caml_named_value mechanism for backwards
compatibility reasons. This is largely equivalent. */
OpenPOWER on IntegriCloud