commit:     e1f5e2e8d5c12f23c6b1b252356c006a0cbc9268
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Thu Sep 18 12:15:45 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 18 22:59:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1f5e2e8

dev-debug/bpftrace: add bpftool build dep & fix build with gcc-16

Closes: https://bugs.gentoo.org/963025
Closes: https://bugs.gentoo.org/963026
Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Part-of: https://github.com/gentoo/gentoo/pull/43835
Closes: https://github.com/gentoo/gentoo/pull/43835
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-debug/bpftrace/bpftrace-0.24.0.ebuild          |  2 +
 .../bpftrace/files/bpftrace-0.24.0-gcc16.patch     | 65 ++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/dev-debug/bpftrace/bpftrace-0.24.0.ebuild 
b/dev-debug/bpftrace/bpftrace-0.24.0.ebuild
index 19385c0765b5..4f7f52d59dac 100644
--- a/dev-debug/bpftrace/bpftrace-0.24.0.ebuild
+++ b/dev-debug/bpftrace/bpftrace-0.24.0.ebuild
@@ -60,6 +60,7 @@ BDEPEND="
        app-alternatives/yacc
        app-editors/vim-core
        dev-libs/cereal
+       dev-util/bpftool
        test? (
                ${RUST_DEPEND}
                dev-lang/go
@@ -71,6 +72,7 @@ BDEPEND="
 PATCHES=(
        "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch"
        "${FILESDIR}/bpftrace-0.21.0-dont-compress-man.patch"
+       "${FILESDIR}/bpftrace-0.24.0-gcc16.patch"
 )
 
 pkg_pretend() {

diff --git a/dev-debug/bpftrace/files/bpftrace-0.24.0-gcc16.patch 
b/dev-debug/bpftrace/files/bpftrace-0.24.0-gcc16.patch
new file mode 100644
index 000000000000..22d14bad54ab
--- /dev/null
+++ b/dev-debug/bpftrace/files/bpftrace-0.24.0-gcc16.patch
@@ -0,0 +1,65 @@
+From: https://github.com/bpftrace/bpftrace/pull/4614
+
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <[email protected]>
+Date: Thu, 18 Sep 2025 11:55:36 +0200
+Subject: [PATCH] build: fix building with gcc-16
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Gcc-16 has once again tightened some transitive includes, which
+means some headers must now be explicitly included.
+For example:
+
+  src/util/int_parser.cpp: In function ‘bpftrace::Result<long unsigned int> 
bpftrace::util::to_uint(const std::string&, int)’:
+  src/util/int_parser.cpp:70:14: error: ‘ULLONG_MAX’ was not declared in this 
scope
+     70 |   if (ret == ULLONG_MAX && errno == ERANGE) {
+        |              ^~~~~~~~~~
+  src/util/int_parser.cpp:8:1: note: ‘ULLONG_MAX’ is defined in header 
‘<climits>’; this is probably fixable by adding ‘#include <climits>’
+      7 | #include "util/int_parser.h"
+    +++ |+#include <climits>
+      8 | #include "util/result.h"
+
+Tested with gcc-15.2.1-20250913, gcc-16.0.0-20250914 & clang-21.1.1.
+
+Signed-off-by: Holger Hoffstätte <[email protected]>
+---
+ src/util/int_parser.cpp | 2 +-
+ src/util/opaque.h       | 1 +
+ tests/utils.cpp         | 1 +
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/int_parser.cpp b/src/util/int_parser.cpp
+index c88e034a..ad8f98a2 100644
+--- a/src/util/int_parser.cpp
++++ b/src/util/int_parser.cpp
+@@ -1,5 +1,5 @@
++#include <climits>
+ #include <cstdint>
+-#include <limits>
+ #include <map>
+ #include <optional>
+ #include <ranges>
+diff --git a/src/util/opaque.h b/src/util/opaque.h
+index 1e8cf1bd..9b20a96b 100644
+--- a/src/util/opaque.h
++++ b/src/util/opaque.h
+@@ -1,5 +1,6 @@
+ #pragma once
+ 
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>
+diff --git a/tests/utils.cpp b/tests/utils.cpp
+index 91d56347..10116ad4 100644
+--- a/tests/utils.cpp
++++ b/tests/utils.cpp
+@@ -1,3 +1,4 @@
++#include <climits>
+ #include <cstdlib>
+ #include <cstring>
+ #include <fcntl.h>
+-- 
+2.51.0
+

Reply via email to