|
|
5cdef2 |
From f4d4ada2e920136870468f43e0f3c1efa265f2f7 Mon Sep 17 00:00:00 2001
|
|
|
5cdef2 |
From: serge-sans-paille <sguelton@redhat.com>
|
|
|
5cdef2 |
Date: Thu, 25 Feb 2021 14:12:57 +0100
|
|
|
5cdef2 |
Subject: [PATCH] [PATCH][compiler-rt] Workaround libstdc++ limitation wrt.
|
|
|
5cdef2 |
thread copy
|
|
|
5cdef2 |
|
|
|
5cdef2 |
---
|
|
|
5cdef2 |
compiler-rt/lib/fuzzer/FuzzerDefs.h | 6 ++++++
|
|
|
5cdef2 |
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 2 +-
|
|
|
5cdef2 |
2 files changed, 7 insertions(+), 1 deletion(-)
|
|
|
5cdef2 |
|
|
|
5cdef2 |
diff --git a/compiler-rt/lib/fuzzer/FuzzerDefs.h b/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
|
|
5cdef2 |
index 1a2752a..abfbb8d 100644
|
|
|
5cdef2 |
--- a/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
|
|
5cdef2 |
+++ b/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
|
|
5cdef2 |
@@ -50,6 +50,12 @@ template<typename T>
|
|
|
5cdef2 |
|
|
|
5cdef2 |
template<class Other>
|
|
|
5cdef2 |
struct rebind { typedef fuzzer_allocator<Other> other; };
|
|
|
5cdef2 |
+
|
|
|
5cdef2 |
+ template< class U, class... Args >
|
|
|
5cdef2 |
+ void construct( U* p, Args&&... args ) {
|
|
|
5cdef2 |
+ std::allocator<T>::construct(p, std::forward<Args>(args)...);
|
|
|
5cdef2 |
+ }
|
|
|
5cdef2 |
+
|
|
|
5cdef2 |
};
|
|
|
5cdef2 |
|
|
|
5cdef2 |
template<typename T>
|
|
|
5cdef2 |
diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
|
|
5cdef2 |
index 447cafc..2fce139 100644
|
|
|
5cdef2 |
--- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
|
|
5cdef2 |
+++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
|
|
5cdef2 |
@@ -294,7 +294,7 @@ static int RunInMultipleProcesses(const Vector<std::string> &Args,
|
|
|
5cdef2 |
std::thread Pulse(PulseThread);
|
|
|
5cdef2 |
Pulse.detach();
|
|
|
5cdef2 |
for (unsigned i = 0; i < NumWorkers; i++)
|
|
|
5cdef2 |
- V.push_back(std::thread(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors));
|
|
|
5cdef2 |
+ V.emplace_back(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors);
|
|
|
5cdef2 |
for (auto &T : V)
|
|
|
5cdef2 |
T.join();
|
|
|
5cdef2 |
return HasErrors ? 1 : 0;
|
|
|
5cdef2 |
--
|
|
|
5cdef2 |
1.8.3.1
|
|
|
5cdef2 |
|