summaryrefslogtreecommitdiff
path: root/dev-util/bpftrace/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-19 18:35:20 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-19 18:35:20 +0000
commit810f2cdadf662a6bfaaed425b6ecd216a301cd3d (patch)
treed1b578ce00d7b8ca78dac3989410f667d8e78c06 /dev-util/bpftrace/files
parent1d300fd75dc60cab2ca6e0bb0016b09a4fb7c67a (diff)
gentoo auto-resync : 19:03:2023 - 18:35:20
Diffstat (limited to 'dev-util/bpftrace/files')
-rw-r--r--dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch26
-rw-r--r--dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch44
2 files changed, 70 insertions, 0 deletions
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch
new file mode 100644
index 000000000000..5d845c134bea
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.17.0-llvm-16.patch
@@ -0,0 +1,26 @@
+
+From: https://github.com/iovisor/bpftrace/pull/2528
+
+From a91064d7fb26626d79719c2e2a13cc2acab9549a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 10 Mar 2023 00:08:27 -0800
+Subject: [PATCH] cmake: Raise max llvm major version to 16
+
+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 0a7914f580d..341ac7e9c1f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -165,7 +165,7 @@ else()
+ endif()
+
+ set(MIN_LLVM_MAJOR 6)
+- set(MAX_LLVM_MAJOR 15)
++ set(MAX_LLVM_MAJOR 16)
+
+ if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
+ message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")
diff --git a/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch b/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch
new file mode 100644
index 000000000000..21b4b7e6c267
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.17.0-use-std-optional.patch
@@ -0,0 +1,44 @@
+
+From: https://github.com/iovisor/bpftrace/pull/2525
+
+From a794397394aa836f776da17c8e08876a2f64d477 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Mar 2023 21:30:27 -0700
+Subject: [PATCH] ast: Use std::optional in CodegenLLVM::CodegenLLVM call
+
+Fixes build with clang-16
+
+src/ast/passes/codegen_llvm.cpp:63:53: error: use of undeclared identifier 'Optional'; did you mean 'std::optional'?
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ast/passes/codegen_llvm.cpp | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
+index 616ff89ddbc..fe440adf373 100644
+--- a/src/ast/passes/codegen_llvm.cpp
++++ b/src/ast/passes/codegen_llvm.cpp
+@@ -56,11 +56,17 @@ CodegenLLVM::CodegenLLVM(Node *root, BPFtrace &bpftrace)
+ throw std::runtime_error(
+ "Could not find bpf llvm target, does your llvm support it?");
+
+- target_machine_.reset(target->createTargetMachine(LLVMTargetTriple,
+- "generic",
+- "",
+- TargetOptions(),
+- Optional<Reloc::Model>()));
++ target_machine_.reset(
++ target->createTargetMachine(LLVMTargetTriple,
++ "generic",
++ "",
++ TargetOptions(),
++#if LLVM_VERSION_MAJOR >= 16
++ std::optional<Reloc::Model>()
++#else
++ Optional<Reloc::Model>()
++#endif
++ ));
+ target_machine_->setOptLevel(llvm::CodeGenOpt::Aggressive);
+
+ module_->setTargetTriple(LLVMTargetTriple);