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@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@gentoo.org>
This commit is contained in:
Holger Hoffstätte
2025-09-18 14:15:45 +02:00
committed by Sam James
parent 475bae4697
commit e1f5e2e8d5
2 changed files with 67 additions and 0 deletions

View File

@@ -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() {

View File

@@ -0,0 +1,65 @@
From: https://github.com/bpftrace/bpftrace/pull/4614
From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
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 <holger@applied-asynchrony.com>
---
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