summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuta Saito <kateinoigakukun@gmail.com>2024-02-05 23:50:20 +0900
committerGitHub <noreply@github.com>2024-02-05 14:50:20 +0000
commit7f97e3540ce448b501bcbee15afac5f94bb22dd9 (patch)
tree81423fc0db5fee1f214fd14b0aab946ddbc2a1d6
parent288d84d827da6cb8a56ed614a9839a06488986c0 (diff)
[Backport 3.3] [Bug #20085] Use consistent default options for `-mbranch-protection` (#9385)
[Bug #20085] Use consistent default options for `-mbranch-protection` We need to use the same options for both C compiler and assembler when `-mbranch-protection` is guessed by configure. Otherwise, `coroutine/arm64/Context.{h,S}` will use incompatible PAC strategies.
-rw-r--r--configure.ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9286946fc1..18b4247991 100644
--- a/configure.ac
+++ b/configure.ac
@@ -830,7 +830,10 @@ AS_IF([test "$GCC" = yes], [
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], [
+ # C compiler and assembler must be consistent for -mbranch-protection
+ # since they both check `__ARM_FEATURE_PAC_DEFAULT` definition.
RUBY_APPEND_OPTION(XCFLAGS, option)
+ RUBY_APPEND_OPTION(ASFLAGS, option)
break
])
])