The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/3] perf: Fix missing CET property notes on x86 with -fcf-protection
@ 2026-07-08  4:56 Trevor Allison
  2026-07-08  4:56 ` [PATCH 1/3] perf build: Preserve EXTRA_CFLAGS when building in-tree libbpf Trevor Allison
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Trevor Allison @ 2026-07-08  4:56 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung
  Cc: mark.rutland, alexander.shishkin, jolsa, irogers, adrian.hunter,
	james.clark, tallison, linux-perf-users, linux-kernel

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-08  4:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  4:56 [PATCH 0/3] perf: Fix missing CET property notes on x86 with -fcf-protection Trevor Allison
2026-07-08  4:56 ` [PATCH 1/3] perf build: Preserve EXTRA_CFLAGS when building in-tree libbpf Trevor Allison
2026-07-08  4:56 ` [PATCH 2/3] perf build: Apply EXTRA_CXXFLAGS to C++ builds Trevor Allison
2026-07-08  4:56 ` [PATCH 3/3] perf x86: Add .note.gnu.property to assembly linked into perf Trevor Allison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox