From 0d55693c14cad4c851d4b17e83f2d99fc5d9a5b6 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Fri, 31 May 2024 16:30:19 +0000 Subject: [PATCH] Import from AlmaLinux stable repository --- .bpftrace.metadata | 2 - ...-0.16.0-Adjust-to-build-with-llvm-17.patch | 90 +++++++++++++++++++ ...e-Raise-max-llvm-major-version-to-16.patch | 26 ++++++ SPECS/bpftrace.spec | 16 +++- 4 files changed, 131 insertions(+), 3 deletions(-) delete mode 100644 .bpftrace.metadata create mode 100644 SOURCES/bpftrace-0.16.0-Adjust-to-build-with-llvm-17.patch create mode 100644 SOURCES/bpftrace-0.16.0-cmake-Raise-max-llvm-major-version-to-16.patch diff --git a/.bpftrace.metadata b/.bpftrace.metadata deleted file mode 100644 index fd41863..0000000 --- a/.bpftrace.metadata +++ /dev/null @@ -1,2 +0,0 @@ -90dc7733b42f9eca714d2d87a4577c9b0a232293 SOURCES/bpftrace-0.16.0.tar.gz -974ee680e1eb103c415832d69742e194b661da5c SOURCES/cereal-1.3.2.tar.gz diff --git a/SOURCES/bpftrace-0.16.0-Adjust-to-build-with-llvm-17.patch b/SOURCES/bpftrace-0.16.0-Adjust-to-build-with-llvm-17.patch new file mode 100644 index 0000000..966f9a1 --- /dev/null +++ b/SOURCES/bpftrace-0.16.0-Adjust-to-build-with-llvm-17.patch @@ -0,0 +1,90 @@ +From 45f0302773923accd7cc324d839b733c27c92f38 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 6 Jul 2023 08:59:41 -0700 +Subject: [PATCH] Adjust to build with llvm 17 + +- PassManagerBuilder has been removed +- itaniumDemangle() API signature has changed +- update MAX_LLVM_MAJOR in CMakeLists.txt +- update bcc and libbpf submodules to their latest versions to allow + building bcc with llvm 17 +- replaced JITEvaluatedSymbol by ExecutorSymbolDef in ORC + +Signed-off-by: Khem Raj +Signed-off-by: Viktor Malik +--- + CMakeLists.txt | 2 +- + src/ast/bpforc/bpforc.h | 2 +- + src/ast/passes/codegen_llvm.cpp | 4 ++++ + src/cxxdemangler/cxxdemangler_llvm.cpp | 4 ++++ + 4 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 433153be..a11a5c36 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -169,7 +169,7 @@ else() + endif() + + set(MIN_LLVM_MAJOR 6) +- 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}") +diff --git a/src/ast/bpforc/bpforc.h b/src/ast/bpforc/bpforc.h +index 58914419..8d2f1e63 100644 +--- a/src/ast/bpforc/bpforc.h ++++ b/src/ast/bpforc/bpforc.h +@@ -157,7 +157,7 @@ public: + } + + #ifdef LLVM_ORC_V2 +- Expected lookup(StringRef Name) ++ Expected lookup(StringRef Name) + { + return ES->lookup({ &MainJD }, Mangle(Name.str())); + } +diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp +index 2b888087..a75a0fd1 100644 +--- a/src/ast/passes/codegen_llvm.cpp ++++ b/src/ast/passes/codegen_llvm.cpp +@@ -7,7 +7,9 @@ + #include + #include + ++#if LLVM_VERSION_MAJOR <= 16 + #include ++#endif + #include + #include + #include +@@ -17,7 +19,9 @@ + #include + #endif + #include ++#if LLVM_VERSION_MAJOR <= 16 + #include ++#endif + + #include "arch/arch.h" + #include "ast.h" +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 + diff --git a/SOURCES/bpftrace-0.16.0-cmake-Raise-max-llvm-major-version-to-16.patch b/SOURCES/bpftrace-0.16.0-cmake-Raise-max-llvm-major-version-to-16.patch new file mode 100644 index 0000000..ac00f70 --- /dev/null +++ b/SOURCES/bpftrace-0.16.0-cmake-Raise-max-llvm-major-version-to-16.patch @@ -0,0 +1,26 @@ +From b74ab9e00b4628e0d8607c6ead8a674bedf280b9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 10 Mar 2023 00:08:27 -0800 +Subject: [PATCH] cmake: Raise max llvm major version to 16 + +Signed-off-by: Khem Raj +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e63bc83c..433153be 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -169,7 +169,7 @@ else() + endif() + + set(MIN_LLVM_MAJOR 6) +- set(MAX_LLVM_MAJOR 15) ++ set(MAX_LLVM_MAJOR 16) + + 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.40.1 + diff --git a/SPECS/bpftrace.spec b/SPECS/bpftrace.spec index 23e4d66..65213ea 100644 --- a/SPECS/bpftrace.spec +++ b/SPECS/bpftrace.spec @@ -2,7 +2,7 @@ Name: bpftrace Version: 0.16.0 -Release: 1%{?dist} +Release: 5%{?dist} Summary: High-level tracing language for Linux eBPF License: ASL 2.0 @@ -19,6 +19,8 @@ Patch0: %{name}-%{version}-IR-builder-get-rid-of-getPointerElementType-c Patch1: %{name}-%{version}-tools-old-mdflush.bt-fix-BPFTRACE_HAVE_BTF-macro.patch Patch2: %{name}-%{version}-tcpdrop-Fix-ERROR-Error-attaching-probe-kprobe-tcp_d.patch Patch3: %{name}-%{version}-RHEL8-remove-not-existing-attachpoints-from-tools.patch +Patch4: %{name}-%{version}-cmake-Raise-max-llvm-major-version-to-16.patch +Patch5: %{name}-%{version}-Adjust-to-build-with-llvm-17.patch Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch # Arches will be included as upstream support is added and dependencies are @@ -110,6 +112,18 @@ cp %{buildroot}/%{_datadir}/%{name}/tools/old/mdflush.bt %{buildroot}/%{_datadir %exclude %{_datadir}/%{name}/tools/old %changelog +* Mon Nov 06 2023 - 0.16.0-5 +- Rebuild for LLVM17 +- Resolves: RHEL-10690 + +* Fri Jun 09 2023 Viktor Malik - 0.16.0-3 +- Add forgotten patch raising LLVM version in CMake +- Resolves: rhbz#2192950 + +* Fri Jun 09 2023 Viktor Malik - 0.16.0-2 +- Rebuild for LLVM16 +- Resolves: rhbz#2192950 + * Wed Nov 30 2022 Viktor Malik - 0.16.0-1 - Rebase on bpftrace 0.16.0 - Rebuild for LLVM15