From 82c6305dbb42b4f85ca6cb5242dec0efa315850f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 14 Feb 2022 11:37:58 -0800 Subject: bpftrace: Upgrade to 0.14.1 Signed-off-by: Khem Raj --- .../0001-support-clang-upto-version-13.patch | 26 ----- .../0002-orc-Fix-build-with-clang-13.patch | 113 --------------------- .../recipes-devtools/bpftrace/bpftrace_0.13.0.bb | 38 ------- .../recipes-devtools/bpftrace/bpftrace_0.14.1.bb | 42 ++++++++ 4 files changed, 42 insertions(+), 177 deletions(-) delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0001-support-clang-upto-version-13.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/0002-orc-Fix-build-with-clang-13.patch delete mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb create mode 100644 dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb (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 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 @@ -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 - -Signed-off-by: Khem Raj ---- - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1b59ba2a..156d8ba9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -165,7 +165,7 @@ else() - 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 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 @@ -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 - -Fixes errors like -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 -BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) - ^ - -Fixes https://github.com/iovisor/bpftrace/issues/1963 - -Signed-off-by: Khem Raj ---- - 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..76913279 100644 ---- a/src/ast/bpforc/bpforc.h -+++ b/src/ast/bpforc/bpforc.h -@@ -72,8 +72,12 @@ private: - std::unique_ptr TM; - DataLayout DL; - #if LLVM_VERSION_MAJOR >= 7 -+#ifdef LLVM_ORC_V2 -+ std::unique_ptr ES; -+#else // LLVM_ORC_V1 - ExecutionSession ES; - #endif -+#endif - #if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 12 - std::shared_ptr Resolver; - #endif -@@ -98,7 +102,17 @@ private: - #endif - - public: -- 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); -+ - void compile(std::unique_ptr M); - - /* Helper for creating a orc object, responsible for creating internal objects -@@ -134,7 +148,7 @@ public: - #ifdef LLVM_ORC_V2 - Expected lookup(StringRef Name) - { -- return ES.lookup({ &MainJD }, Mangle(Name.str())); -+ return ES->lookup({ &MainJD }, Mangle(Name.str())); - } - #endif - }; -diff --git a/src/ast/bpforc/bpforcv2.cpp b/src/ast/bpforc/bpforcv2.cpp -index 9876625b..ca8d214e 100644 ---- a/src/ast/bpforc/bpforcv2.cpp -+++ b/src/ast/bpforc/bpforcv2.cpp -@@ -1,21 +1,21 @@ - // Included by bpforc.cpp - --BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL) -+BpfOrc::BpfOrc(TargetMachine *TM, -+ DataLayout DL, -+ std::unique_ptr ES) - : 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)), -- Mangle(ES, this->DL), -+ Mangle(*this->ES, this->DL), - CTX(std::make_unique()), -- MainJD(cantFail(ES.createJITDylib("
"))) -+ MainJD(cantFail(this->ES->createJITDylib("
"))) - { - } -- - LLVMContext &BpfOrc::getContext() - { - return *CTX.getContext(); -@@ -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)); -+ auto EPC = SelfExecutorProcessControl::Create(); -+ auto ES = std::make_unique(std::move(*EPC)); -+ return std::make_unique(TM.release(), std::move(DL), std::move(ES)); - } - - void BpfOrc::compile(std::unique_ptr M) --- -2.33.0 - 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 deleted file mode 100644 index f521d33..0000000 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.13.0.bb +++ /dev/null @@ -1,38 +0,0 @@ -SUMMARY = "bpftrace" -HOMEPAGE = "https://github.com/iovisor/bpftrace" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" - -DEPENDS += "bison-native \ - flex-native \ - gzip-native \ - elfutils \ - bcc \ - systemtap \ - libcereal \ - libbpf \ - " - -PV .= "+git${SRCREV}" -RDEPENDS:${PN} += "bash python3 xz" - -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 = "9b929db174be11888f60d16b1b090e4603bc3a51" - -S = "${WORKDIR}/git" - -inherit cmake - -EXTRA_OECMAKE = " \ - -DCMAKE_ENABLE_EXPORTS=1 \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_REQUESTED_VERSION=13 \ - -DBUILD_TESTING=OFF \ - -DENABLE_MAN=OFF \ -" - -COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*)-linux" -COMPATIBLE_HOST:libc-musl = "null" diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb new file mode 100644 index 0000000..21078b9 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.14.1.bb @@ -0,0 +1,42 @@ +SUMMARY = "bpftrace" +HOMEPAGE = "https://github.com/iovisor/bpftrace" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +DEPENDS += "bison-native \ + flex-native \ + gzip-native \ + elfutils \ + bcc \ + systemtap \ + libcereal \ + libbpf \ + " + +#PV .= "+git${SRCREV}" +RDEPENDS:${PN} += "bash python3 xz" + +SRC_URI = "git://github.com/iovisor/bpftrace;branch=v0.14_release;protocol=https \ + " +SRCREV = "20e48420ba3a5c6f3630ab25b6b5c28d950b5bb4" + +S = "${WORKDIR}/git" + +inherit cmake + +def llvm_major_version(d): + pvsplit = d.getVar('LLVMVERSION').split('.') + return pvsplit[0] + +LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}" + +EXTRA_OECMAKE = " \ + -DCMAKE_ENABLE_EXPORTS=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \ + -DBUILD_TESTING=OFF \ + -DENABLE_MAN=OFF \ +" + +COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*)-linux" +COMPATIBLE_HOST:libc-musl = "null" -- cgit v1.2.3-54-g00ecf