Skip to content

Commit 9e068f9

Browse files
committed
Merge bitcoin/bitcoin#28459: build: add -mbranch-protection=bti (aarch64) to hardening flags
61a6c3b build: add `-mbranch-protection=bti` to aarch64 hardening flags (fanquake) Pull request description: This is a simpler (less hardening) version of bitcoin/bitcoin#24123. You can inspect binaries using `readelf -n`, and look for BTI in a `.note.gnu.property`. i.e ```bash readelf -n src/bitcoin-cli Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010NT_GNU_PROPERTY_TYPE_0 Properties: AArch64 feature: BTI ``` Related to bitcoin/bitcoin#19075. ACKs for top commit: TheCharlatan: utACK 61a6c3b Tree-SHA512: 64504de44e91d853165daf4111dca905d8eb9ef3f4bfb0d447c677b02c9100dbd56f13e6fe6539fb06c2343a094229591ac5d1bd9e184b32b512c0ac3f9bac36
2 parents 504f1f3 + 61a6c3b commit 9e068f9

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)