@@ -1006,58 +1006,6 @@ AC_SUBST(incflags, "$INCFLAGS")
1006
1006
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ARCH_FLAG\""
1007
1007
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\""
1008
1008
1009
- # The lines above expand out the $cflags/$optflags/$debugflags/$hardenflags variables into the
1010
- # CFLAGS variable. So, at this point, we have a $CFLAGS var with the actual compiler flags we're
1011
- # going to use.
1012
- # That means this is the right time to check what branch protection flags are going to be in use
1013
- # and define appropriate macros for use in Context.S based on this
1014
- AS_CASE ( [ "$target_cpu"] , [ aarch64] , [
1015
- AC_CACHE_CHECK ( [ whether __ARM_FEATURE_BTI_DEFAULT is defined] ,
1016
- rb_cv_aarch64_bti_enabled ,
1017
- AC_COMPILE_IFELSE (
1018
- [ AC_LANG_PROGRAM ( [ [
1019
- @%:@ ifndef __ARM_FEATURE_BTI_DEFAULT
1020
- @%:@ error "__ARM_FEATURE_BTI_DEFAULT not defined"
1021
- @%:@ endif
1022
- ] ] ) ] ,
1023
- [ rb_cv_aarch64_bti_enabled=yes] ,
1024
- [ rb_cv_aarch64_bti_enabled=no] )
1025
- )
1026
- AS_IF ( [ test "$rb_cv_aarch64_bti_enabled" = yes] ,
1027
- AC_DEFINE ( RUBY_AARCH64_BTI_ENABLED , 1 ) )
1028
- AC_CACHE_CHECK ( [ whether __ARM_FEATURE_PAC_DEFAULT is defined] ,
1029
- rb_cv_aarch64_pac_enabled ,
1030
- AC_COMPILE_IFELSE (
1031
- [ AC_LANG_PROGRAM ( [ [
1032
- @%:@ ifndef __ARM_FEATURE_PAC_DEFAULT
1033
- @%:@ error "__ARM_FEATURE_PAC_DEFAULT not defined"
1034
- @%:@ endif
1035
- ] ] ) ] ,
1036
- [ rb_cv_aarch64_pac_enabled=yes] ,
1037
- [ rb_cv_aarch64_pac_enabled=no] )
1038
- )
1039
- AS_IF ( [ test "$rb_cv_aarch64_pac_enabled" = yes] ,
1040
- AC_DEFINE ( RUBY_AARCH64_PAC_ENABLED , 1 ) )
1041
- # Context.S will only ever sign its return address with the A-key; it doesn't support
1042
- # the B-key at the moment.
1043
- AS_IF ( [ test "$rb_cv_aarch64_pac_enabled" = yes] , [
1044
- AC_CACHE_CHECK ( [ whether __ARM_FEATURE_PAC_DEFAULT specifies the b-key bit 0x02] ,
1045
- rb_cv_aarch64_pac_b_key ,
1046
- AC_COMPILE_IFELSE (
1047
- [ AC_LANG_PROGRAM ( [ [
1048
- @%:@ ifdef __ARM_FEATURE_PAC_DEFAULT
1049
- @%:@ if __ARM_FEATURE_PAC_DEFAULT & 0x02
1050
- @%:@ error "__ARM_FEATURE_PAC_DEFAULT specifies B key"
1051
- @%:@ endif
1052
- @%:@ endif
1053
- ] ] ) ] ,
1054
- [ rb_cv_aarch64_pac_b_key=no] ,
1055
- [ rb_cv_aarch64_pac_b_key=yes] )
1056
- )
1057
- AS_IF ( [ test "$rb_cv_aarch64_pac_b_key" = yes] ,
1058
- AC_MSG_ERROR ( - mbranch-protection flag specified b-key but Ruby's Context.S does not support this yet. ) )
1059
- ] )
1060
- ] )
1061
1009
1062
1010
AC_CACHE_CHECK ( [ whether compiler has statement and declarations in expressions] ,
1063
1011
rb_cv_have_stmt_and_decl_in_expr ,
0 commit comments