[PATCH 0/3] perf: Fix missing CET property notes on x86 with -fcf-protection
From: Trevor Allison
Date: Wed Jul 08 2026 - 00:57:14 EST
When perf is built with -fcf-protection, the x86 binary can lack CET
(IBT/SHSTK) in .note.gnu.property because perf links several static
archives whole-archive: if any input object lacks matching property
notes, the linker drops CET from the final binary.
Fix libbpf EXTRA_CFLAGS handling, C++ flag propagation, and missing
.note.gnu.property sections in x86 assembly (like .note.GNU-stack).
All three are needed for CET to survive the link.
Trevor Allison (3):
perf build: Preserve EXTRA_CFLAGS when building in-tree libbpf
perf build: Apply EXTRA_CXXFLAGS to C++ builds
perf x86: Add .note.gnu.property to assembly linked into perf
tools/perf/Makefile.config | 1 +
tools/perf/Makefile.perf | 2 +-
tools/perf/arch/x86/tests/regs_load.S | 24 ++++++++++++++++++++++++
tools/perf/bench/mem-memcpy-x86-64-asm.S | 24 ++++++++++++++++++++++++
tools/perf/bench/mem-memset-x86-64-asm.S | 24 ++++++++++++++++++++++++
5 files changed, 74 insertions(+), 1 deletion(-)
--
2.50.1 (Apple Git-155)