The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #10962 from dra27/configure-options

Ignore compatible --disable options in configure

authored by

David Allsopp and committed by
GitHub
f3ea33a4 a8bec243

+46 -352
+23 -11
configure
··· 900 900 enable_native_toplevel 901 901 enable_frame_pointers 902 902 enable_naked_pointers 903 + enable_naked_pointers_checker 903 904 enable_spacetime 904 905 enable_cfi 905 906 enable_imprecise_c99_float_ops ··· 3179 3180 3180 3181 # Check whether --enable-vmthreads was given. 3181 3182 if test "${enable_vmthreads+set}" = set; then : 3182 - enableval=$enable_vmthreads; as_fn_error $? "The vmthreads library is no longer available. \ 3183 - It was deleted in OCaml 4.09." "$LINENO" 5 3183 + enableval=$enable_vmthreads; if test "x$enableval" != 'xno'; then : 3184 + as_fn_error $? "The vmthreads library is no longer available. It was deleted in OCaml 4.09." "$LINENO" 5 3185 + fi 3184 3186 fi 3185 3187 3186 3188 ··· 3192 3194 3193 3195 # Check whether --enable-graph-lib was given. 3194 3196 if test "${enable_graph_lib+set}" = set; then : 3195 - enableval=$enable_graph_lib; as_fn_error $? "The graphics library is no longer distributed with OCaml \ 3196 - since version 4.09. It is now distributed as a separate \"graphics\" package: \ 3197 - https://github.com/ocaml/graphics" "$LINENO" 5 3197 + enableval=$enable_graph_lib; if test "x$enableval" != 'xno'; then : 3198 + as_fn_error $? "The graphics library is no longer distributed with OCaml since version 4.09. It is now distributed as a separate \"graphics\" package: https://github.com/ocaml/graphics" "$LINENO" 5 3199 + fi 3198 3200 fi 3199 3201 3200 3202 ··· 3212 3214 3213 3215 # Check whether --enable-bigarray-lib was given. 3214 3216 if test "${enable_bigarray_lib+set}" = set; then : 3215 - enableval=$enable_bigarray_lib; as_fn_error $? "The bigarray-lib option was deleted in OCaml 5.00, \ 3216 - as the Bigarray module is now part of the standard library." "$LINENO" 5 3217 + enableval=$enable_bigarray_lib; if test "x$enableval" != 'xno'; then : 3218 + as_fn_error $? "The bigarray-lib option was deleted in OCaml 5.00, as the Bigarray module is now part of the standard library." "$LINENO" 5 3219 + fi 3217 3220 fi 3218 3221 3219 3222 ··· 3253 3256 3254 3257 # Check whether --enable-naked-pointers was given. 3255 3258 if test "${enable_naked_pointers+set}" = set; then : 3256 - enableval=$enable_naked_pointers; as_fn_error $? "Naked pointers are not allowed in OCaml Multicore." "$LINENO" 5 3257 - else 3258 - $as_echo "#define NO_NAKED_POINTERS 1" >>confdefs.h 3259 + enableval=$enable_naked_pointers; if test "x$enableval" != 'xno'; then : 3260 + as_fn_error $? "Naked pointers were prohibited in OCaml 5.00." "$LINENO" 5 3261 + fi 3262 + fi 3259 3263 3264 + 3265 + # Check whether --enable-naked-pointers-checker was given. 3266 + if test "${enable_naked_pointers_checker+set}" = set; then : 3267 + enableval=$enable_naked_pointers_checker; if test "x$enableval" != 'xno'; then : 3268 + as_fn_error $? "The naked pointers checker was removed in OCaml 5.00." "$LINENO" 5 3269 + fi 3260 3270 fi 3261 3271 3262 3272 3263 3273 # Check whether --enable-spacetime was given. 3264 3274 if test "${enable_spacetime+set}" = set; then : 3265 - enableval=$enable_spacetime; as_fn_error $? "spacetime profiling was deleted in OCaml 4.12." "$LINENO" 5 3275 + enableval=$enable_spacetime; if test "x$enableval" != 'xno'; then : 3276 + as_fn_error $? "spacetime profiling was deleted in OCaml 4.12." "$LINENO" 5 3277 + fi 3266 3278 fi 3267 3279 3268 3280
+20 -10
configure.ac
··· 259 259 [enable_instrumented_runtime=auto]) 260 260 261 261 AC_ARG_ENABLE([vmthreads], [], 262 - [AC_MSG_ERROR([The vmthreads library is no longer available. \ 263 - It was deleted in OCaml 4.09.])], 262 + [AS_IF([test "x$enableval" != 'xno'], 263 + [AC_MSG_ERROR(m4_normalize([The vmthreads library is no longer available. 264 + It was deleted in OCaml 4.09.]))])], 264 265 []) 265 266 266 267 AC_ARG_ENABLE([systhreads], ··· 268 269 [disable the Win32/POSIX threads library])]) 269 270 270 271 AC_ARG_ENABLE([graph-lib], [], 271 - [AC_MSG_ERROR([The graphics library is no longer distributed with OCaml \ 272 - since version 4.09. It is now distributed as a separate "graphics" package: \ 273 - https://github.com/ocaml/graphics])], 272 + [AS_IF([test "x$enableval" != 'xno'], 273 + [AC_MSG_ERROR(m4_normalize([The graphics library is no longer distributed 274 + with OCaml since version 4.09. It is now distributed as a separate 275 + "graphics" package: https://github.com/ocaml/graphics]))])], 274 276 []) 275 277 276 278 AC_ARG_ENABLE([str-lib], ··· 282 284 [do not build the unix library])]) 283 285 284 286 AC_ARG_ENABLE([bigarray-lib], [], 285 - [AC_MSG_ERROR([The bigarray-lib option was deleted in OCaml 5.00, \ 286 - as the Bigarray module is now part of the standard library.])], 287 + [AS_IF([test "x$enableval" != 'xno'], 288 + [AC_MSG_ERROR(m4_normalize([The bigarray-lib option was deleted in OCaml 289 + 5.00, as the Bigarray module is now part of the standard library.]))])], 287 290 []) 288 291 289 292 AC_ARG_ENABLE([ocamldoc], ··· 310 313 [use frame pointers in runtime and generated code])]) 311 314 312 315 AC_ARG_ENABLE([naked-pointers], [], 313 - [AC_MSG_ERROR([Naked pointers are not allowed in OCaml Multicore.])], 314 - [AC_DEFINE([NO_NAKED_POINTERS])]) 316 + [AS_IF([test "x$enableval" != 'xno'], 317 + [AC_MSG_ERROR([Naked pointers were prohibited in OCaml 5.00.])])], 318 + []) 319 + 320 + AC_ARG_ENABLE([naked-pointers-checker], [], 321 + [AS_IF([test "x$enableval" != 'xno'], 322 + [AC_MSG_ERROR([The naked pointers checker was removed in OCaml 5.00.])])], 323 + []) 315 324 316 325 AC_ARG_ENABLE([spacetime], [], 317 - [AC_MSG_ERROR([spacetime profiling was deleted in OCaml 4.12.])], 326 + [AS_IF([test "x$enableval" != 'xno'], 327 + [AC_MSG_ERROR([spacetime profiling was deleted in OCaml 4.12.])])], 318 328 []) 319 329 320 330 AC_ARG_ENABLE([cfi],
-1
ocamltest/Makefile
··· 272 272 $(call SUBST,CCOMPTYPE) \ 273 273 $(call SUBST,WINDOWS_UNICODE) \ 274 274 $(call SUBST,FUNCTION_SECTIONS) \ 275 - $(call SUBST,NAKED_POINTERS) \ 276 275 $< > $@ 277 276 278 277 # Manual
-7
ocamltest/builtin_actions.ml
··· 181 181 "Target supports function sections" 182 182 "Target does not support function sections") 183 183 184 - let naked_pointers = make 185 - "naked_pointers" 186 - (Actions_helpers.pass_or_skip (Ocamltest_config.naked_pointers) 187 - "Runtime system supports naked pointers" 188 - "Runtime system does not support naked pointers") 189 - 190 184 let has_symlink = make 191 185 "has_symlink" 192 186 (Actions_helpers.pass_or_skip (Unix.has_symlink () ) ··· 308 302 arch_i386; 309 303 arch_power; 310 304 function_sections; 311 - naked_pointers; 312 305 file_exists; 313 306 copy; 314 307 ]
-2
ocamltest/ocamltest_config.ml.in
··· 84 84 let function_sections = %%FUNCTION_SECTIONS%% 85 85 86 86 let instrumented_runtime = %%INSTRUMENTED_RUNTIME%% 87 - 88 - let naked_pointers = %%NAKED_POINTERS%%
-3
ocamltest/ocamltest_config.mli
··· 118 118 119 119 val instrumented_runtime : bool 120 120 (** Whether the instrumented runtime is available *) 121 - 122 - val naked_pointers : bool 123 - (** Whether the runtime system supports naked pointers outside the heap *)
+1 -3
runtime/caml/m.h.in
··· 82 82 83 83 #undef WITH_FRAME_POINTERS 84 84 85 - #undef NO_NAKED_POINTERS 86 - 87 - #undef NAKED_POINTERS_CHECKER 85 + #define NO_NAKED_POINTERS 1 88 86 89 87 #undef WITH_PROFINFO 90 88
+1 -2
stdlib/obj.mli
··· 33 33 (** 34 34 Computes the total size (in words, including the headers) of all 35 35 heap blocks accessible from the argument. Statically 36 - allocated blocks are excluded, unless the runtime system 37 - was configured with [--disable-naked-pointers]. 36 + allocated blocks are included. 38 37 39 38 @since 4.04 40 39 *)
-5
testsuite/tests/asmcomp/is_in_static_data.c
··· 1 - #include "caml/address_class.h" 2 - 3 - value caml_is_in_static_data(value v) { 4 - return(Val_bool(Is_in_static_data(v))); 5 - }
-40
testsuite/tests/asmcomp/is_static.ml
··· 1 - (* TEST 2 - modules = "is_in_static_data.c" 3 - * naked_pointers 4 - ** native 5 - *) 6 - 7 - (* Data that should be statically allocated by the compiler (all versions) *) 8 - 9 - external is_in_static_data : 'a -> bool = "caml_is_in_static_data" 10 - 11 - (* Basic constant blocks should be static *) 12 - let block1 = (1,2) 13 - let () = assert(is_in_static_data block1) 14 - 15 - (* as pattern shouldn't prevent it *) 16 - let (a, b) as block2 = (1,2) 17 - let () = assert(is_in_static_data block2) 18 - 19 - (* Also in functions *) 20 - let f () = 21 - let block = (1,2) in 22 - assert(is_in_static_data block) 23 - 24 - let () = (f [@inlined never]) () 25 - 26 - (* Closed functions should be static *) 27 - let closed_function x = x + 1 (* + is a primitive, it cannot be in the closure*) 28 - let () = assert(is_in_static_data closed_function) 29 - 30 - (* And functions using closed functions *) 31 - let almost_closed_function x = 32 - (closed_function [@inlined never]) x 33 - let () = assert(is_in_static_data almost_closed_function) 34 - 35 - (* Recursive constant functions should be static *) 36 - let rec f1 a = g1 a 37 - and g1 a = f1 a 38 - let () = 39 - assert(is_in_static_data f1); 40 - assert(is_in_static_data g1)
-207
testsuite/tests/asmcomp/is_static_flambda.ml
··· 1 - (* TEST 2 - modules = "is_in_static_data.c is_static_flambda_dep.ml" 3 - * flambda 4 - ** naked_pointers 5 - *** native 6 - *) 7 - 8 - (* Data that should be statically allocated by the compiler (flambda only) *) 9 - 10 - external is_in_static_data : 'a -> bool = "caml_is_in_static_data" 11 - 12 - (* Also after inlining *) 13 - let g x = 14 - let block = (1,x) in 15 - assert(is_in_static_data block) 16 - 17 - let () = (g [@inlined always]) 2 18 - 19 - (* Toplevel immutable blocks should be static *) 20 - let block3 = (Sys.opaque_identity 1, Sys.opaque_identity 2) 21 - let () = assert(is_in_static_data block3) 22 - 23 - (* Not being bound shouldn't prevent it *) 24 - let () = 25 - assert(is_in_static_data (Sys.opaque_identity 1, Sys.opaque_identity 2)) 26 - 27 - (* Only with rounds >= 2 currently ! 28 - (* Also after inlining *) 29 - let h x = 30 - let block = (Sys.opaque_identity 1,x) in 31 - assert(is_in_static_data block) 32 - 33 - let () = (h [@inlined always]) (Sys.opaque_identity 2) 34 - *) 35 - 36 - (* Recursive constant values should be static *) 37 - let rec a = 1 :: b 38 - and b = 2 :: a 39 - let () = 40 - assert(is_in_static_data a); 41 - assert(is_in_static_data b) 42 - 43 - (* And a mix *) 44 - type e = E : 'a -> e 45 - 46 - let rec f1 a = E (g1 a, l1) 47 - and g1 a = E (f1 a, l2) 48 - and l1 = E (f1, l2) 49 - and l2 = E (g1, l1) 50 - 51 - let () = 52 - assert(is_in_static_data f1); 53 - assert(is_in_static_data g1); 54 - assert(is_in_static_data l1); 55 - assert(is_in_static_data l2) 56 - 57 - (* Also in functions *) 58 - let i () = 59 - let rec f1 a = E (g1 a, l1) 60 - and g1 a = E (f1 a, l2) 61 - and l1 = E (f1, l2) 62 - and l2 = E (g1, l1) in 63 - 64 - assert(is_in_static_data f1); 65 - assert(is_in_static_data g1); 66 - assert(is_in_static_data l1); 67 - assert(is_in_static_data l2) 68 - 69 - let () = (i [@inlined never]) () 70 - 71 - module type P = module type of Stdlib 72 - (* Top-level modules should be static *) 73 - let () = assert(is_in_static_data (module Stdlib:P)) 74 - 75 - (* Not constant let rec to test extraction to initialize_symbol *) 76 - let r = ref 0 77 - let rec a = (incr r; !r) :: b 78 - and b = (incr r; !r) :: a 79 - 80 - let next = 81 - let r = ref 0 in 82 - fun () -> incr r; !r 83 - 84 - let () = 85 - assert(is_in_static_data next) 86 - 87 - (* Exceptions without arguments should be static *) 88 - exception No_argument 89 - let () = assert(is_in_static_data No_argument) 90 - 91 - (* And also with constant arguments *) 92 - exception Some_argument of string 93 - let () = assert(is_in_static_data (Some_argument "some string")) 94 - 95 - (* Even when exposed by inlining *) 96 - let () = 97 - let exn = 98 - try (failwith [@inlined always]) "some other string" with exn -> exn 99 - in 100 - assert(is_in_static_data exn) 101 - 102 - (* Verify that approximation intersection correctly loads exported 103 - approximations. 104 - 105 - Is_static_flambda_dep.pair is a pair with 1 as first element. The 106 - intersection of approximations should return a block with 107 - approximation: [tag 0: [tag 0: Int 1, Unknown], Unknown] *) 108 - let f x = 109 - let pair = 110 - if Sys.opaque_identity x then 111 - (1, 2), 3 112 - else 113 - Is_static_flambda_dep.pair, 4 114 - in 115 - let n = fst (fst pair) in 116 - let res = n, n in 117 - assert(is_in_static_data res) 118 - [@@inline never] 119 - 120 - let () = 121 - f true; 122 - f false 123 - 124 - (* Verify that physical equality/inequality is correctly propagated *) 125 - 126 - (* In these tests, tuple can be statically allocated only if it is a 127 - known constant since the function is never inlined (hence this 128 - code is never at toplevel) *) 129 - 130 - let () = 131 - let f () = 132 - let v = (1, 2) in 133 - (* eq is supposed to be considered always true since v is a 134 - constant, hence aliased to a symbol. 135 - It is not yet optimized away if it is not constant *) 136 - let eq = v == v in 137 - let n = if eq then 1 else 2 in 138 - let tuple = (n,n) in 139 - assert(is_in_static_data tuple) 140 - in 141 - (f [@inlined never]) () 142 - 143 - let () = 144 - let f () = 145 - let v = (1, 2) in 146 - (* same with inequality *) 147 - let eq = v != v in 148 - let n = if eq then 1 else 2 in 149 - let tuple = (n,n) in 150 - assert(is_in_static_data tuple) 151 - in 152 - (f [@inlined never]) () 153 - 154 - let () = 155 - let f x = 156 - let v1 = Some x in 157 - let v2 = None in 158 - let eq = v1 == v2 in 159 - (* The values are structurally different, so must be physically 160 - different *) 161 - let n = if eq then 1 else 2 in 162 - let tuple = (n,n) in 163 - assert(is_in_static_data tuple) 164 - in 165 - (f [@inlined never]) () 166 - 167 - let () = 168 - let f x = 169 - let v1 = Some x in 170 - let v2 = None in 171 - let eq = v1 != v2 in 172 - (* same with inequality *) 173 - let n = if eq then 1 else 2 in 174 - let tuple = (n,n) in 175 - assert(is_in_static_data tuple) 176 - in 177 - (f [@inlined never]) () 178 - 179 - let () = 180 - let f x = 181 - let v1 = (1, 2) in 182 - let v2 = (3, 2) in 183 - let eq = v1 == v2 in 184 - (* difference is deeper *) 185 - let n = if eq then 1 else 2 in 186 - let tuple = (n,n) in 187 - assert(is_in_static_data tuple) 188 - in 189 - (f [@inlined never]) () 190 - 191 - module Int = struct 192 - type t = int 193 - let compare (a:int) b = compare a b 194 - end 195 - module IntMap = Map.Make (Int) 196 - 197 - let () = 198 - let f () = 199 - let a = IntMap.empty in 200 - let b = (IntMap.add [@inlined]) 1 (Some 1) a in 201 - assert(is_in_static_data b); 202 - let c = (IntMap.add [@inlined]) 1 (Some 2) b in 203 - assert(is_in_static_data c); 204 - let d = (IntMap.add [@inlined]) 1 (Some 2) c in 205 - assert(is_in_static_data d); 206 - in 207 - (f [@inlined never]) ()
-1
testsuite/tests/asmcomp/is_static_flambda_dep.ml
··· 1 - let pair = 1, 12
-1
testsuite/tests/asmcomp/simple_float_const.ml
··· 1 - let f = 3.14
-1
testsuite/tests/asmcomp/simple_float_const_opaque.ml
··· 1 - let f = 3.14
-26
testsuite/tests/asmcomp/static_float_array_flambda.ml
··· 1 - (* TEST 2 - modules = "is_in_static_data.c simple_float_const.ml" 3 - * flambda 4 - ** flat-float-array 5 - *** naked_pointers 6 - **** native 7 - *) 8 - 9 - external is_in_static_data : 'a -> bool = "caml_is_in_static_data" 10 - 11 - let a = [|0.; 1.|] 12 - let f = 1.23 13 - let b = [|0.; f; f|] 14 - let g = Sys.opaque_identity 1.23 15 - let c = [|0.; g|] 16 - let d = [|0.; Simple_float_const.f|] 17 - 18 - let () = assert(is_in_static_data a) 19 - let () = assert(is_in_static_data f) 20 - let () = assert(is_in_static_data b) 21 - 22 - let () = assert(not (is_in_static_data c)) 23 - (* In fact this one could be static by preallocating the array then 24 - patching it when g is available *) 25 - 26 - let () = assert(is_in_static_data d)
-30
testsuite/tests/asmcomp/static_float_array_flambda_opaque.ml
··· 1 - (* TEST 2 - modules = "is_in_static_data.c simple_float_const_opaque.ml" 3 - flags = "-opaque" 4 - * flambda 5 - ** flat-float-array 6 - *** naked_pointers 7 - **** native 8 - *) 9 - 10 - external is_in_static_data : 'a -> bool = "caml_is_in_static_data" 11 - 12 - let a = [|0.; 1.|] 13 - let f = 1.23 14 - let b = [|0.; f; f|] 15 - let g = Sys.opaque_identity 1.23 16 - let c = [|0.; g|] 17 - let d = [|0.; Simple_float_const_opaque.f|] 18 - 19 - let () = assert(is_in_static_data a) 20 - let () = assert(is_in_static_data f) 21 - let () = assert(is_in_static_data b) 22 - 23 - let () = assert(not (is_in_static_data c)) 24 - (* In fact this one could be static by preallocating the array then 25 - patching it when g is available *) 26 - 27 - let () = assert(not (is_in_static_data d)) 28 - (* The dependency Simple_float_const_opaque is built with opaque, 29 - hence the value of Simple_float_const_opaque.f cannot be known 30 - preventing the static allocation of d *)
-1
utils/Makefile
··· 77 77 $(call SUBST_STRING,RPATH) \ 78 78 $(call SUBST_STRING,MKSHAREDLIBRPATH) \ 79 79 $(call SUBST,WINDOWS_UNICODE) \ 80 - $(call SUBST,NAKED_POINTERS) \ 81 80 $(call SUBST,SUPPORTS_SHARED_LIBRARIES) \ 82 81 $(call SUBST,SYSTEM) \ 83 82 $(call SUBST,SYSTHREAD_SUPPORT) \
+1 -1
utils/config.mlp
··· 84 84 let safe_string = true 85 85 let default_safe_string = true 86 86 let windows_unicode = %%WINDOWS_UNICODE%% != 0 87 - let naked_pointers = %%NAKED_POINTERS%% 87 + let naked_pointers = false 88 88 let force_instrumented_runtime = %%FORCE_INSTRUMENTED_RUNTIME%% 89 89 90 90 let flat_float_array = %%FLAT_FLOAT_ARRAY%%