diff --git a/0001-PATCH-std-thread-copy.patch b/0001-PATCH-std-thread-copy.patch new file mode 100644 index 0000000000000000000000000000000000000000..53d297d0f0bc6c02df03a4539da806db265aad49 --- /dev/null +++ b/0001-PATCH-std-thread-copy.patch @@ -0,0 +1,28 @@ +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/close-no-stack-protector.patch b/close-no-stack-protector.patch deleted file mode 100644 index f188649a22624fc44b032fa46e8305d57b45d130..0000000000000000000000000000000000000000 --- a/close-no-stack-protector.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruNa compiler-rt-7.0.0.src.old/CMakeLists.txt compiler-rt-7.0.0.src/CMakeLists.txt ---- compiler-rt-7.0.0.src.old/CMakeLists.txt 2020-03-20 18:23:28.512249162 +0800 -+++ compiler-rt-7.0.0.src/CMakeLists.txt 2020-03-20 17:37:26.462851376 +0800 -@@ -205,7 +205,7 @@ - append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) - endif() - append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS) --append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) -+#append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) - append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS) - append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) - if(NOT COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) diff --git a/compiler-rt-10.0.1.src.tar.xz b/compiler-rt-10.0.1.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..3cfc122583c4d26c7e4ac9897ccedc348680a84a Binary files /dev/null and b/compiler-rt-10.0.1.src.tar.xz differ diff --git a/compiler-rt-7.0.0.src.tar.xz b/compiler-rt-7.0.0.src.tar.xz deleted file mode 100644 index f510c5444cab53a2d19c5cbeee0826a3db848acd..0000000000000000000000000000000000000000 Binary files a/compiler-rt-7.0.0.src.tar.xz and /dev/null differ diff --git a/compiler-rt.spec b/compiler-rt.spec index b29aef212cae9f4f8a8ca21bafa194de10a22a01..a2f316a0c474c8f4613829ed2d9468be4a6972fc 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -1,38 +1,49 @@ %global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src +%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) +%global optflags %(echo %{optflags} -Dasm=__asm__) -Name: compiler-rt -Version: 7.0.0 -Release: 2 -Summary: LLVM "compiler-rt" runtime libraries -License: NCSA or MIT -URL: http://llvm.org -Source0: http://llvm.org/releases/%{version}/%{crt_srcdir}.tar.xz -BuildRequires: gcc gcc-c++ cmake python3 python3-devel -BuildRequires: llvm-devel = %{version} llvm-static = %{version} +Name: compiler-rt +Version: 10.0.1 +Release: 1 +Summary: LLVM "compiler-rt" runtime libraries +License: NCSA or MIT +URL: http://llvm.org +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{crt_srcdir}.tar.xz +Patch0000: 0001-PATCH-std-thread-copy.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: python3 +# We need python3-devel for pathfix.py. +BuildRequires: python3-devel +BuildRequires: llvm-devel = %{version} +BuildRequires: llvm-static = %{version} %description -The compiler-rt project provides highly tuned implementations of the -low-level code generator support routines like "__fixunsdfdi" and other -calls generated when a target doesn't have a short sequence of native -instructions to implement a core IR operation. +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. %prep %autosetup -n %{crt_srcdir} -p1 -pathfix.py -i %{__python3} -pn . + +pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize %build mkdir -p _build cd _build %cmake .. \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ - \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ + \ %if 0%{?__isa_bits} == 64 - -DLLVM_LIBDIR_SUFFIX=64 \ + -DLLVM_LIBDIR_SUFFIX=64 \ %else - -DLLVM_LIBDIR_SUFFIX= \ + -DLLVM_LIBDIR_SUFFIX= \ %endif - -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF + -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? %make_build @@ -40,33 +51,61 @@ cd _build cd _build %make_install -mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib - -%ifarch aarch64 -%global aarch64_blacklists hwasan_blacklist.txt -%endif - -for file in %{aarch64_blacklists} asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt \ - cfi_blacklist.txt dfsan_abilist.txt hwasan_blacklist.txt; do - mv -v %{buildroot}%{_datadir}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || : -done +# move blacklist/abilist files to where clang expect them +mkdir -p %{buildroot}%{_libdir}/clang/%{version}/share +mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{version}/share/ -mv -v %{buildroot}%{_prefix}/lib/linux/libclang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib +# move sanitizer libs to better place +%global libclang_rt_installdir lib/linux +mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib +mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*clang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/ pushd %{buildroot}%{_libdir}/clang/%{version}/lib -for i in *.a *.syms *.so; do - ln -s ../$i linux/$i +for i in *.a *.so +do + ln -s ../$i linux/$i done +popd + +%ifarch %{ix86} +%post +if test "`uname -m`" = x86_64 +then + cd %{_libdir}/clang/%{version}/lib + mkdir -p ../../../../lib64/clang/%{version}/lib + for i in *.a *.so + do + ln -s ../../../../%{_lib}/clang/%{version}/lib/$i ../../../../lib64/clang/%{version}/lib/$i + done +fi + +%preun + +if test "`uname -m`" = x86_64 +then + cd %{_libdir}/clang/%{version}/lib + for i in *.a *.so + do + rm ../../../../lib64/clang/%{version}/lib/$i + done + rmdir -p ../../../../lib64/clang/%{version}/lib 2>/dev/null 1>/dev/null || : +fi + +%endif %check -cd _build +#make check-all -C _build %files -%defattr(-,root,root) -%license LICENSE.TXT %{_includedir}/* %{_libdir}/clang/%{version} +%ifarch x86_64 aarch64 +%{_bindir}/hwasan_symbolize +%endif %changelog +* Thu Sep 30 2020 Jeffery.Gao - 10.0.1-1 +- Update to 10.0.1 + * Thu Dec 5 2019 openEuler Buildteam - 7.0.0-2 - Package init diff --git a/compiler-rt.yaml b/compiler-rt.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7d98bd835f0acc97da741f20f900a6ebae1512c5 --- /dev/null +++ b/compiler-rt.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: llvm/llvm-project +tag_prefix: ^llvmorg- +seperator: .