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 0000000000000000000000000000000000000000..f734b5f950d8a064deaf80dff7c33ce7fcd3cced --- /dev/null +++ b/0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch @@ -0,0 +1,43 @@ +From 8247295860b69fd379e282c3e6315df9f700e4d8 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Thu, 25 Feb 2021 14:12:57 +0100 +Subject: [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/compiler-rt-13.0.1.src.tar.xz b/compiler-rt-13.0.1.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..0e9a69e3575f88fc8bf379e3074e04b94f44b060 Binary files /dev/null and b/compiler-rt-13.0.1.src.tar.xz differ diff --git a/compiler-rt-13.0.1.src.tar.xz.sig b/compiler-rt-13.0.1.src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000..92caabc6c4960dcf0c45dc05da78723ff397d7f5 Binary files /dev/null and b/compiler-rt-13.0.1.src.tar.xz.sig differ diff --git a/compiler-rt.spec b/compiler-rt.spec new file mode 100644 index 0000000000000000000000000000000000000000..0a0641b31d3ff04a7e8ee8d8f85747a68beb4714 --- /dev/null +++ b/compiler-rt.spec @@ -0,0 +1,106 @@ +%define anolis_release 1 +%global compiler_rt_version 13.0.1 +%global crt_srcdir compiler-rt-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src + +# see https://sourceware.org/bugzilla/show_bug.cgi?id=25271 +%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) + +# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93615 +%global optflags %(echo %{optflags} -Dasm=__asm__) + +Name: compiler-rt +Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}} +Release: %{anolis_release}%{?dist} +Summary: LLVM "compiler-rt" runtime libraries + +License: NCSA or MIT +URL: http://llvm.org +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{crt_srcdir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}%{?rc_ver:-rc%{rc_ver}}/%{crt_srcdir}.tar.xz.sig +Source2: tstellar-gpg-key.asc + +Patch0001: 0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: ninja-build +BuildRequires: python3 +# We need python3-devel for %%py3_shebang_fix +BuildRequires: python3-devel +BuildRequires: llvm-devel = %{version} + +# For gpg source verification +BuildRequires: gnupg2 + +Requires: clang-resource-filesystem = %{version} + +%description +The compiler-rt project is a part of the LLVM project. It provides +implementation of the low-level target-specific hooks required by +code generation, sanitizer runtimes and profiling library for code +instrumentation, and Blocks C language extension. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentations for %{name} + +%prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%autosetup -n %{crt_srcdir} -p2 + +%py3_shebang_fix lib/hwasan/scripts/hwasan_symbolize + +%build +%cmake -GNinja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ + -DLLVM_LIBDIR_SUFFIX=64 \ + -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF + +%cmake_build + +%install + +%cmake_install + +# move blacklist/abilist files to where clang expect them +mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share +mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share/ + +# move sanitizer libs to better place +%global libclang_rt_installdir lib/linux +mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib +mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*clang_rt* %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib +mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib/linux/ +pushd %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib +for i in *.a *.so +do + ln -s ../$i linux/$i +done + +popd + +%check +#%%cmake_build --target check-compiler-rt + + +%files +%license LICENSE.TXT +%{_includedir}/* +%{_libdir}/clang/%{compiler_rt_version}/lib/* +%{_libdir}/clang/%{compiler_rt_version}/share/* +%{_bindir}/hwasan_symbolize + +%files doc +%doc README.txt CODE_OWNERS.TXT docs/TestingGuide.rst docs/TestingGuide.rst + + +%changelog +* Sun Jul 31 happy_orange - 13.0.1-1 +- Init pcakage from upstream diff --git a/tstellar-gpg-key.asc b/tstellar-gpg-key.asc new file mode 100644 index 0000000000000000000000000000000000000000..eba625c41a5fb1646d8b087acb97a6f079901712 Binary files /dev/null and b/tstellar-gpg-key.asc differ