summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2015-06-27 14:32:30 +0000
committerPeter Zotov <whitequark@whitequark.org>2015-06-27 14:32:30 +0000
commit8c7e29d583eb54b2dd3e4c105e63ce3b4299433b (patch)
treea45efa8a28989bf9862bd8157ed1ff9873bbec03
parent2697d2a43b9eb23c741a4aced40005e9d1608fa0 (diff)
downloadbcm5719-llvm-8c7e29d583eb54b2dd3e4c105e63ce3b4299433b.tar.gz
bcm5719-llvm-8c7e29d583eb54b2dd3e4c105e63ce3b4299433b.zip
[OCaml] Bump ctypes dependency to 0.4.
ctypes 0.3 and earlier contains an interface-definig bug: its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4 was not released during the 3.6 cycle, and because of that, LLVM 3.6 was released with ctypes 0.3 as a dependency, which now breaks the build on modern ctypes. Unbreak. llvm-svn: 240882
-rw-r--r--llvm/bindings/ocaml/executionengine/llvm_executionengine.ml10
-rwxr-xr-xllvm/cmake/config-ix.cmake4
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml b/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml
index 34031bed603..3f37e0c9d3d 100644
--- a/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml
+++ b/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml
@@ -43,11 +43,11 @@ external run_static_dtors : llexecutionengine -> unit
= "llvm_ee_run_static_dtors"
external data_layout : llexecutionengine -> Llvm_target.DataLayout.t
= "llvm_ee_get_data_layout"
-external add_global_mapping_ : Llvm.llvalue -> int64 -> llexecutionengine -> unit
+external add_global_mapping_ : Llvm.llvalue -> nativeint -> llexecutionengine -> unit
= "llvm_ee_add_global_mapping"
-external get_global_value_address_ : string -> llexecutionengine -> int64
+external get_global_value_address_ : string -> llexecutionengine -> nativeint
= "llvm_ee_get_global_value_address"
-external get_function_address_ : string -> llexecutionengine -> int64
+external get_function_address_ : string -> llexecutionengine -> nativeint
= "llvm_ee_get_function_address"
let add_global_mapping llval ptr ee =
@@ -55,14 +55,14 @@ let add_global_mapping llval ptr ee =
let get_global_value_address name typ ee =
let vptr = get_global_value_address_ name ee in
- if Int64.to_int vptr <> 0 then
+ if Nativeint.to_int vptr <> 0 then
let open Ctypes in !@ (coerce (ptr void) (ptr typ) (ptr_of_raw_address vptr))
else
raise (Error ("Value " ^ name ^ " not found"))
let get_function_address name typ ee =
let fptr = get_function_address_ name ee in
- if Int64.to_int fptr <> 0 then
+ if Nativeint.to_int fptr <> 0 then
let open Ctypes in coerce (ptr void) typ (ptr_of_raw_address fptr)
else
raise (Error ("Function " ^ name ^ " not found"))
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 4e22aabd2d9..f0855d6edf5 100755
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -546,13 +546,13 @@ else()
if( OCAML_VERSION VERSION_LESS "4.00.0" )
message(STATUS "OCaml bindings disabled, need OCaml >=4.00.0.")
else()
- find_ocamlfind_package(ctypes VERSION 0.3 OPTIONAL)
+ find_ocamlfind_package(ctypes VERSION 0.4 OPTIONAL)
if( HAVE_OCAML_CTYPES )
message(STATUS "OCaml bindings enabled.")
find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
else()
- message(STATUS "OCaml bindings disabled, need ctypes >=0.3.")
+ message(STATUS "OCaml bindings disabled, need ctypes >=0.4.")
endif()
endif()
endif()
OpenPOWER on IntegriCloud