Skip to content

perf: Fix missing CET property notes on x86 with -fcf-protection

Trevor Allison linux-perf-users lkml sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3perf build: Preserve EXTRA_CFLAGS when building in-tree libbpftools/perf/Makefile.perf+1 -10 replies
2/3perf build: Apply EXTRA_CXXFLAGS to C++ buildstools/perf/Makefile.config+1 -00 replies
3/3perf x86: Add .note.gnu.property to assembly linked into perftools/perf/arch/x86/tests/regs_load.S tools/perf/bench/mem-memcpy-x86-64-asm.S tools/perf/bench/mem-memset-x86-64-asm.S+72 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] perf: Fix missing CET property notes on x86 with -fcf-protection

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(-)
Signature · 1 line
2.50.1 (Apple Git-155)