From 8a7c0e808678a95dfdba6689b651f1a0ff0dc206 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Sep 2021 18:17:26 -0700 Subject: bpftrace: Update to latest master Signed-off-by: Khem Raj --- .../0001-support-clang-upto-version-13.patch | 19 ++++--- .../0002-orc-Fix-build-with-clang-13.patch | 62 ++++++++++------------ .../recipes-devtools/bpftrace/bpftrace_0.13.0.bb | 2 +- 3 files changed, 38 insertions(+), 45 deletions(-) (limited to 'dynamic-layers/openembedded-layer') diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch index 6da2fae..d0964ab 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch @@ -1,27 +1,26 @@ -From a01f0fb44e704a8439e431acf47d6fb0eff5bf9d Mon Sep 17 00:00:00 2001 +From 3bbf76b52c9061f37ab963fd9b7d8b527df219ba Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 5 Aug 2021 22:15:27 -0700 Subject: [PATCH 1/2] support clang upto version 13 -Upstream-Status: Submitted [https://github.com/iovisor/bpftrace/pull/1993] Signed-off-by: Khem Raj --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 596b6766..7aab66f1 100644 +index 1b59ba2a..156d8ba9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -164,7 +164,7 @@ else() - find_package(LLVM REQUIRED) +@@ -165,7 +165,7 @@ else() endif() -- if((${LLVM_VERSION_MAJOR} VERSION_LESS 6) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER 12)) -+ if((${LLVM_VERSION_MAJOR} VERSION_LESS 6) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER 13)) - message(SEND_ERROR "Unsupported LLVM version found: ${LLVM_INCLUDE_DIRS}") - message(SEND_ERROR "Specify an LLVM major version using LLVM_REQUESTED_VERSION=") - endif() + set(MIN_LLVM_MAJOR 6) +- set(MAX_LLVM_MAJOR 12) ++ set(MAX_LLVM_MAJOR 13) + + 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}") -- 2.33.0 diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch index a00b006..85f8d6e 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch @@ -1,4 +1,4 @@ -From fbdf215a0ee9002ae65e87673d50dd40d0cfcf78 Mon Sep 17 00:00:00 2001 +From 3bb232ef9eeea769985d550799f6a9d2accaf32a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 4 Sep 2021 17:28:17 -0700 Subject: [PATCH 2/2] orc: Fix build with clang >= 13 @@ -10,15 +10,14 @@ BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) Fixes https://github.com/iovisor/bpftrace/issues/1963 -Upstream-Status: Submitted [https://github.com/iovisor/bpftrace/pull/1993] Signed-off-by: Khem Raj --- - src/ast/bpforc/bpforc.h | 17 ++++++++++++++++- - src/ast/bpforc/bpforcv2.cpp | 28 ++++++++++++++++++++++++++-- - 2 files changed, 42 insertions(+), 3 deletions(-) + src/ast/bpforc/bpforc.h | 18 ++++++++++++++++-- + src/ast/bpforc/bpforcv2.cpp | 23 ++++++++++++----------- + 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/ast/bpforc/bpforc.h b/src/ast/bpforc/bpforc.h -index 1b929dfd..fedfe975 100644 +index 1b929dfd..76913279 100644 --- a/src/ast/bpforc/bpforc.h +++ b/src/ast/bpforc/bpforc.h @@ -72,8 +72,12 @@ private: @@ -34,26 +33,26 @@ index 1b929dfd..fedfe975 100644 #if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 12 std::shared_ptr Resolver; #endif -@@ -98,7 +102,18 @@ private: +@@ -98,7 +102,17 @@ private: #endif public: -+#ifdef LLVM_ORC_V2 +- BpfOrc(TargetMachine *TM, DataLayout DL); ++#if LLVM_VERSION_MAJOR >= 13 + ~BpfOrc() + { + if (auto Err = ES->endSession()) + ES->reportError(std::move(Err)); + } ++#endif + BpfOrc(TargetMachine *TM, + DataLayout DL, + std::unique_ptr ES); -+#else // LLVM_ORC_V1 - BpfOrc(TargetMachine *TM, DataLayout DL); -+#endif ++ void compile(std::unique_ptr M); /* Helper for creating a orc object, responsible for creating internal objects -@@ -134,7 +149,7 @@ public: +@@ -134,7 +148,7 @@ public: #ifdef LLVM_ORC_V2 Expected lookup(StringRef Name) { @@ -63,54 +62,49 @@ index 1b929dfd..fedfe975 100644 #endif }; diff --git a/src/ast/bpforc/bpforcv2.cpp b/src/ast/bpforc/bpforcv2.cpp -index 9876625b..41ec7ca3 100644 +index 9876625b..ca8d214e 100644 --- a/src/ast/bpforc/bpforcv2.cpp +++ b/src/ast/bpforc/bpforcv2.cpp -@@ -1,5 +1,23 @@ +@@ -1,21 +1,21 @@ // Included by bpforc.cpp -+#if LLVM_VERSION_MAJOR >= 13 +-BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) +BpfOrc::BpfOrc(TargetMachine *TM, + DataLayout DL, + std::unique_ptr ES) -+ : TM(std::move(TM)), -+ DL(std::move(DL)), + : TM(std::move(TM)), + DL(std::move(DL)), +- ObjectLayer(ES, +- [this]() { +- return std::make_unique(sections_); +- }), +- CompileLayer(ES, + ES(std::move(ES)), + ObjectLayer(*this->ES, + []() { return std::make_unique(); }), + CompileLayer(*this->ES, -+ ObjectLayer, -+ std::make_unique(*this->TM)), + ObjectLayer, + std::make_unique(*this->TM)), +- Mangle(ES, this->DL), + Mangle(*this->ES, this->DL), -+ CTX(std::make_unique()), + CTX(std::make_unique()), +- MainJD(cantFail(ES.createJITDylib("
"))) + MainJD(cantFail(this->ES->createJITDylib("
"))) -+{ -+} -+#else - BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) - : TM(std::move(TM)), - DL(std::move(DL)), -@@ -16,6 +34,7 @@ BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) { } - -+#endif +- LLVMContext &BpfOrc::getContext() { return *CTX.getContext(); -@@ -34,8 +53,13 @@ std::unique_ptr BpfOrc::Create() +@@ -34,8 +34,9 @@ std::unique_ptr BpfOrc::Create() // return unique_ptrs auto DL = cantFail(JTMB.getDefaultDataLayoutForTarget()); auto TM = cantFail(JTMB.createTargetMachine()); - - return std::make_unique(TM.release(), std::move(DL)); -+#if LLVM_VERSION_MAJOR >= 13 + auto EPC = SelfExecutorProcessControl::Create(); + auto ES = std::make_unique(std::move(*EPC)); + return std::make_unique(TM.release(), std::move(DL), std::move(ES)); -+#else -+ return std::make_unique(TM.release(), std::move(DL), 0); -+#endif } void BpfOrc::compile(std::unique_ptr M) diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb index 09d1fd2..f521d33 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb @@ -20,7 +20,7 @@ SRC_URI = "git://github.com/iovisor/bpftrace;branch=master \ file://0001-support-clang-upto-version-13.patch \ file://0002-orc-Fix-build-with-clang-13.patch \ " -SRCREV = "283fe526dfc262fdecddec4beb921835ea0cc89e" +SRCREV = "9b929db174be11888f60d16b1b090e4603bc3a51" S = "${WORKDIR}/git" -- cgit v1.2.3-54-g00ecf