-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Khem Raj <[email protected]>
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...embedded-layer/recipes-devtools/bpftrace/bpftrace/0001-Adjust-to-build-with-llvm-17.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters