diff --git a/0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch b/0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch new file mode 100644 index 0000000..047e658 --- /dev/null +++ b/0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch @@ -0,0 +1,44 @@ +From f4d4ada2e920136870468f43e0f3c1efa265f2f7 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Thu, 25 Feb 2021 14:12:57 +0100 +Subject: [PATCH] [PATCH][compiler-rt] Workaround libstdc++ limitation wrt. + thread copy + +--- + compiler-rt/lib/fuzzer/FuzzerDefs.h | 6 ++++++ + compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/fuzzer/FuzzerDefs.h b/compiler-rt/lib/fuzzer/FuzzerDefs.h +index 1a2752a..abfbb8d 100644 +--- a/compiler-rt/lib/fuzzer/FuzzerDefs.h ++++ b/compiler-rt/lib/fuzzer/FuzzerDefs.h +@@ -50,6 +50,12 @@ template + + template + struct rebind { typedef fuzzer_allocator other; }; ++ ++ template< class U, class... Args > ++ void construct( U* p, Args&&... args ) { ++ std::allocator::construct(p, std::forward(args)...); ++ } ++ + }; + + template +diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp +index 447cafc..2fce139 100644 +--- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp ++++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp +@@ -294,7 +294,7 @@ static int RunInMultipleProcesses(const Vector &Args, + std::thread Pulse(PulseThread); + Pulse.detach(); + for (unsigned i = 0; i < NumWorkers; i++) +- V.push_back(std::thread(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors)); ++ V.emplace_back(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors); + for (auto &T : V) + T.join(); + return HasErrors ? 1 : 0; +-- +1.8.3.1 + diff --git a/0001-PATCH-std-thread-copy.patch b/0001-PATCH-std-thread-copy.patch deleted file mode 100644 index 53d297d..0000000 --- a/0001-PATCH-std-thread-copy.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -ru compiler-rt-8.0.0rc1.src.orig/lib/fuzzer/FuzzerDefs.h compiler-rt-8.0.0rc1.src/lib/fuzzer/FuzzerDefs.h ---- compiler-rt-8.0.0rc1.src.orig/lib/fuzzer/FuzzerDefs.h 2019-01-09 21:46:09.000000000 +0000 -+++ compiler-rt-8.0.0rc1.src/lib/fuzzer/FuzzerDefs.h 2019-02-12 14:03:32.971147814 +0000 -@@ -176,6 +176,12 @@ - - template - struct rebind { typedef fuzzer_allocator other; }; -+ -+ template< class U, class... Args > -+ void construct( U* p, Args&&... args ) { -+ std::allocator::construct(p, std::forward(args)...); -+ } -+ - }; - - template -diff -ru compiler-rt-8.0.0rc1.src.orig/lib/fuzzer/FuzzerDriver.cpp compiler-rt-8.0.0rc1.src/lib/fuzzer/FuzzerDriver.cpp ---- compiler-rt-8.0.0rc1.src.orig/lib/fuzzer/FuzzerDriver.cpp 2019-01-15 22:12:51.000000000 +0000 -+++ compiler-rt-8.0.0rc1.src/lib/fuzzer/FuzzerDriver.cpp 2019-02-12 13:05:15.965113872 +0000 -@@ -252,7 +252,7 @@ - std::thread Pulse(PulseThread); - Pulse.detach(); - for (unsigned i = 0; i < NumWorkers; i++) -- V.push_back(std::thread(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors)); -+ V.emplace_back(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors); - for (auto &T : V) - T.join(); - return HasErrors ? 1 : 0; diff --git a/compiler-rt.spec b/compiler-rt.spec index 775412d..717041c 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -20,7 +20,7 @@ Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{versio Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{crt_srcdir}.tar.xz.sig Source2: tstellar-gpg-key.asc -Patch0: 0001-PATCH-std-thread-copy.patch +Patch0: 0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch BuildRequires: gcc BuildRequires: gcc-c++