llvm.org GIT mirror llvm / b9fec3e
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240882 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 4 years ago
2 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
4242 = "llvm_ee_run_static_dtors"
4343 external data_layout : llexecutionengine -> Llvm_target.DataLayout.t
4444 = "llvm_ee_get_data_layout"
45 external add_global_mapping_ : Llvm.llvalue -> int64 -> llexecutionengine -> unit
45 external add_global_mapping_ : Llvm.llvalue -> nativeint -> llexecutionengine -> unit
4646 = "llvm_ee_add_global_mapping"
47 external get_global_value_address_ : string -> llexecutionengine -> int64
47 external get_global_value_address_ : string -> llexecutionengine -> nativeint
4848 = "llvm_ee_get_global_value_address"
49 external get_function_address_ : string -> llexecutionengine -> int64
49 external get_function_address_ : string -> llexecutionengine -> nativeint
5050 = "llvm_ee_get_function_address"
5151
5252 let add_global_mapping llval ptr ee =
5454
5555 let get_global_value_address name typ ee =
5656 let vptr = get_global_value_address_ name ee in
57 if Int64.to_int vptr <> 0 then
57 if Nativeint.to_int vptr <> 0 then
5858 let open Ctypes in !@ (coerce (ptr void) (ptr typ) (ptr_of_raw_address vptr))
5959 else
6060 raise (Error ("Value " ^ name ^ " not found"))
6161
6262 let get_function_address name typ ee =
6363 let fptr = get_function_address_ name ee in
64 if Int64.to_int fptr <> 0 then
64 if Nativeint.to_int fptr <> 0 then
6565 let open Ctypes in coerce (ptr void) typ (ptr_of_raw_address fptr)
6666 else
6767 raise (Error ("Function " ^ name ^ " not found"))
545545 if( OCAML_VERSION VERSION_LESS "4.00.0" )
546546 message(STATUS "OCaml bindings disabled, need OCaml >=4.00.0.")
547547 else()
548 find_ocamlfind_package(ctypes VERSION 0.3 OPTIONAL)
548 find_ocamlfind_package(ctypes VERSION 0.4 OPTIONAL)
549549 if( HAVE_OCAML_CTYPES )
550550 message(STATUS "OCaml bindings enabled.")
551551 find_ocamlfind_package(oUnit VERSION 2 OPTIONAL)
552552 set(LLVM_BINDINGS "${LLVM_BINDINGS} ocaml")
553553 else()
554 message(STATUS "OCaml bindings disabled, need ctypes >=0.3.")
554 message(STATUS "OCaml bindings disabled, need ctypes >=0.4.")
555555 endif()
556556 endif()
557557 endif()