@@ -26,7 +26,7 @@ Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
--- a/tests/testprogs/CMakeLists.txt
+++ b/tests/testprogs/CMakeLists.txt
-@@ -17,6 +17,23 @@ test_and_add_testprog_cflag("-fno-omit-f
+@@ -17,6 +17,23 @@
test_and_add_testprog_cflag("-mno-omit-leaf-frame-pointer")
get_property(testprog_cflags GLOBAL PROPERTY testprog_cflags)
@@ -50,7 +50,7 @@ Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
file(GLOB testprog_sources CONFIGURE_DEPENDS *.c *.cpp)
set(testprogtargets "")
function(testprog_compile is_pie)
-@@ -85,7 +102,7 @@ endif()
+@@ -85,7 +102,7 @@
find_program(LLVM_OBJCOPY llvm-objcopy REQUIRED)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/false.bin
@@ -59,7 +59,7 @@ Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
COMMAND ${LLVM_OBJCOPY} -S --only-section=.text --keep-symbol=main -O binary ${CMAKE_CURRENT_BINARY_DIR}/false.o ${CMAKE_CURRENT_BINARY_DIR}/false.bin
COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_BINARY_DIR}/false.o
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-@@ -147,7 +164,7 @@ add_custom_command(
+@@ -147,7 +164,7 @@
OUTPUT
${EXTERNAL_DEBUG_DIR}/dwo/uprobe_test-split
${EXTERNAL_DEBUG_DIR}/dwo/uprobe_test-split-uprobe_test.dwo
@@ -68,12 +68,12 @@ Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
)
list(APPEND testprogtargets ${EXTERNAL_DEBUG_DIR}/dwo/uprobe_test-split)
-@@ -159,7 +176,7 @@ add_custom_command(
- OUTPUT
- ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
- ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
-- COMMAND ${CMAKE_C_COMPILER} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
-+ COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split ${testprog_raw_ld_flags}
- COMMAND ${LLVM_DWP} -e ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
- COMMAND ${CMAKE_COMMAND} -E rm -f ${EXTERNAL_DEBUG_DIR}/dwp/*.dwo
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
+@@ -165,7 +182,7 @@
+ OUTPUT
+ ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
+ ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
+- COMMAND ${CMAKE_C_COMPILER} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
++ COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split ${testprog_raw_ld_flags}
+ COMMAND ${LLVM_DWP} -e ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
+ COMMAND ${CMAKE_COMMAND} -E rm -f ${EXTERNAL_DEBUG_DIR}/dwp/*.dwo
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
deleted file mode 100644
@@ -1,38 +0,0 @@
-From d09a791bb88c69c34dd2e294213ed2a47568267f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Viktor=20Mal=C3=ADk?= <viktor.malik@gmail.com>
-Date: Tue, 18 Aug 2026 21:47:37 +0200
-Subject: [PATCH] IRBuilderBPF: Fix HasTerminator on LLVM 23 (#5298)
-
-LLVM 23 changed the implementation of BasicBlock::getTerminator(), which
-now doesn't check that a basic block actually has a terminator and
-should only be called after a successful BasicBlock::hasTerminator()
-check. Add the check to IRBuilderBPF::HasTerminator() for LLVM 23.
-
-Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
-
-Upstream-Status: Backport [https://github.com/bpftrace/bpftrace/commit/d09a791bb88c69c34dd2e294213ed2a47568267f]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/ast/irbuilderbpf.cpp | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp
-index fb94f9bdde6b..2a2ac6209c19 100644
---- a/src/ast/irbuilderbpf.cpp
-+++ b/src/ast/irbuilderbpf.cpp
-@@ -2512,7 +2512,13 @@ llvm::Value *IRBuilderBPF::CreateCheckedBinop(Binop &binop,
- bool IRBuilderBPF::HasTerminator()
- {
- BasicBlock *current_block = GetInsertBlock();
-- return current_block && current_block->getTerminator();
-+ if (!current_block)
-+ return false;
-+#if LLVM_VERSION_MAJOR >= 23
-+ if (!current_block->hasTerminator())
-+ return false;
-+#endif
-+ return current_block->getTerminator();
- }
-
- } // namespace bpftrace::ast
deleted file mode 100644
@@ -1,36 +0,0 @@
-From f0768d0a3d08b4ba7fbc85f874fbe905cd4a6880 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Viktor=20Mal=C3=ADk?= <viktor.malik@gmail.com>
-Date: Wed, 19 Aug 2026 09:25:25 +0200
-Subject: [PATCH] Add support for LLVM 23 (#5299)
-
-- Bump MAX_LLVM_MAJOR
-- Add new Nix targets
-- Bump BCC version to the commit fixing LLVM 23 build
-- Adjust CI jobs
-
-Also drop support for LLVM 18. Since the Nix fuzz shell depended on LLVM
-18, move that to 22.
-
-Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
-
-Only the CMakeLists.txt hunk is backported here; the Nix and CI changes of
-the original commit do not apply to an OE build, and the BCC bump is
-handled by the bcc recipe.
-
-Upstream-Status: Backport [https://github.com/bpftrace/bpftrace/commit/f0768d0a3d08b4ba7fbc85f874fbe905cd4a6880]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index baea14e65c60..a781bf347d61 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -156,7 +156,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- # releases.
- set(MAX_LLVM_MAJOR 999)
- else()
-- set(MAX_LLVM_MAJOR 22)
-+ set(MAX_LLVM_MAJOR 23)
- endif()
-
- if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
@@ -24,11 +24,9 @@ Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
tests/testprogs/CMakeLists.txt | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
-diff --git a/tests/testprogs/CMakeLists.txt b/tests/testprogs/CMakeLists.txt
-index 4cc9967..2b407b7 100644
--- a/tests/testprogs/CMakeLists.txt
+++ b/tests/testprogs/CMakeLists.txt
-@@ -160,11 +160,16 @@ list(APPEND testprogtargets
+@@ -160,11 +160,16 @@
${CMAKE_CURRENT_BINARY_DIR}/.debug/uprobe_separate_debug-stripped.debug)
# Build a binary with split DWARF (.dwo files) to verify parsing of the split debug info format.
@@ -46,16 +44,16 @@ index 4cc9967..2b407b7 100644
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
)
list(APPEND testprogtargets ${EXTERNAL_DEBUG_DIR}/dwo/uprobe_test-split)
-@@ -176,9 +181,10 @@ add_custom_command(
- OUTPUT
- ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
- ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
-- COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split ${testprog_raw_ld_flags}
-- COMMAND ${LLVM_DWP} -e ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
-+ COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o uprobe_test-split ${testprog_raw_ld_flags}
-+ COMMAND ${LLVM_DWP} -e uprobe_test-split -o uprobe_test-split.dwp
- COMMAND ${CMAKE_COMMAND} -E rm -f ${EXTERNAL_DEBUG_DIR}/dwp/*.dwo
-+ WORKING_DIRECTORY ${EXTERNAL_DEBUG_DIR}/dwp
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
- )
- list(APPEND testprogtargets
+@@ -182,9 +187,10 @@
+ OUTPUT
+ ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split
+ ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
+- COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split ${testprog_raw_ld_flags}
+- COMMAND ${LLVM_DWP} -e ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split -o ${EXTERNAL_DEBUG_DIR}/dwp/uprobe_test-split.dwp
++ COMMAND ${CMAKE_C_COMPILER} ${testprog_raw_cc_flags} -g -O0 -gsplit-dwarf ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c -o uprobe_test-split ${testprog_raw_ld_flags}
++ COMMAND ${LLVM_DWP} -e uprobe_test-split -o uprobe_test-split.dwp
+ COMMAND ${CMAKE_COMMAND} -E rm -f ${EXTERNAL_DEBUG_DIR}/dwp/*.dwo
++ WORKING_DIRECTORY ${EXTERNAL_DEBUG_DIR}/dwp
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/uprobe_test.c
+ )
+ list(APPEND testprogtargets
new file mode 100644
@@ -0,0 +1,65 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Sat, 21 Nov 2026 00:00:00 -0800
+Subject: [PATCH] tests: make the dwarf_origin fixture usable in installed tests
+
+DWARF_ORIGIN_BINARY is set to the absolute path of the fixture in the
+build tree, so bpftrace_test embeds the build directory and cannot find
+the fixture once the tests are installed elsewhere. ctest runs
+bpftrace_test from the tests build directory, so a path relative to it
+works both there and in an installed copy of the tests directory.
+
+The fixture is also built with the build host gcc found by BuildBPF.cmake,
+so a cross build installs a host binary next to target tests. Its DWARF is
+hand written and architecture independent, so build it with the target C
+compiler and sysroot instead.
+
+Upstream-Status: Pending
+AI-Generated: Uses Claude Code
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ tests/CMakeLists.txt | 2 +-
+ tests/data/CMakeLists.txt | 16 ++++++++++++++--
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -65,7 +65,7 @@ add_subdirectory(data)
+ add_dependencies(bpftrace_test data_source_dwarf data_source_btf)
+ add_dependencies(bpftrace_test dwarf_origin_fixture)
+ target_compile_definitions(bpftrace_test PRIVATE
+- DWARF_ORIGIN_BINARY="${CMAKE_CURRENT_BINARY_DIR}/data/dwarf_origin")
++ DWARF_ORIGIN_BINARY="data/dwarf_origin")
+ target_include_directories(bpftrace_test PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_include_directories(bpftrace_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
+
+--- a/tests/data/CMakeLists.txt
++++ b/tests/data/CMakeLists.txt
+@@ -1,13 +1,25 @@
+ include(BuildBPF)
+ include(Embed)
+
++# The fixture is installed with the tests, so build it with the target C
++# compiler and sysroot; GCC from BuildBPF.cmake is the build host compiler.
++set(dwarf_origin_cc_flags "")
++if(CMAKE_C_COMPILER_ARG1)
++ separate_arguments(_arg1 UNIX_COMMAND "${CMAKE_C_COMPILER_ARG1}")
++ list(APPEND dwarf_origin_cc_flags ${_arg1})
++endif()
++if(CMAKE_SYSROOT)
++ list(APPEND dwarf_origin_cc_flags "--sysroot=${CMAKE_SYSROOT}")
++endif()
++separate_arguments(dwarf_origin_ld_flags UNIX_COMMAND "${CMAKE_EXE_LINKER_FLAGS}")
++
+ # Define the DIE order explicitly: compiler-generated DWARF may put the
+ # abstract function first and leave inherited parameter names untested.
+ add_custom_command(
+ OUTPUT dwarf_origin
+- COMMAND ${GCC} -no-pie ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_origin.c
++ COMMAND ${CMAKE_C_COMPILER} ${dwarf_origin_cc_flags} -no-pie ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_origin.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_origin.S
+- -o ${CMAKE_CURRENT_BINARY_DIR}/dwarf_origin
++ -o ${CMAKE_CURRENT_BINARY_DIR}/dwarf_origin ${dwarf_origin_ld_flags}
+ DEPENDS dwarf_origin.c dwarf_origin.S
+ VERBATIM
+ )
similarity index 92%
rename from meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.26.1.bb
rename to meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.27.1.bb
@@ -13,17 +13,16 @@ DEPENDS += "gzip-native \
"
DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-native zip-native', '', d)}"
-SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.26.x;protocol=https;tag=v${PV} \
+SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.27.x;protocol=https;tag=v${PV} \
file://run-ptest \
file://0001-cmake-BuildBPF.cmake-introduce-DEBUG_PREFIX_MAP.patch \
file://0003-cmake-BuildBPF.cmake-link-data-source-binary-without.patch \
- file://0004-IRBuilderBPF-Fix-HasTerminator-on-LLVM-23.patch \
- file://0005-CMakeLists-Add-support-for-LLVM-23.patch \
file://0001-tests-pass-C-linker-flags-and-sysroot-to-raw-compile.patch \
file://0006-tests-do-not-embed-build-paths-in-split-DWARF-test-pr.patch \
file://0007-tests-testprogs-define-_GNU_SOURCE-for-pthread_setn.patch \
+ file://0008-tests-look-up-the-dwarf_origin-fixture-relative-to-t.patch \
"
-SRCREV = "1bac8a8daad6e0aa579980e877d0c9d5fc296593"
+SRCREV = "24e9fe60faffcbed50b44428067fcd9b03770584"
inherit bash-completion cmake ptest pkgconfig
@@ -53,6 +52,7 @@ do_install_ptest() {
install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test
cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests
cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests
+ install -Dm 755 ${B}/tests/data/dwarf_origin ${D}${PTEST_PATH}/tests/data/dwarf_origin
fi
for f in testlibs/cmake_install.cmake \
testprogs/cmake_install.cmake \
- 0.27.0 adds str_concat(), container_of() and config to the stdlib, reg("pc") as an instruction pointer alias and type expression substitution for macros - Fix session probes on kernel 7.0, fentry/fexit argument decoding, USDT/uaddr() address spaces and strftime() on big endian - Fix several codegen crashes and string allocation size mismatches - 0.27.1 copies structs/arrays on scratch variable assignment and fixes bitfield/field access on structs in maps, tuples and records - Fix an invalid BPF object with LLVM 23 and a large max_strlen - Print compile-time warnings to stderr so JSON output stays clean Track the release/0.27.x branch. Drop the two LLVM 23 backports, which are part of 0.27.x, and refresh the tests patches for the reworked testprogs/CMakeLists.txt. The new dwarf_origin test fixture was referenced by its build tree path, which leaked TMPDIR into bpftrace_test and broke the test once installed; look it up relative to the tests directory and install it with the ptest. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> --- ...ker-flags-and-sysroot-to-raw-compile.patch | 24 +++---- ...lderBPF-Fix-HasTerminator-on-LLVM-23.patch | 38 ----------- ...5-CMakeLists-Add-support-for-LLVM-23.patch | 36 ---------- ...d-build-paths-in-split-DWARF-test-pr.patch | 30 ++++----- ...e-dwarf_origin-fixture-relative-to-t.patch | 65 +++++++++++++++++++ ...{bpftrace_0.26.1.bb => bpftrace_0.27.1.bb} | 8 +-- 6 files changed, 95 insertions(+), 106 deletions(-) delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0004-IRBuilderBPF-Fix-HasTerminator-on-LLVM-23.patch delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0005-CMakeLists-Add-support-for-LLVM-23.patch create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0008-tests-look-up-the-dwarf_origin-fixture-relative-to-t.patch rename meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/{bpftrace_0.26.1.bb => bpftrace_0.27.1.bb} (92%)