openembedded-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release
@ 2025-09-01 22:42 Khem Raj
  2025-09-01 22:42 ` [meta-oe][PATCH 2/5] bpftrace: Upgrade to 0.24.0 Khem Raj
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Khem Raj @ 2025-09-01 22:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Drop backported patch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-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%)

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch
deleted file mode 100644
index 1c2ae33238..0000000000
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Fix-build-failures-due-to-missing-location.hh.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 24421ba92c69f1abaadaff01270621917616a2b8 Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-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 <viktor.malik@gmail.com>
-
-Upstream-Status: Backport [https://github.com/bpftrace/bpftrace/commit/743cb9c88c25fb9737d714f4d4ac853f05bb6481]
-
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- 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
-
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb
similarity index 94%
rename from meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.0.bb
rename to meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb
index c8ccf4c83f..1b2f8ab0e4 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.0.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb
@@ -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
 


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

* [meta-oe][PATCH 2/5] bpftrace: Upgrade to 0.24.0
  2025-09-01 22:42 [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release Khem Raj
@ 2025-09-01 22:42 ` Khem Raj
  2025-09-01 22:42 ` [meta-oe][PATCH 3/5] libjxl: Upgrade to 0.11.1 Khem Raj
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2025-09-01 22:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Fix build with clang-21 and libc++

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...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%)

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Include-missing-c-runtime-headers.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Include-missing-c-runtime-headers.patch
new file mode 100644
index 0000000000..d3009fa295
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-Include-missing-c-runtime-headers.patch
@@ -0,0 +1,39 @@
+From ead4dc45e35fc6c3770ef4021720e0e6a5b60674 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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>
+
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch
new file mode 100644
index 0000000000..3fb8d131b6
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0001-cmake-Raise-max-supported-clang-version-to-clang-21.patch
@@ -0,0 +1,24 @@
+From 7bd8ec690ad587e7f180bcd061a6205b28d86260 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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}))
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch
index 4f0ebbf564..c9e1749dd5 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch
@@ -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)
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch
new file mode 100644
index 0000000000..140cc12add
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0002-chrono-Fix-build-when-using-libc-casting-ns-to-syste.patch
@@ -0,0 +1,54 @@
+From 381047c14dfbc3b89a5e87404cb7cf886f10c119 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 31 Aug 2025 15:26:36 -0700
+Subject: [PATCH 2/3] chrono: Fix build when using libc++ casting ns to
+ system_clock::duration
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+libc++ from LLVM/Clang 21 release requires that time_point::operator+=
+receive the exact duration type of the time_point. On many Linux configs,
+system_clock::duration is microseconds, so doing:
+
+  t += std::chrono::nanoseconds(...);
+
+fails with:
+  error: no viable overloaded '+='
+  note: candidate function not viable: no known conversion from
+        'duration<..., nano>' to 'const duration<..., micro>' for 1st argument
+
+Cast the nanoseconds to system_clock::duration via duration_cast before
+adding them. This builds with Clang 21 + libc++ and remains compatible
+with libstdc++. Semantics are unchanged except for truncation to the
+clock’s native resolution (which already applies).
+
+No functional change intended.
+
+Upstream-Status: Submitted [https://github.com/bpftrace/bpftrace/pull/4526]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/bpftrace.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/bpftrace.cpp b/src/bpftrace.cpp
+index a49a3efe..485267e0 100644
+--- a/src/bpftrace.cpp
++++ b/src/bpftrace.cpp
+@@ -992,11 +992,13 @@ std::chrono::time_point<std::chrono::system_clock> BPFtrace::resolve_timestamp(
+           << "Cannot resolve timestamp due to failed boot time calculation";
+     } else {
+       t += std::chrono::seconds(boottime_->tv_sec);
+-      t += std::chrono::nanoseconds(boottime_->tv_nsec);
++      t += std::chrono::duration_cast<std::chrono::system_clock::duration>(
++               std::chrono::nanoseconds(boottime_->tv_nsec));
+     }
+   }
+
+-  t += std::chrono::nanoseconds(nsecs);
++  t += std::chrono::duration_cast<std::chrono::system_clock::duration>(
++           std::chrono::nanoseconds(nsecs));
+   return t;
+ }
+
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch
new file mode 100644
index 0000000000..e5ae0219f7
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace/0003-ast-Adapt-to-Clang-LLVM-21-DiagnosticOptions-API.patch
@@ -0,0 +1,78 @@
+From 9771348249981680c2b893a435099673e79997c4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 31 Aug 2025 15:29:26 -0700
+Subject: [PATCH 3/3] ast: Adapt to Clang/LLVM 21 DiagnosticOptions API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Clang 21 removed intrusive ref-counting from DiagnosticOptions and
+switched consumers to take a DiagnosticOptions&. Building bpftrace
+with clang-21/libc++ failed with errors like:
+
+  IntrusiveRefCntPtr.h:163: error: no member named 'Retain' in
+    'clang::DiagnosticOptions'
+  Diagnostic.h:578: no known conversion from
+    'IntrusiveRefCntPtr<clang::DiagnosticOptions>' to
+    'DiagnosticOptions&'
+
+Update the frontend glue:
+- For LLVM >= 21, construct a real DiagnosticOptions object and pass
+  it by reference to TextDiagnosticPrinter and DiagnosticsEngine
+  (no IntrusiveRefCntPtr). Keep it alive via shared_ptr to satisfy
+  DiagnosticsEngine’s reference lifetime.
+- Replace ci.setInvocation(inv) with
+  ci.getInvocation() = *inv; which is stable across modern Clang.
+
+Retain the old code path for LLVM < 21 via #if guards.
+
+This fixes builds with clang-21/libc++ while keeping compatibility
+with older LLVM releases.
+
+No functional change intended.
+
+Upstream-Status: Submitted [https://github.com/bpftrace/bpftrace/pull/4526]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ast/passes/clang_build.cpp | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/ast/passes/clang_build.cpp b/src/ast/passes/clang_build.cpp
+index fa5b2add..3debc350 100644
+--- a/src/ast/passes/clang_build.cpp
++++ b/src/ast/passes/clang_build.cpp
+@@ -78,12 +78,21 @@ static Result<> build(CompileContext &ctx,
+   // a string, which we can then capture and associate with the import.
+   std::string errstr;
+   llvm::raw_string_ostream err(errstr);
++#if LLVM_VERSION_MAJOR < 21
+   auto diagOpts = llvm::makeIntrusiveRefCnt<clang::DiagnosticOptions>();
+   auto diags = std::make_unique<clang::DiagnosticsEngine>(
+       llvm::makeIntrusiveRefCnt<clang::DiagnosticIDs>(),
+       diagOpts,
+       new clang::TextDiagnosticPrinter(err, diagOpts.get()));
+-
++#else
++  // Clang 21: DiagnosticOptions is NOT intrusive-refcounted anymore.
++  // Keep it alive for the program lifetime (or store it on a longer-lived object).
++  static std::shared_ptr<clang::DiagnosticOptions> diagOpts =
++      std::make_shared<clang::DiagnosticOptions>();
++  llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> diagID(new clang::DiagnosticIDs());
++  auto client = std::make_unique<clang::TextDiagnosticPrinter>(err, *diagOpts);
++  auto diags = std::make_unique<clang::DiagnosticsEngine>(diagID, *diagOpts, client.release());
++#endif
+   // We create a temporary memfd that we can use to store the output,
+   // since the ClangDriver API is framed in terms of filenames. Perhaps
+   // we could use the internals here, but that carries other risks.
+@@ -122,7 +131,9 @@ static Result<> build(CompileContext &ctx,
+   inv->getCodeGenOpts().DebugColumnInfo = true;
+
+   clang::CompilerInstance ci;
+-  ci.setInvocation(inv);
++  // Cross-version friendly: assign into the existing invocation
++  // (works across modern Clang majors, including 21)
++  ci.getInvocation() = *inv;
+   ci.setDiagnostics(diags.release());
+   ci.setFileManager(new clang::FileManager(clang::FileSystemOptions(), vfs));
+   ci.createSourceManager(ci.getFileManager());
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.24.0.bb
similarity index 82%
rename from meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb
rename to meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.24.0.bb
index 1b2f8ab0e4..7e9cbf485e 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.23.5.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.24.0.bb
@@ -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
 


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

* [meta-oe][PATCH 3/5] libjxl: Upgrade to 0.11.1
  2025-09-01 22:42 [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release Khem Raj
  2025-09-01 22:42 ` [meta-oe][PATCH 2/5] bpftrace: Upgrade to 0.24.0 Khem Raj
