Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bpftrace to 0.18.0 #819

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 3aa0c5caadb03b1c30d0ac366dbc7b592076dc43 Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Thu, 6 Jul 2023 08:59:41 -0700
Subject: [PATCH] Adjust to build with llvm 17

PassManagerBuilder has been removed in llvm 17
itaniumDemangle() API signature has changed too

Upstream-Status: Submitted [https://github.com/iovisor/bpftrace/pull/2667]
Signed-off-by: Khem Raj <[email protected]>
---
src/ast/passes/codegen_llvm.cpp | 4 ++++
src/cxxdemangler/cxxdemangler_llvm.cpp | 4 ++++
2 files changed, 8 insertions(+)

diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
index 1af2a23e..49ab8c9d 100644
--- a/src/ast/passes/codegen_llvm.cpp
+++ b/src/ast/passes/codegen_llvm.cpp
@@ -7,7 +7,9 @@
#include <ctime>
#include <fstream>

+#if LLVM_VERSION_MAJOR <= 16
#include <llvm-c/Transforms/IPO.h>
+#endif
#include <llvm/IR/Constants.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/LegacyPassManager.h>
@@ -17,7 +19,9 @@
#include <llvm/Passes/PassBuilder.h>
#endif
#include <llvm/Transforms/IPO.h>
+#if LLVM_VERSION_MAJOR <= 16
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
+#endif
#if LLVM_VERSION_MAJOR >= 14
#include <llvm/MC/TargetRegistry.h>
#else
diff --git a/src/cxxdemangler/cxxdemangler_llvm.cpp b/src/cxxdemangler/cxxdemangler_llvm.cpp
index e9a9db24..1b0bf7ea 100644
--- a/src/cxxdemangler/cxxdemangler_llvm.cpp
+++ b/src/cxxdemangler/cxxdemangler_llvm.cpp
@@ -6,7 +6,11 @@ namespace bpftrace {

char* cxxdemangle(const char* mangled)
{
+#if LLVM_VERSION_MAJOR <= 16
return llvm::itaniumDemangle(mangled, nullptr, nullptr, nullptr);
+#else
+ return llvm::itaniumDemangle(mangled);
+#endif
}

} // namespace bpftrace
--
2.41.0

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Signed-off-by: Khem Raj <[email protected]>
endif()

set(MIN_LLVM_MAJOR 6)
- set(MAX_LLVM_MAJOR 15)
+ set(MAX_LLVM_MAJOR 16)
- set(MAX_LLVM_MAJOR 16)
+ set(MAX_LLVM_MAJOR 17)

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}")
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ RDEPENDS:${PN} += "bash python3 xz"

SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \
file://0001-cmake-Raise-max-llvm-major-version-to-16.patch \
file://0001-Adjust-to-build-with-llvm-17.patch \
file://run-ptest \
"
SRCREV = "70ee22cb14e2eedc5df17e53965824d7381f8e6f"
SRCREV = "e199c7e73da84bff9fe744d1e3402c2b505aa5a2"

S = "${WORKDIR}/git"

Expand Down