import bpftrace-0.12.1-4.el8
This commit is contained in:
parent
92ce378487
commit
06264cc5c2
132
SOURCES/bpftrace-0.12.1-orc-Fix-build-with-clang-13.patch
Normal file
132
SOURCES/bpftrace-0.12.1-orc-Fix-build-with-clang-13.patch
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
From 3bde9d98aa48b9c7eba9fe559dee6c66d8b57634 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Khem Raj <raj.khem@gmail.com>
|
||||||
|
Date: Sat, 4 Sep 2021 17:28:17 -0700
|
||||||
|
Subject: [PATCH] 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 <raj.khem@gmail.com>
|
||||||
|
---
|
||||||
|
src/bpforc.h | 23 ++++++++++++++++++++++-
|
||||||
|
src/bpforcv2.cpp | 23 +++++++++++++++--------
|
||||||
|
2 files changed, 37 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/bpforc.h b/src/bpforc.h
|
||||||
|
index 5634c544..1900e497 100644
|
||||||
|
--- a/src/bpforc.h
|
||||||
|
+++ b/src/bpforc.h
|
||||||
|
@@ -20,6 +20,9 @@
|
||||||
|
#ifdef LLVM_ORC_V2
|
||||||
|
#include <llvm/ExecutionEngine/Orc/Core.h>
|
||||||
|
#include <llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h>
|
||||||
|
+#if LLVM_VERSION_MAJOR >= 13
|
||||||
|
+#include <llvm/ExecutionEngine/Orc/ExecutorProcessControl.h>
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
@@ -66,8 +69,12 @@ class BpfOrc
|
||||||
|
std::unique_ptr<TargetMachine> TM;
|
||||||
|
DataLayout DL;
|
||||||
|
#if LLVM_VERSION_MAJOR >= 7
|
||||||
|
+#ifdef LLVM_ORC_V2
|
||||||
|
+ std::unique_ptr<ExecutionSession> ES;
|
||||||
|
+#else // LLVM_ORC_V1
|
||||||
|
ExecutionSession ES;
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 12
|
||||||
|
std::shared_ptr<SymbolResolver> Resolver;
|
||||||
|
#endif
|
||||||
|
@@ -92,7 +99,21 @@ class BpfOrc
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
|
+#if LLVM_VERSION_MAJOR >= 13
|
||||||
|
+ ~BpfOrc()
|
||||||
|
+ {
|
||||||
|
+ if (auto Err = ES->endSession())
|
||||||
|
+ ES->reportError(std::move(Err));
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+#ifdef LLVM_ORC_V2
|
||||||
|
+ BpfOrc(TargetMachine *TM,
|
||||||
|
+ DataLayout DL,
|
||||||
|
+ std::unique_ptr<ExecutionSession> ES);
|
||||||
|
+#else
|
||||||
|
BpfOrc(TargetMachine *TM, DataLayout DL);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
void compile(std::unique_ptr<Module> M);
|
||||||
|
|
||||||
|
/* Helper for creating a orc object, responsible for creating internal objects
|
||||||
|
@@ -125,7 +146,7 @@ class BpfOrc
|
||||||
|
#ifdef LLVM_ORC_V2
|
||||||
|
Expected<JITEvaluatedSymbol> lookup(StringRef Name)
|
||||||
|
{
|
||||||
|
- return ES.lookup({ &MainJD }, Mangle(Name.str()));
|
||||||
|
+ return ES->lookup({ &MainJD }, Mangle(Name.str()));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
diff --git a/src/bpforcv2.cpp b/src/bpforcv2.cpp
|
||||||
|
index 209e08e5..104213b0 100644
|
||||||
|
--- a/src/bpforcv2.cpp
|
||||||
|
+++ b/src/bpforcv2.cpp
|
||||||
|
@@ -1,24 +1,26 @@
|
||||||
|
// Included by bpforc.cpp
|
||||||
|
|
||||||
|
-BpfOrc::BpfOrc(TargetMachine *TM, DataLayout DL)
|
||||||
|
+BpfOrc::BpfOrc(TargetMachine *TM,
|
||||||
|
+ DataLayout DL,
|
||||||
|
+ std::unique_ptr<ExecutionSession> ES)
|
||||||
|
: TM(std::move(TM)),
|
||||||
|
DL(std::move(DL)),
|
||||||
|
- ObjectLayer(ES,
|
||||||
|
+ ES(std::move(ES)),
|
||||||
|
+ ObjectLayer(*(this->ES),
|
||||||
|
[this]() {
|
||||||
|
return std::make_unique<MemoryManager>(sections_);
|
||||||
|
}),
|
||||||
|
- CompileLayer(ES,
|
||||||
|
+ CompileLayer(*this->ES,
|
||||||
|
ObjectLayer,
|
||||||
|
std::make_unique<SimpleCompiler>(*this->TM)),
|
||||||
|
- Mangle(ES, this->DL),
|
||||||
|
+ Mangle(*this->ES, this->DL),
|
||||||
|
CTX(std::make_unique<LLVMContext>()),
|
||||||
|
- MainJD(cantFail(ES.createJITDylib("<main>")))
|
||||||
|
+ MainJD(cantFail(this->ES->createJITDylib("<main>")))
|
||||||
|
{
|
||||||
|
MainJD.addGenerator(
|
||||||
|
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
|
||||||
|
DL.getGlobalPrefix())));
|
||||||
|
}
|
||||||
|
-
|
||||||
|
LLVMContext &BpfOrc::getContext()
|
||||||
|
{
|
||||||
|
return *CTX.getContext();
|
||||||
|
@@ -37,8 +39,13 @@ std::unique_ptr<BpfOrc> BpfOrc::Create()
|
||||||
|
// return unique_ptrs
|
||||||
|
auto DL = cantFail(JTMB.getDefaultDataLayoutForTarget());
|
||||||
|
auto TM = cantFail(JTMB.createTargetMachine());
|
||||||
|
-
|
||||||
|
- return std::make_unique<BpfOrc>(TM.release(), std::move(DL));
|
||||||
|
+#if LLVM_VERSION_MAJOR >= 13
|
||||||
|
+ auto EPC = SelfExecutorProcessControl::Create();
|
||||||
|
+ auto ES = std::make_unique<ExecutionSession>(std::move(*EPC));
|
||||||
|
+#else
|
||||||
|
+ auto ES = std::make_unique<ExecutionSession>();
|
||||||
|
+#endif
|
||||||
|
+ return std::make_unique<BpfOrc>(TM.release(), std::move(DL), std::move(ES));
|
||||||
|
}
|
||||||
|
|
||||||
|
void BpfOrc::compile(std::unique_ptr<Module> M)
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
Name: bpftrace
|
Name: bpftrace
|
||||||
Version: 0.12.1
|
Version: 0.12.1
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: High-level tracing language for Linux eBPF
|
Summary: High-level tracing language for Linux eBPF
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
|
|
||||||
URL: https://github.com/iovisor/bpftrace
|
URL: https://github.com/iovisor/bpftrace
|
||||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
Patch0: %{name}-%{version}-RHEL-8-fixes.patch
|
Patch0: %{name}-%{version}-RHEL-8-fixes.patch
|
||||||
# WARNING: because of the arch-specific patch, no autosetup is used
|
Patch1: %{name}-%{version}-orc-Fix-build-with-clang-13.patch
|
||||||
# Remember to patch accordingly
|
|
||||||
Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch
|
Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch
|
||||||
|
|
||||||
# Arches will be included as upstream support is added and dependencies are
|
# Arches will be included as upstream support is added and dependencies are
|
||||||
@ -48,9 +48,8 @@ and predecessor tracers such as DTrace and SystemTap
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup
|
%autosetup -N
|
||||||
|
%autopatch -p1 -M 9
|
||||||
%patch0 -p1
|
|
||||||
|
|
||||||
%ifarch aarch64
|
%ifarch aarch64
|
||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
@ -96,6 +95,10 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-4
|
||||||
|
- Rebuild on LLVM13
|
||||||
|
- Small spec cleanup
|
||||||
|
|
||||||
* Thu Jun 24 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
|
* Thu Jun 24 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
|
||||||
- Have threadsnoop points to libpthread.so.0
|
- Have threadsnoop points to libpthread.so.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user