4 Commits
Author SHA1 Message Date
Khem Raj 804d00b5ba bpftrace: define _GNU_SOURCE for pthread_setname_np in testprogs
A test program uses pthread_setname_np(), a GNU extension that needs
_GNU_SOURCE defined before <pthread.h> is included to be declared.

AI-Generated: Uses Claude Code

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-29 09:57:23 -07:00
Khem Raj 287c705fb2 bpftrace: Keep -fcanon-prefix-map away from the build host gcc
cmake/BuildBPF.cmake compiles the BPF data source with the plain gcc it
finds in PATH (find_program(GCC gcc)) rather than with the cross
compiler, because the BTF encoding step needs gcc plus pahole. The
recipe exports DEBUG_PREFIX_MAP and
0001-cmake-BuildBPF.cmake-introduce-DEBUG_PREFIX_MAP.patch hands it to
that command so the embedded objects do not carry build paths.

DEBUG_PREFIX_MAP also picks up DEBUG_PREFIX_MAP_EXTRA, which is
-fcanon-prefix-map for the gcc toolchain
(meta/classes/toolchain/gcc.bbclass). That option only exists in
GCC >= 13: the cross compiler always has it, the build host's gcc may
not, and the ptest enabled build then fails with

  gcc: error: unrecognized command-line option '-fcanon-prefix-map';
       did you mean '-fmacro-prefix-map='?

Drop it, the way frr and kernel-selftest already do for the same reason.
The four -ffile-prefix-map= rewrites are all this needs: with the extra
removed tests/data/data_source.o still contains no build paths, only
/usr/src/debug/bpftrace/0.26.1.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-09-12 16:52:17 -07:00
Khem Raj bd648b6cb4 bpftrace: Fix tests to cross compile
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-07 19:01:29 -07:00
Khem Raj 3319a20a86 bpftrace: Upgrade to 0.26.1
Fix build with LLVM 23

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-07 19:01:28 -07:00