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.

Add attribute(align()) detection and fix XLC build.

authored by

Konstantin Romanov and committed by
Sébastien Hinderer
d11a60bc 75983ab9

+93 -109
+8
aclocal.m4
··· 86 86 CFLAGS="$saved_CFLAGS" 87 87 ]) 88 88 89 + AC_DEFUN([OCAML_CC_SUPPORTS_ALIGNED], [ 90 + AC_MSG_CHECKING([whether the C compiler supports __attribute__((aligned(n)))]) 91 + AC_COMPILE_IFELSE( 92 + [AC_LANG_SOURCE([typedef struct {__attribute__((aligned(8))) int t;} t;])], 93 + [AC_DEFINE([SUPPORTS_ALIGNED_ATTRIBUTE]) 94 + AC_MSG_RESULT([yes])], 95 + [AC_MSG_RESULT([no])])]) 96 + 89 97 AC_DEFUN([OCAML_CC_HAS_DEBUG_PREFIX_MAP], [ 90 98 AC_MSG_CHECKING([whether the C compiler supports -fdebug-prefix-map]) 91 99 saved_CFLAGS="$CFLAGS"
+66 -101
configure
··· 1 1 #! /bin/sh 2 - 3 - if test -e '.git' ; then : 4 - if test -z "$ac_read_git_config" ; then : 5 - extra_args=$(git config ocaml.configure 2>/dev/null) 6 - extended_cache=$(git config ocaml.configure-cache 2>/dev/null) 7 - cache_file= 8 - 9 - # If ocaml.configure-cache is set, parse the command-line for the --host 10 - # option, in order to determine the name of the cache file. 11 - if test -n "$extended_cache" ; then : 12 - echo "Detected Git configuration option ocaml.configure-cache set to \ 13 - \"$extended_cache\"" 14 - dashdash= 15 - prev= 16 - host=default 17 - # The logic here is pretty borrowed from autoconf's 18 - for option in $extra_args "$@" 19 - do 20 - if test -n "$prev" ; then : 21 - host=$option 22 - continue 23 - fi 24 - 25 - case $dashdash$option in 26 - --) 27 - dashdash=yes ;; 28 - -host | --host | --hos | --ho) 29 - prev=host ;; 30 - -host=* | --host=* | --hos=* | --ho=*) 31 - case $option in 32 - *=?*) host=$(expr "X$option" : '[^=]*=\(.*\)') ;; 33 - *=) host= ;; 34 - esac ;; 35 - esac 36 - done 37 - cache_file="`dirname "$0"`/$extended_cache/ocaml-$host.cache" 38 - fi 39 - 40 - # If either option has a value, re-invoke configure 41 - if test -n "$extra_args$cache_file" ; then : 42 - echo "Detected Git configuration option ocaml.configure set to \ 43 - \"$extra_args\"" 44 - # Too much effort to get the echo to show appropriate quoting - the 45 - # invocation itself intentionally quotes $0 and passes $@ exactly as given 46 - # but allows a single expansion of ocaml.configure 47 - if test -n "$cache_file" ; then : 48 - echo "Re-running $0 $extra_args --cache-file \"$cache_file\" $@" 49 - ac_read_git_config=true exec "$0" $extra_args \ 50 - --cache-file "$cache_file" "$@" 51 - else 52 - echo "Re-running $0 $extra_args $@" 53 - ac_read_git_config=true exec "$0" $extra_args "$@" 54 - fi 55 - fi 56 - fi 57 - fi 58 2 # Guess values for system-dependent variables and create Makefiles. 59 3 # Generated by GNU Autoconf 2.69 for OCaml 4.11.0+dev0-2019-10-18. 60 4 # ··· 12291 12235 ;; 12292 12236 esac 12293 12237 12238 + ## Find vendor of the C compiler 12239 + 12240 + 12241 + 12242 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler vendor" >&5 12243 + $as_echo_n "checking C compiler vendor... " >&6; } 12244 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12245 + /* end confdefs.h. */ 12246 + 12247 + #if defined(_MSC_VER) 12248 + msvc _MSC_VER 12249 + #elif defined(__INTEL_COMPILER) 12250 + icc __INTEL_COMPILER 12251 + #elif defined(__clang_major__) && defined(__clang_minor__) 12252 + clang __clang_major__ __clang_minor__ 12253 + #elif defined(__GNUC__) && defined(__GNUC_MINOR__) 12254 + gcc __GNUC__ __GNUC_MINOR__ 12255 + #elif defined(__xlc__) && defined(__xlC__) 12256 + xlc __xlC__ __xlC_ver__ 12257 + #else 12258 + unknown 12259 + #endif 12260 + 12261 + _ACEOF 12262 + if ac_fn_c_try_cpp "$LINENO"; then : 12263 + if ${ocaml_cv_cc_vendor+:} false; then : 12264 + $as_echo_n "(cached) " >&6 12265 + else 12266 + ocaml_cv_cc_vendor=`grep '^[a-z]' conftest.i | tr -s ' ' '-'` 12267 + fi 12268 + 12269 + else 12270 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 12271 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 12272 + as_fn_error $? "unexpected preprocessor failure 12273 + See \`config.log' for more details" "$LINENO" 5; } 12274 + fi 12275 + rm -f conftest.err conftest.i conftest.$ac_ext 12276 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_cc_vendor" >&5 12277 + $as_echo "$ocaml_cv_cc_vendor" >&6; } 12278 + 12279 + 12294 12280 # Determine how to call the C preprocessor directly. 12295 12281 # Most of the time, calling the C preprocessor through the C compiler is 12296 12282 # desirable and even important. ··· 12302 12288 # We thus figure out how to invoke the C preprocessor directly but 12303 12289 # let the CPP variable untouched, except for the MSVC port where we set it 12304 12290 # manually to make sure the backward compatibility is preserved 12305 - case $host in #( 12306 - *-pc-windows) : 12291 + case $ocaml_cv_cc_vendor in #( 12292 + xlc-*) : 12293 + CPP="$CC -E -qnoppline" ;; #( 12294 + # suppress incompatible XLC line directives 12295 + msvc-*) : 12307 12296 CPP="$CC -nologo -EP" ;; #( 12308 12297 *) : 12309 12298 ;; ··· 12407 12396 ## Check for C99 support: done by libtool 12408 12397 ## AC_PROG_CC_C99 12409 12398 12410 - ## Find vendor of the C compiler 12411 - 12412 - 12413 - 12414 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler vendor" >&5 12415 - $as_echo_n "checking C compiler vendor... " >&6; } 12416 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext 12417 - /* end confdefs.h. */ 12418 - 12419 - #if defined(_MSC_VER) 12420 - msvc _MSC_VER 12421 - #elif defined(__INTEL_COMPILER) 12422 - icc __INTEL_COMPILER 12423 - #elif defined(__clang_major__) && defined(__clang_minor__) 12424 - clang __clang_major__ __clang_minor__ 12425 - #elif defined(__GNUC__) && defined(__GNUC_MINOR__) 12426 - gcc __GNUC__ __GNUC_MINOR__ 12427 - #elif defined(__xlc__) && defined(__xlC__) 12428 - xlc __xlC__ __xlC_ver__ 12429 - #else 12430 - unknown 12431 - #endif 12432 - 12433 - _ACEOF 12434 - if ac_fn_c_try_cpp "$LINENO"; then : 12435 - if ${ocaml_cv_cc_vendor+:} false; then : 12436 - $as_echo_n "(cached) " >&6 12437 - else 12438 - ocaml_cv_cc_vendor=`grep '^[a-z]' conftest.i | tr -s ' ' '-'` 12439 - fi 12440 - 12441 - else 12442 - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 12443 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 12444 - as_fn_error $? "unexpected preprocessor failure 12445 - See \`config.log' for more details" "$LINENO" 5; } 12446 - fi 12447 - rm -f conftest.err conftest.i conftest.$ac_ext 12448 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ocaml_cv_cc_vendor" >&5 12449 - $as_echo "$ocaml_cv_cc_vendor" >&6; } 12450 - 12451 - 12452 12399 ## Determine which flags to use for the C compiler 12453 12400 12454 12401 case $ocaml_cv_cc_vendor in #( ··· 12456 12403 outputobj='-o $(EMPTY)'; gcc_warnings="-qflag=i:i" ;; #( 12457 12404 # all warnings enabled 12458 12405 msvc-*) : 12459 - outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings="" ;; #( 12406 + outputobj=-Fo; gcc_warnings="" ;; #( 12460 12407 *) : 12461 12408 outputobj='-o $(EMPTY)'; case 4.11.0+dev0-2019-10-18 in #( 12462 12409 *+dev*) : ··· 13541 13488 *) : 13542 13489 ;; 13543 13490 esac 13491 + 13492 + 13493 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler supports __attribute__((aligned(n)))" >&5 13494 + $as_echo_n "checking whether the C compiler supports __attribute__((aligned(n)))... " >&6; } 13495 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 13496 + /* end confdefs.h. */ 13497 + typedef struct {__attribute__((aligned(8))) int t;} t; 13498 + _ACEOF 13499 + if ac_fn_c_try_compile "$LINENO"; then : 13500 + $as_echo "#define SUPPORTS_ALIGNED_ATTRIBUTE 1" >>confdefs.h 13501 + 13502 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 13503 + $as_echo "yes" >&6; } 13504 + else 13505 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 13506 + $as_echo "no" >&6; } 13507 + fi 13508 + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 13544 13509 13545 13510 # Configure the native-code compiler 13546 13511
+10 -6
configure.ac
··· 436 436 mklib="rm -f \$(1) && ${AR} rc \$(1) \$(2) && ${RANLIB} \$(1)" 437 437 ]) 438 438 439 + ## Find vendor of the C compiler 440 + OCAML_CC_VENDOR 441 + 439 442 # Determine how to call the C preprocessor directly. 440 443 # Most of the time, calling the C preprocessor through the C compiler is 441 444 # desirable and even important. ··· 447 450 # We thus figure out how to invoke the C preprocessor directly but 448 451 # let the CPP variable untouched, except for the MSVC port where we set it 449 452 # manually to make sure the backward compatibility is preserved 450 - AS_CASE([$host], 451 - [*-pc-windows], 453 + AS_CASE([$ocaml_cv_cc_vendor], 454 + [xlc-*], 455 + [CPP="$CC -E -qnoppline"], # suppress incompatible XLC line directives 456 + [msvc-*], 452 457 [CPP="$CC -nologo -EP"]) 453 458 454 459 # Libraries to build depending on the host ··· 513 518 ## Check for C99 support: done by libtool 514 519 ## AC_PROG_CC_C99 515 520 516 - ## Find vendor of the C compiler 517 - OCAML_CC_VENDOR 518 - 519 521 ## Determine which flags to use for the C compiler 520 522 521 523 AS_CASE([$ocaml_cv_cc_vendor], 522 524 [xlc-*], 523 525 [outputobj='-o $(EMPTY)'; gcc_warnings="-qflag=i:i"], # all warnings enabled 524 526 [msvc-*], 525 - [outputobj=-Fo; CPP="cl -nologo -EP"; gcc_warnings=""], 527 + [outputobj=-Fo; gcc_warnings=""], 526 528 [outputobj='-o $(EMPTY)'; AS_CASE([AC_PACKAGE_VERSION], 527 529 [*+dev*], 528 530 [gcc_warnings="-Wall -Werror"], ··· 842 844 [OCAML_CC_HAS_FNO_TREE_VRP 843 845 AS_IF([$cc_has_fno_tree_vrp], 844 846 [internal_cflags="$internal_cflags -fno-tree-vrp"])]) 847 + 848 + OCAML_CC_SUPPORTS_ALIGNED 845 849 846 850 # Configure the native-code compiler 847 851
+2
runtime/caml/m.h.in
··· 104 104 #undef FLAT_FLOAT_ARRAY 105 105 106 106 #undef FUNCTION_SECTIONS 107 + 108 + #undef SUPPORTS_ALIGNED_ATTRIBUTE
+7 -2
runtime/caml/misc.h
··· 95 95 #define CAMLweakdef 96 96 #endif 97 97 98 - /* Alignment */ 99 - #ifdef __GNUC__ 98 + /* Alignment is necessary for domain_state.h, since the code generated */ 99 + /* by ocamlopt makes direct references into the domain state structure,*/ 100 + /* which is stored in a register on many platforms. For this to work, */ 101 + /* we need to be able to compute the exact offset of each member. */ 102 + #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L 103 + #define CAMLalign(n) _Alignas(n) 104 + #elif defined(SUPPORTS_ALIGNED_ATTRIBUTE) 100 105 #define CAMLalign(n) __attribute__((aligned(n))) 101 106 #elif _MSC_VER >= 1500 102 107 #define CAMLalign(n) __declspec(align(n))