Blame SOURCES/0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch

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