configure.ac 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
  2. # Local configure fragment for sysdeps/aarch64.
  3. # Static PIE is supported.
  4. AC_DEFINE(SUPPORT_STATIC_PIE)
  5. # We check to see if the compiler and flags are
  6. # selecting the big endian ABI and if they are then
  7. # we set libc_cv_aarch64_be to yes which causes
  8. # HAVE_AARCH64_BE to be defined in config.h and
  9. # in include/libc-symbols.h and thus available to
  10. # shlib-versions to select the appropriate name for
  11. # the dynamic linker via %ifdef.
  12. AC_CACHE_CHECK([for big endian],
  13. [libc_cv_aarch64_be],
  14. [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
  15. yes
  16. #endif
  17. ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
  18. if test $libc_cv_aarch64_be = yes; then
  19. AC_DEFINE(HAVE_AARCH64_BE)
  20. LIBC_CONFIG_VAR([default-abi], [lp64_be])
  21. else
  22. LIBC_CONFIG_VAR([default-abi], [lp64])
  23. fi
  24. if test x"$build_mathvec" = xnotset; then
  25. build_mathvec=yes
  26. fi
  27. if test $build_mathvec = no; then
  28. AC_MSG_WARN([mathvec is disabled, this results in incomplete ABI.])
  29. fi
  30. libc_cv_support_sframe=yes
  31. # Check if compilers support BTI in branch protection:
  32. LIBC_TRY_CC_AND_TEST_CC_OPTION(
  33. [if compiler supports -mbranch-protection=bti],
  34. [-Werror -mbranch-protection=bti],
  35. libc_cv_cc_bti,
  36. [libc_cv_cc_bti=yes],
  37. [libc_cv_cc_bti=no],
  38. libc_cv_test_cc_bti,
  39. [libc_cv_test_cc_bti=yes],
  40. [libc_cv_test_cc_bti=no]
  41. )
  42. # Check if linker supports BTI marking
  43. LIBC_LINKER_FEATURE(
  44. [-z force-bti], [-Wl,-z,force-bti],
  45. [libc_cv_ld_bti=yes], [libc_cv_ld_bti=no]
  46. )
  47. # Check if toolchain is enabled to support BTI
  48. LIBC_CHECK_ELF_PROPERTY(
  49. [if toolchain is enabled to support BTI],
  50. [AArch64 feature: .*BTI],
  51. [libc_cv_bti_supported=yes],
  52. [libc_cv_bti_supported=no]
  53. )
  54. if test $libc_cv_cc_bti = yes && \
  55. test $libc_cv_test_cc_bti = yes && \
  56. test $libc_cv_ld_bti = yes && \
  57. test $libc_cv_bti_supported = yes
  58. then
  59. LIBC_CONFIG_VAR([have-test-bti], [yes])
  60. else
  61. LIBC_CONFIG_VAR([have-test-bti], [no])
  62. fi
  63. # Check if compilers support GCS in branch protection:
  64. LIBC_TRY_CC_AND_TEST_CC_OPTION(
  65. [if compiler supports -mbranch-protection=gcs],
  66. [-Werror -mbranch-protection=gcs],
  67. libc_cv_cc_gcs,
  68. [libc_cv_cc_gcs=yes],
  69. [libc_cv_cc_gcs=no],
  70. libc_cv_test_cc_gcs,
  71. [libc_cv_test_cc_gcs=yes],
  72. [libc_cv_test_cc_gcs=no]
  73. )
  74. # Check if linker supports GCS marking
  75. LIBC_LINKER_FEATURE(
  76. [-z gcs=always], [-Wl,-z,gcs=always],
  77. [libc_cv_ld_gcs=yes], [libc_cv_ld_gcs=no]
  78. )
  79. # Check if toolchain is enabled to support GCS
  80. LIBC_CHECK_ELF_PROPERTY(
  81. [if toolchain is enabled to support GCS],
  82. [AArch64 feature: .*GCS],
  83. [libc_cv_gcs_supported=yes],
  84. [libc_cv_gcs_supported=no]
  85. )
  86. if test $libc_cv_cc_gcs = yes && \
  87. test $libc_cv_test_cc_gcs = yes && \
  88. test $libc_cv_ld_gcs = yes && \
  89. test $libc_cv_gcs_supported = yes
  90. then
  91. LIBC_CONFIG_VAR([have-test-gcs], [yes])
  92. else
  93. LIBC_CONFIG_VAR([have-test-gcs], [no])
  94. fi