bpftrace: Upgrade to 0.23.5 release
PATCH 1/5 bpftrace: Upgrade to 0.23.5 release
Drop backported patch
---
...-failures-due-to-missing-location.hh.patch | 54 -------------------
...{bpftrace_0.23.0.bb => bpftrace_0.23.5.bb} | 5 +-
2 files changed, 1 insertion(+), 58 deletions(-)
delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch
rename meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/{bpftrace_0.23.0.bb => bpftrace_0.23.5.bb} (94%)meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch deleted +0 -54
@@ -1,54 +0,0 @@ -From 24421ba92c69f1abaadaff01270621917616a2b8 Mon Sep 17 00:00:00 2001 -From: Changqing Li <[email protected]> -Date: Thu, 17 Apr 2025 10:38:50 +0800 -Subject: [PATCH] Fix build failures due to missing location.hh - -ast/location.h does `#include "location.hh"` and location.hh is -generated by the parser so any CMake target whose source includes -ast/location.h needs to have a dependency on the `parser` target, -otherwise the compilation may fail due to incorrect ordering of build -targets. This also applies to targets which include ast/location.h -transitively via other headers. - -To avoid such errors, do 2 things: -- drop includes of ast/location.h where unused -- for CMake targets including ast/location.h, add an explicit dependency - on the `parser` target - -Signed-off-by: Viktor Malik <[email protected]> - -Upstream-Status: Backport [https://github.com/bpftrace/bpftrace/commit/743cb9c88c25fb9737d714f4d4ac853f05bb6481] - -Signed-off-by: Changqing Li <[email protected]> ---- - src/CMakeLists.txt | 1 + - src/ast/CMakeLists.txt | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index e04ee429..13a51040 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -21,6 +21,7 @@ add_library(compiler_core STATIC - struct.cpp - types.cpp - ) -+add_dependencies(compiler_core parser) - - add_library(runtime STATIC - attached_probe.cpp -diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt -index 92231f85..7230cf71 100644 ---- a/src/ast/CMakeLists.txt -+++ b/src/ast/CMakeLists.txt -@@ -22,6 +22,7 @@ add_library(ast STATIC - passes/return_path_analyser.cpp - ) - -+add_dependencies(ast parser) - target_compile_definitions(ast PRIVATE ${BPFTRACE_FLAGS}) - target_link_libraries(ast PUBLIC ast_defs arch compiler_core parser) - --- -2.34.1 -
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb renamed from meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.0.bb +1 -4
@@ -16,14 +16,11 @@ DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-nativ RDEPENDS:${PN} += "bash python3 xz" -PV .= "+git" - SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.23.x;protocol=https \ file://run-ptest \ file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ - file://0001-Fix-build-failures-due-to-missing-location.hh.patch \ " -SRCREV = "01e806d24c61f996f1809e1e991646311499db4f" +SRCREV = "e48ccc66c9971515648b63699bc4b1490c388d85" inherit bash-completion cmake ptest pkgconfig
PATCH 2/5 bpftrace: Upgrade to 0.24.0
Fix build with clang-21 and libc++
---
...01-Include-missing-c-runtime-headers.patch | 39 ++++++++++
...-supported-clang-version-to-clang-21.patch | 24 ++++++
....txt-allow-to-set-BISON_FLAGS-like-l.patch | 11 +--
...-when-using-libc-casting-ns-to-syste.patch | 54 +++++++++++++
...-Clang-LLVM-21-DiagnosticOptions-API.patch | 78 +++++++++++++++++++
...{bpftrace_0.23.5.bb => bpftrace_0.24.0.bb} | 9 ++-
6 files changed, 208 insertions(+), 7 deletions(-)
create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Include-missing-c-runtime-headers.patch
create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch
create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch
create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch
rename meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/{bpftrace_0.23.5.bb => bpftrace_0.24.0.bb} (82%)meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Include-missing-c-runtime-headers.patch new file +39 -0
@@ -0,0 +1,39 @@ +From ead4dc45e35fc6c3770ef4021720e0e6a5b60674 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sun, 31 Aug 2025 15:23:27 -0700 +Subject: [PATCH 1/3] Include missing c++ runtime headers + +These headers are required and found to fail builds +when using llvm/libc++ instead of libstdc++ on linux + +Upstream-Status: Submitted [https://github.com/bpftrace/bpftrace/pull/4526] +Signed-off-by: Khem Raj <[email protected]> +--- + src/util/bpf_names.cpp | 1 + + tests/opaque.cpp | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/util/bpf_names.cpp b/src/util/bpf_names.cpp +index 68525bfc..ab8f6f2f 100644 +--- a/src/util/bpf_names.cpp ++++ b/src/util/bpf_names.cpp +@@ -1,6 +1,7 @@ + #include <algorithm> + #include <iomanip> + #include <iostream> ++#include <sstream> // for std::ostringstream + + #include "util/bpf_names.h" + +diff --git a/tests/opaque.cpp b/tests/opaque.cpp +index a030a05d..034888d3 100644 +--- a/tests/opaque.cpp ++++ b/tests/opaque.cpp +@@ -1,6 +1,7 @@ + #include "util/opaque.h" + #include "gtest/gtest.h" + #include <cstring> ++#include <numbers> // for std::numbers + #include <string> + #include <vector> +
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch new file +24 -0
@@ -0,0 +1,24 @@ +From 7bd8ec690ad587e7f180bcd061a6205b28d86260 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sun, 31 Aug 2025 09:50:35 -0700 +Subject: [PATCH] cmake: Raise max supported clang version to clang-21 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 025fa738..a0f16dd1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -172,7 +172,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") + # releases. + set(MAX_LLVM_MAJOR 999) + else() +- set(MAX_LLVM_MAJOR 20) ++ set(MAX_LLVM_MAJOR 21) + endif() + + if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch +6 -5
@@ -12,7 +12,7 @@ Upstream-Status: Pending --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -100,16 +100,20 @@ include_directories(SYSTEM ${LIBCEREAL_I +@@ -108,16 +108,21 @@ include_directories(SYSTEM ${LIBCEREAL_I find_package(BISON REQUIRED) find_package(FLEX REQUIRED)
@@ -20,15 +20,16 @@ Upstream-Status: Pending +# avoid buildpaths in generated #line statements and allow to pass --file-prefix-map=OLD=NEW +set(BISON_FLAGS "${BISON_FLAGS} -l") +set(FLEX_FLAGS "${FLEX_FLAGS} -L") ++ # `parser_class_name` is deprecated and generates warnings in bison >= 3.3. # But `api.parser.class` is not supported in bison < 3.3. So we must inject # the %define based on the bison version here. if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.3) -- set(BISON_FLAGS "-Dapi.parser.class={Parser}") -+ set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser}") +- set(BISON_FLAGS "-Dapi.parser.class={Parser} -Wcounterexamples") ++ set(BISON_FLAGS "${BISON_FLAGS} -Dapi.parser.class={Parser} -Wcounterexamples") else() -- set(BISON_FLAGS "-Dparser_class_name={Parser}") -+ set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser}") +- set(BISON_FLAGS "-Dparser_class_name={Parser} -Wcounterexamples") ++ set(BISON_FLAGS "${BISON_FLAGS} -Dparser_class_name={Parser} -Wcounterexamples") endif() bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc COMPILE_FLAGS ${BISON_FLAGS} VERBOSE) -flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc)
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch new file +54 -0
54 lines not on this page · raw message
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch new file +78 -0
78 lines not on this page · raw message
meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.24.0.bb renamed from meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb +7 -2
@@ -7,6 +7,7 @@ DEPENDS += "bison-native \ flex-native \ gzip-native \ elfutils \ + bpftool-native \ bcc \ systemtap \ libcereal \
@@ -16,11 +17,15 @@ DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-nativ RDEPENDS:${PN} += "bash python3 xz" -SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.23.x;protocol=https \ +SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ file://run-ptest \ + file://0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch \ file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \ + file://0001-Include-missing-c-runtime-headers.patch \ + file://0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch \ + file://0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch \ " -SRCREV = "e48ccc66c9971515648b63699bc4b1490c388d85" +SRCREV = "3b78184eed28501ab4bbb55e45c4172538999da1" inherit bash-completion cmake ptest pkgconfig
PATCH 3/5 libjxl: Upgrade to 0.11.1
In reply to Khem RajUse -fno-integrated-as with clang on arm architecture
---
.../libjxl/{libjxl_0.10.3.bb => libjxl_0.11.1.bb} | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
rename meta-oe/recipes-multimedia/libjxl/{libjxl_0.10.3.bb => libjxl_0.11.1.bb} (90%)meta-oe/recipes-multimedia/libjxl/libjxl_0.11.1.bb renamed from meta-oe/recipes-multimedia/libjxl/libjxl_0.10.3.bb +5 -1
@@ -12,7 +12,7 @@ SRC_URI = "gitsm://github.com/libjxl/libjxl.git;protocol=https;nobranch=1 \ file://0001-cmake-Do-not-use-mrelax-all-with-clang-on-RISCV64.patch \ " -SRCREV = "4a3b22d2600f92d8706fb72d85d52bfee2acbd54" +SRCREV = "794a5dcf0d54f9f0b20d288a12e87afb91d20dfc" EXTRA_OECMAKE = " \ -DCMAKE_BUILD_TYPE=Release \
@@ -43,4 +43,8 @@ PACKAGECONFIG[gimp] = "-DJPEGXL_ENABLE_PLUGIN_GIMP210=ON,-DJPEGXL_ENABLE_PLUGIN_ PACKAGECONFIG[mime] = "-DJPEGXL_ENABLE_PLUGIN_MIME=ON,-DJPEGXL_ENABLE_PLUGIN_MIME=OFF" PACKAGECONFIG[sizeless-vectors] = "-DJPEGXL_ENABLE_SIZELESS_VECTORS=ON,-DJPEGXL_ENABLE_SIZELESS_VECTORS=OFF" +# lcms/src/cmsps2.c +# error: out of range pc-relative fixup value +CFLAGS:append:toolchain-clang:arm = " -fno-integrated-as" + FILES:${PN} += "${libdir}/gdk-pixbuf-2.0 ${datadir}"
PATCH 4/5 klibc: Upgrade to 2.0.14
In reply to Khem RajBackport couple of clang related fixes from upstream
---
...-stdint.h-Fix-build-with-newer-clang.patch | 99 +++++++++++++++++++
...t_opts-Fix-the-mount_opts-str-length.patch | 41 ++++++++
...c-cross_2.0.13.bb => klcc-cross_2.0.14.bb} | 0
...2.0.13.bb => klibc-static-utils_2.0.14.bb} | 0
...-utils_2.0.13.bb => klibc-utils_2.0.14.bb} | 0
.../recipes-devtools/klibc/klibc.inc | 4 +-
.../{klibc_2.0.13.bb => klibc_2.0.14.bb} | 0
7 files changed, 143 insertions(+), 1 deletion(-)
create mode 100644 meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
create mode 100644 meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch
rename meta-initramfs/recipes-devtools/klibc/{klcc-cross_2.0.13.bb => klcc-cross_2.0.14.bb} (100%)
rename meta-initramfs/recipes-devtools/klibc/{klibc-static-utils_2.0.13.bb => klibc-static-utils_2.0.14.bb} (100%)
rename meta-initramfs/recipes-devtools/klibc/{klibc-utils_2.0.13.bb => klibc-utils_2.0.14.bb} (100%)
rename meta-initramfs/recipes-devtools/klibc/{klibc_2.0.13.bb => klibc_2.0.14.bb} (100%)meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch new file +99 -0
@@ -0,0 +1,99 @@ +From 84bfb7a85900446e3cc96a103601052781627043 Mon Sep 17 00:00:00 2001 +From: Florent Revest <[email protected]> +Date: Mon, 14 Jul 2025 19:25:04 +0200 +Subject: [PATCH 1/2] stdint.h: Fix build with newer clang + +Recent versions of Clang introduced definitions for __*INT64_C: +https://github.com/llvm/llvm-project/commit/33ad474c45e6d7a0de7bc75e15e27cf6cb9ff895 + +This results in these build errors: + +usr/include/bits64/bitsize/stdint.h:27:9: error: '__INT64_C' macro redefined [-Werror,-Wmacro-redefined] + 27 | #define __INT64_C(c) c ## L + | ^ +<built-in>:194:9: note: previous definition is here + 194 | #define __INT64_C(c) c##L + | ^ + +Renaming these macros to something more unique avoids the errors. + +Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=1d27e1732f1326eaf98f4624100f83232d843616] +Signed-off-by: Florent Revest <[email protected]> +Signed-off-by: Ben Hutchings <[email protected]> +Signed-off-by: Khem Raj <[email protected]> +--- + usr/include/bits32/bitsize/stdint.h | 4 ++-- + usr/include/bits64/bitsize/stdint.h | 4 ++-- + usr/include/stdint.h | 10 +++++----- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/usr/include/bits32/bitsize/stdint.h b/usr/include/bits32/bitsize/stdint.h +index 8e444b6..147090b 100644 +--- a/usr/include/bits32/bitsize/stdint.h ++++ b/usr/include/bits32/bitsize/stdint.h +@@ -24,8 +24,8 @@ typedef unsigned int uint_fast32_t; + typedef int intptr_t; + typedef unsigned int uintptr_t; + +-#define __INT64_C(c) c ## LL +-#define __UINT64_C(c) c ## ULL ++#define __KLIBC_INT64_C(c) c ## LL ++#define __KLIBC_UINT64_C(c) c ## ULL + + #define __PRI64_RANK "ll" + #define __PRIFAST_RANK "" +diff --git a/usr/include/bits64/bitsize/stdint.h b/usr/include/bits64/bitsize/stdint.h +index 988e639..5bc64bf 100644 +--- a/usr/include/bits64/bitsize/stdint.h ++++ b/usr/include/bits64/bitsize/stdint.h +@@ -24,8 +24,8 @@ typedef unsigned long int uint_fast32_t; + typedef long int intptr_t; + typedef unsigned long int uintptr_t; + +-#define __INT64_C(c) c ## L +-#define __UINT64_C(c) c ## UL ++#define __KLIBC_INT64_C(c) c ## L ++#define __KLIBC_UINT64_C(c) c ## UL + + #define __PRI64_RANK "l" + #define __PRIFAST_RANK "l" +diff --git a/usr/include/stdint.h b/usr/include/stdint.h +index f64f027..6cda583 100644 +--- a/usr/include/stdint.h ++++ b/usr/include/stdint.h +@@ -31,17 +31,17 @@ typedef uint64_t uintmax_t; + #define INT8_MIN (-128) + #define INT16_MIN (-32768) + #define INT32_MIN (-2147483647-1) +-#define INT64_MIN (__INT64_C(-9223372036854775807)-1) ++#define INT64_MIN (__KLIBC_INT64_C(-9223372036854775807)-1) + + #define INT8_MAX (127) + #define INT16_MAX (32767) + #define INT32_MAX (2147483647) +-#define INT64_MAX (__INT64_C(9223372036854775807)) ++#define INT64_MAX (__KLIBC_INT64_C(9223372036854775807)) + + #define UINT8_MAX (255U) + #define UINT16_MAX (65535U) + #define UINT32_MAX (4294967295U) +-#define UINT64_MAX (__UINT64_C(18446744073709551615)) ++#define UINT64_MAX (__KLIBC_UINT64_C(18446744073709551615)) + + #define INT_LEAST8_MIN INT8_MIN + #define INT_LEAST16_MIN INT16_MIN +@@ -80,12 +80,12 @@ typedef uint64_t uintmax_t; + #define INT8_C(c) c + #define INT16_C(c) c + #define INT32_C(c) c +-#define INT64_C(c) __INT64_C(c) ++#define INT64_C(c) __KLIBC_INT64_C(c) + + #define UINT8_C(c) c ## U + #define UINT16_C(c) c ## U + #define UINT32_C(c) c ## U +-#define UINT64_C(c) __UINT64_C(c) ++#define UINT64_C(c) __KLIBC_UINT64_C(c) + + #define INT_LEAST8_C(c) INT8_C(c) + #define INT_LEAST16_C(c) INT16_C(c)
meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch new file +41 -0
41 lines not on this page · raw message
meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb renamed from meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb +0 -0
meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb renamed from meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb +0 -0
meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb renamed from meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb +0 -0
meta-initramfs/recipes-devtools/klibc/klibc.inc +3 -1
@@ -20,6 +20,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/libs/klibc/2.0/klibc-${PV}.tar.xz \ file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ file://cross-clang.patch \ file://0001-workaround-for-overlapping-sections-in-binary.patch \ + file://0001-stdint.h-Fix-build-with-newer-clang.patch \ + file://0002-mount_opts-Fix-the-mount_opts-str-length.patch \ " ARMPATCHES ?= ""
@@ -27,7 +29,7 @@ ARMPATCHES ?= "" ARMPATCHES:arm = " \ file://armv4-fix-v4bx.patch \ " -SRC_URI[sha256sum] = "d673a294f742d59368222ff5c38462d81098c55063799de6fb8a7ba3d4af0436" +SRC_URI[sha256sum] = "281bfb683e196818412af70b8968b7726475a80ff1c4bd67119e6bf5059f9075" S = "${UNPACKDIR}/klibc-${PV}"
meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb renamed from meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb +0 -0
PATCH 5/5 klibc: Do not let clang generate wcslen builtin
In reply to Khem Rajclang-21 decides to emit wcslen call on arm architecture klibc does not provide widechar support so it should not be used.
Fixes
| arm-yoe-linux-gnueabi-ld.bfd: usr/kinit/do_mounts_md.o: in function `md_run':
| /usr/src/debug/klibc/2.0.14/usr/kinit/do_mounts_md.c:294:(.text+0x5d6): undefined reference to `wcslen'
--- meta-initramfs/recipes-devtools/klibc/klibc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta-initramfs/recipes-devtools/klibc/klibc.inc +1 -1
@@ -35,7 +35,7 @@ S = "${UNPACKDIR}/klibc-${PV}" OPTFLAGS = "${TUNE_CCARGS} -Os -fcommon" OPTFLAGS:append = " ${DEBUG_PREFIX_MAP}" -OPTFLAGS:append:toolchain-clang = " -fno-builtin-bcmp" +OPTFLAGS:append:toolchain-clang = " -fno-builtin-bcmp -fno-builtin-wcslen" OPTFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as" PARALLEL_MAKE = ""