summaryrefslogtreecommitdiff
path: root/bindings/ocaml/executionengine
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/ocaml/executionengine')
-rw-r--r--bindings/ocaml/executionengine/Makefile1
-rw-r--r--bindings/ocaml/executionengine/executionengine_ocaml.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/bindings/ocaml/executionengine/Makefile b/bindings/ocaml/executionengine/Makefile
index 40fb98e1914a..5fa3f22048f4 100644
--- a/bindings/ocaml/executionengine/Makefile
+++ b/bindings/ocaml/executionengine/Makefile
@@ -13,7 +13,6 @@
LEVEL := ../../..
LIBRARYNAME := llvm_executionengine
-DONT_BUILD_RELINKED := 1
UsedComponents := executionengine jit interpreter native
UsedOcamlInterfaces := llvm llvm_target
diff --git a/bindings/ocaml/executionengine/executionengine_ocaml.c b/bindings/ocaml/executionengine/executionengine_ocaml.c
index ec403380ef44..647759fb0744 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. */