Skip to content

Commit 61a6c3b

Browse files
committed
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.
1 parent 04265ba commit 61a6c3b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,11 @@ if test "$use_hardening" != "no"; then
964964
;;
965965
esac
966966

967+
case $host in
968+
*aarch64*)
969+
AX_CHECK_COMPILE_FLAG([-mbranch-protection=bti], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -mbranch-protection=bti"])
970+
;;
971+
esac
967972

968973
dnl When enable_debug is yes, all optimizations are disabled.
969974
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.

0 commit comments

Comments
 (0)