aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-11-18 14:12:47 +0800
committerfanquake <fanquake@gmail.com>2023-10-10 14:08:27 +0100
commit61a6c3b0e9a8dab5c5f845af4becde817539133c (patch)
tree9c72a4058793d961c2c926cf8904d0c5696e978b /configure.ac
parent04265ba9378efbd4c35b33390b1e5cf246d420a9 (diff)
downloadbitcoin-61a6c3b0e9a8dab5c5f845af4becde817539133c.tar.xz
build: add `-mbranch-protection=bti` to aarch64 hardening flags
This is a simpler (less hardening) version of #24123. Scoped to aarch64 to avoid unused command line option warnings when building on x86_64. Related to #19075.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9b4b9bd42b..20358205ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -964,6 +964,11 @@ if test "$use_hardening" != "no"; then
;;
esac
+ case $host in
+ *aarch64*)
+ AX_CHECK_COMPILE_FLAG([-mbranch-protection=bti], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -mbranch-protection=bti"])
+ ;;
+ esac
dnl When enable_debug is yes, all optimizations are disabled.
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.