summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremiah Gowdy <[email protected]>2022-06-16 10:29:28 -0700
committerNobuyoshi Nakada <[email protected]>2022-06-17 11:58:10 +0900
commit1dfe007e1696128ff0d3ec78e54d3406073f7727 (patch)
tree12790eebd4e2cd5c6d31ea0173655a20c9c9eee1
parentf3b54d5fc236d01c0e34650b797820e4b09e2a41 (diff)
Update configure.ac
Co-authored-by: Nobuyoshi Nakada <[email protected]>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6025
-rw-r--r--configure.ac13
1 files changed, 5 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index ef3f521a6d..7bfc2a03ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -782,14 +782,11 @@ AS_IF([test "$GCC" = yes], [
# aarch64 branch protection
AS_CASE(["$target_cpu"], [aarch64], [
- branch_protection=no
- RUBY_TRY_CFLAGS(-mbranch-protection=pac-ret,[branch_protection=yes])
- AS_IF([test "x$branch_protection" = xyes], [
- RUBY_APPEND_OPTION(XCFLAGS, -mbranch-protection=pac-ret)
- ],
- [
- RUBY_TRY_CFLAGS(-msign-return-address=all, [
- RUBY_APPEND_OPTION(XCFLAGS, -msign-return-address=all)
+ AS_FOR(option, opt, [-mbranch-protection=pac-ret -msign-return-address=all], [
+ RUBY_TRY_CFLAGS(option, [branch_protection=yes], [branch_protection=no])
+ AS_IF([test "x$branch_protection" = xyes], [
+ RUBY_APPEND_OPTION(XCFLAGS, option)
+ break
])
])
])