@ 2025-09-01 22:42 ` Khem Raj
  2025-09-01 22:42 ` [meta-initramfs][PATCH 4/5] klibc: Upgrade to 2.0.14 Khem Raj
  2025-09-01 22:42 ` [meta-initramfs][PATCH 5/5] klibc: Do not let clang generate wcslen builtin Khem Raj
  3 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2025-09-01 22:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Use -fno-integrated-as with clang on arm architecture

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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%)

diff --git a/meta-oe/recipes-multimedia/libjxl/libjxl_0.10.3.bb b/meta-oe/recipes-multimedia/libjxl/libjxl_0.11.1.bb
similarity index 90%
rename from meta-oe/recipes-multimedia/libjxl/libjxl_0.10.3.bb
rename to meta-oe/recipes-multimedia/libjxl/libjxl_0.11.1.bb
index 2405126e5c..7b0a6db9fb 100644
--- a/meta-oe/recipes-multimedia/libjxl/libjxl_0.10.3.bb
+++ b/meta-oe/recipes-multimedia/libjxl/libjxl_0.11.1.bb
@@ -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}"


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

* [meta-initramfs][PATCH 4/5] klibc: Upgrade to 2.0.14
  2025-09-01 22:42 [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release Khem Raj
  2025-09-01 22:42 ` [meta-oe][PATCH 2/5] bpftrace: Upgrade to 0.24.0 Khem Raj
  2025-09-01 22:42 ` [meta-oe][PATCH 3/5] libjxl: Upgrade to 0.11.1 Khem Raj
@ 2025-09-01 22:42 ` Khem Raj
  2025-09-01 22:42 ` [meta-initramfs][PATCH 5/5] klibc: Do not let clang generate wcslen builtin Khem Raj
  3 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2025-09-01 22:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

Backport couple of clang related fixes from upstream

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...-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%)

diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
new file mode 100644
index 0000000000..82d02f9fb3
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/files/0001-stdint.h-Fix-build-with-newer-clang.patch
@@ -0,0 +1,99 @@
+From 84bfb7a85900446e3cc96a103601052781627043 Mon Sep 17 00:00:00 2001
+From: Florent Revest <revest@chromium.org>
+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 <revest@chromium.org>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ 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)
diff --git a/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch b/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch
new file mode 100644
index 0000000000..ad1f7f03a8
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/files/0002-mount_opts-Fix-the-mount_opts-str-length.patch
@@ -0,0 +1,41 @@
+From eaecc37c86fff0ff951e1930abdb9e51364c2d14 Mon Sep 17 00:00:00 2001
+From: Florent Revest <revest@chromium.org>
+Date: Thu, 10 Jul 2025 19:39:11 +0200
+Subject: [PATCH 2/2] mount_opts: Fix the mount_opts str length
+
+Newer versions of LLVM report:
+
+usr/utils/mount_opts.c:20:3: error: initializer-string for character array is too long, array size is 8 but initializer has size 9 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
+   20 |         {"diratime", MS_NODIRATIME, 0, MS_NODIRATIME},
+      |          ^~~~~~~~~~
+
+This is indeed a bit odd. "diratime" is 9 bytes long with the \0
+terminator but placed into a struct that uses a static length of 8 bytes
+for that buffer. I suppose this can cause all sorts of undefined
+behaviors in theory but that in practice this never caused anything bad
+because the next field is an unsigned long containing 2048 so the upper
+bytes are 0 and act as string terminators by chance.
+
+Anyway, fixing this helps unblock builds with newer toolchains.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=f7d9399d1035d2a70067fa6995db7ea02ed0c311]
+Signed-off-by: Florent Revest <revest@chromium.org>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/utils/mount_opts.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/utils/mount_opts.h b/usr/utils/mount_opts.h
+index cf47cae..5195c88 100644
+--- a/usr/utils/mount_opts.h
++++ b/usr/utils/mount_opts.h
+@@ -2,7 +2,7 @@
+ #define UTILS_MOUNT_OPTS_H
+ 
+ struct mount_opts {
+-	const char str[8];
++	const char str[9];
+ 	unsigned long rwmask;
+ 	unsigned long rwset;
+ 	unsigned long rwnoset;
diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb
similarity index 100%
rename from meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.13.bb
rename to meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.14.bb
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb
similarity index 100%
rename from meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.13.bb
rename to meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.14.bb
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb
similarity index 100%
rename from meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.13.bb
rename to meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.14.bb
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index 2af53b18e3..26d4ebc72c 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -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}"
 
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb
similarity index 100%
rename from meta-initramfs/recipes-devtools/klibc/klibc_2.0.13.bb
rename to meta-initramfs/recipes-devtools/klibc/klibc_2.0.14.bb


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

* [meta-initramfs][PATCH 5/5] klibc: Do not let clang generate wcslen builtin
  2025-09-01 22:42 [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release Khem Raj
                   ` (2 preceding siblings ...)
  2025-09-01 22:42 ` [meta-initramfs][PATCH 4/5] klibc: Upgrade to 2.0.14 Khem Raj
@ 2025-09-01 22:42 ` Khem Raj
  3 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2025-09-01 22:42 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

clang-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'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-initramfs/recipes-devtools/klibc/klibc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index 26d4ebc72c..4e8710f7bb 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -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 = ""


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

end of thread, other threads:[~2025-09-01 22:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 22:42 [meta-oe][PATCH 1/5] bpftrace: Upgrade to 0.23.5 release Khem Raj
2025-09-01 22:42 ` [meta-oe][PATCH 2/5] bpftrace: Upgrade to 0.24.0 Khem Raj
2025-09-01 22:42 ` [meta-oe][PATCH 3/5] libjxl: Upgrade to 0.11.1 Khem Raj
2025-09-01 22:42 ` [meta-initramfs][PATCH 4/5] klibc: Upgrade to 2.0.14 Khem Raj
2025-09-01 22:42 ` [meta-initramfs][PATCH 5/5] klibc: Do not let clang generate wcslen builtin Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).