diff options
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch | 26 | ||||
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch | 113 | ||||
| -rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb (renamed from dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb) | 16 |
3 files changed, 10 insertions, 145 deletions
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 deleted file mode 100644 index d0964ab..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | From 3bbf76b52c9061f37ab963fd9b7d8b527df219ba Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 5 Aug 2021 22:15:27 -0700 | ||
| 4 | Subject: [PATCH 1/2] support clang upto version 13 | ||
| 5 | |||
| 6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 7 | --- | ||
| 8 | CMakeLists.txt | 2 +- | ||
| 9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 10 | |||
| 11 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 12 | index 1b59ba2a..156d8ba9 100644 | ||
| 13 | --- a/CMakeLists.txt | ||
| 14 | +++ b/CMakeLists.txt | ||
| 15 | @@ -165,7 +165,7 @@ else() | ||
| 16 | endif() | ||
| 17 | |||
| 18 | set(MIN_LLVM_MAJOR 6) | ||
| 19 | - set(MAX_LLVM_MAJOR 12) | ||
| 20 | + set(MAX_LLVM_MAJOR 13) | ||
| 21 | |||
| 22 | if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR})) | ||
| 23 | message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}") | ||
| 24 | -- | ||
| 25 | 2.33.0 | ||
| 26 | |||
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 deleted file mode 100644 index 85f8d6e..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch +++ /dev/null | |||
| @@ -1,113 +0,0 @@ | |||
| 1 | From 3bb232ef9eeea769985d550799f6a9d2accaf32a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 4 Sep 2021 17:28:17 -0700 | ||
| 4 | Subject: [PATCH 2/2] orc: Fix build with clang >= 13 | ||
| 5 | |||
| 6 | Fixes errors like | ||
| 7 | src/ast/bpforc/bpforcv2.cpp:3:9: error: constructor for 'bpftrace::BpfOrc' must explicitly initialize the member 'ES' which does not have a default constructor | ||
| 8 | BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) | ||
| 9 | ^ | ||
| 10 | |||
| 11 | Fixes https://github.com/iovisor/bpftrace/issues/1963 | ||
| 12 | |||
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 14 | --- | ||
| 15 | src/ast/bpforc/bpforc.h | 18 ++++++++++++++++-- | ||
| 16 | src/ast/bpforc/bpforcv2.cpp | 23 ++++++++++++----------- | ||
| 17 | 2 files changed, 28 insertions(+), 13 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/src/ast/bpforc/bpforc.h b/src/ast/bpforc/bpforc.h | ||
| 20 | index 1b929dfd..76913279 100644 | ||
| 21 | --- a/src/ast/bpforc/bpforc.h | ||
| 22 | +++ b/src/ast/bpforc/bpforc.h | ||
| 23 | @@ -72,8 +72,12 @@ private: | ||
| 24 | std::unique_ptr<TargetMachine> TM; | ||
| 25 | DataLayout DL; | ||
| 26 | #if LLVM_VERSION_MAJOR >= 7 | ||
| 27 | +#ifdef LLVM_ORC_V2 | ||
| 28 | + std::unique_ptr<ExecutionSession> ES; | ||
| 29 | +#else // LLVM_ORC_V1 | ||
| 30 | ExecutionSession ES; | ||
| 31 | #endif | ||
| 32 | +#endif | ||
| 33 | #if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 12 | ||
| 34 | std::shared_ptr<SymbolResolver> Resolver; | ||
| 35 | #endif | ||
| 36 | @@ -98,7 +102,17 @@ private: | ||
| 37 | #endif | ||
| 38 | |||
| 39 | public: | ||
| 40 | - BpfOrc(TargetMachine *TM, DataLayout DL); | ||
| 41 | +#if LLVM_VERSION_MAJOR >= 13 | ||
| 42 | + ~BpfOrc() | ||
| 43 | + { | ||
| 44 | + if (auto Err = ES->endSession()) | ||
| 45 | + ES->reportError(std::move(Err)); | ||
| 46 | + } | ||
| 47 | +#endif | ||
| 48 | + BpfOrc(TargetMachine *TM, | ||
| 49 | + DataLayout DL, | ||
| 50 | + std::unique_ptr<ExecutionSession> ES); | ||
| 51 | + | ||
| 52 | void compile(std::unique_ptr<Module> M); | ||
| 53 | |||
| 54 | /* Helper for creating a orc object, responsible for creating internal objects | ||
| 55 | @@ -134,7 +148,7 @@ public: | ||
| 56 | #ifdef LLVM_ORC_V2 | ||
| 57 | Expected<JITEvaluatedSymbol> lookup(StringRef Name) | ||
| 58 | { | ||
| 59 | - return ES.lookup({ &MainJD }, Mangle(Name.str())); | ||
| 60 | + return ES->lookup({ &MainJD }, Mangle(Name.str())); | ||
| 61 | } | ||
| 62 | #endif | ||
| 63 | }; | ||
| 64 | diff --git a/src/ast/bpforc/bpforcv2.cpp b/src/ast/bpforc/bpforcv2.cpp | ||
| 65 | index 9876625b..ca8d214e 100644 | ||
| 66 | --- a/src/ast/bpforc/bpforcv2.cpp | ||
| 67 | +++ b/src/ast/bpforc/bpforcv2.cpp | ||
| 68 | @@ -1,21 +1,21 @@ | ||
| 69 | // Included by bpforc.cpp | ||
| 70 | |||
| 71 | -BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) | ||
| 72 | +BpfOrc::BpfOrc(TargetMachine *TM, | ||
| 73 | + DataLayout DL, | ||
| 74 | + std::unique_ptr<ExecutionSession> ES) | ||
| 75 | : TM(std::move(TM)), | ||
| 76 | DL(std::move(DL)), | ||
| 77 | - ObjectLayer(ES, | ||
| 78 | - [this]() { | ||
| 79 | - return std::make_unique<MemoryManager>(sections_); | ||
| 80 | - }), | ||
| 81 | - CompileLayer(ES, | ||
| 82 | + ES(std::move(ES)), | ||
| 83 | + ObjectLayer(*this->ES, | ||
| 84 | + []() { return std::make_unique<SectionMemoryManager>(); }), | ||
| 85 | + CompileLayer(*this->ES, | ||
| 86 | ObjectLayer, | ||
| 87 | std::make_unique<SimpleCompiler>(*this->TM)), | ||
| 88 | - Mangle(ES, this->DL), | ||
| 89 | + Mangle(*this->ES, this->DL), | ||
| 90 | CTX(std::make_unique<LLVMContext>()), | ||
| 91 | - MainJD(cantFail(ES.createJITDylib("<main>"))) | ||
| 92 | + MainJD(cantFail(this->ES->createJITDylib("<main>"))) | ||
| 93 | { | ||
| 94 | } | ||
| 95 | - | ||
| 96 | LLVMContext &BpfOrc::getContext() | ||
| 97 | { | ||
| 98 | return *CTX.getContext(); | ||
| 99 | @@ -34,8 +34,9 @@ std::unique_ptr<BpfOrc> BpfOrc::Create() | ||
| 100 | // return unique_ptrs | ||
| 101 | auto DL = cantFail(JTMB.getDefaultDataLayoutForTarget()); | ||
| 102 | auto TM = cantFail(JTMB.createTargetMachine()); | ||
| 103 | - | ||
| 104 | - return std::make_unique<BpfOrc>(TM.release(), std::move(DL)); | ||
| 105 | + auto EPC = SelfExecutorProcessControl::Create(); | ||
| 106 | + auto ES = std::make_unique<ExecutionSession>(std::move(*EPC)); | ||
| 107 | + return std::make_unique<BpfOrc>(TM.release(), std::move(DL), std::move(ES)); | ||
| 108 | } | ||
| 109 | |||
| 110 | void BpfOrc::compile(std::unique_ptr<Module> M) | ||
| 111 | -- | ||
| 112 | 2.33.0 | ||
| 113 | |||
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.14.1.bb index f521d33..21078b9 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb | |||
| @@ -13,23 +13,27 @@ DEPENDS += "bison-native \ | |||
| 13 | libbpf \ | 13 | libbpf \ |
| 14 | " | 14 | " |
| 15 | 15 | ||
| 16 | PV .= "+git${SRCREV}" | 16 | #PV .= "+git${SRCREV}" |
| 17 | RDEPENDS:${PN} += "bash python3 xz" | 17 | RDEPENDS:${PN} += "bash python3 xz" |
| 18 | 18 | ||
| 19 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=master \ | 19 | SRC_URI = "git://github.com/iovisor/bpftrace;branch=v0.14_release;protocol=https \ |
| 20 | file://0001-support-clang-upto-version-13.patch \ | ||
| 21 | file://0002-orc-Fix-build-with-clang-13.patch \ | ||
| 22 | " | 20 | " |
| 23 | SRCREV = "9b929db174be11888f60d16b1b090e4603bc3a51" | 21 | SRCREV = "20e48420ba3a5c6f3630ab25b6b5c28d950b5bb4" |
| 24 | 22 | ||
| 25 | S = "${WORKDIR}/git" | 23 | S = "${WORKDIR}/git" |
| 26 | 24 | ||
| 27 | inherit cmake | 25 | inherit cmake |
| 28 | 26 | ||
| 27 | def llvm_major_version(d): | ||
| 28 | pvsplit = d.getVar('LLVMVERSION').split('.') | ||
| 29 | return pvsplit[0] | ||
| 30 | |||
| 31 | LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}" | ||
| 32 | |||
| 29 | EXTRA_OECMAKE = " \ | 33 | EXTRA_OECMAKE = " \ |
| 30 | -DCMAKE_ENABLE_EXPORTS=1 \ | 34 | -DCMAKE_ENABLE_EXPORTS=1 \ |
| 31 | -DCMAKE_BUILD_TYPE=Release \ | 35 | -DCMAKE_BUILD_TYPE=Release \ |
| 32 | -DLLVM_REQUESTED_VERSION=13 \ | 36 | -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \ |
| 33 | -DBUILD_TESTING=OFF \ | 37 | -DBUILD_TESTING=OFF \ |
| 34 | -DENABLE_MAN=OFF \ | 38 | -DENABLE_MAN=OFF \ |
| 35 | " | 39 | " |
