diff --git a/0001-PATCH-std-thread-copy.patch b/0001-PATCH-std-thread-copy.patch deleted file mode 100644 index 53d297d0f0bc6c02df03a4539da806db265aad49..0000000000000000000000000000000000000000 --- 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/0001-ipc_perm.patch b/0001-ipc_perm.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b11e0f1e6e6723b78c0d1bd5e5c4cc2184cee58 --- /dev/null +++ b/0001-ipc_perm.patch @@ -0,0 +1,16 @@ +diff -urN compiler-rt-8.0.1.src-orig/lib/sanitizer_common/sanitizer_platform_limits_posix.h compiler-rt-8.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.h +--- compiler-rt-8.0.1.src-orig/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2019-01-03 03:05:26.000000000 +0800 ++++ compiler-rt-8.0.1.src/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2021-11-10 17:08:02.966007183 +0800 +@@ -222,8 +222,12 @@ + unsigned long __unused1; + unsigned long __unused2; + #else ++#ifdef __i386__ + unsigned short mode; + unsigned short __pad1; ++#else ++ unsigned int mode; ++#endif + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) diff --git a/0002-hwasan_symbolize-should-run-in-python2-and-python3.patch b/0002-hwasan_symbolize-should-run-in-python2-and-python3.patch deleted file mode 100644 index 2237868dffd1c089b69580abdb1b344491a74640..0000000000000000000000000000000000000000 --- a/0002-hwasan_symbolize-should-run-in-python2-and-python3.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 9cfd1d498364487b7d1ba990188bffbd9a73d942 Mon Sep 17 00:00:00 2001 -From: si-gui <245140120@qq.com> -Date: Fri, 25 Sep 2020 17:06:30 +0800 -Subject: [PATCH] hwasan_symbolize should run in python2 and python3, and - python3 is default now - -Signed-off-by: si-gui <245140120@qq.com> ---- - lib/hwasan/scripts/hwasan_symbolize | 45 +++++++++++++++-------------- - 1 file changed, 23 insertions(+), 22 deletions(-) - -diff --git a/lib/hwasan/scripts/hwasan_symbolize b/lib/hwasan/scripts/hwasan_symbolize -index f77e36f..a488110 100755 ---- a/lib/hwasan/scripts/hwasan_symbolize -+++ b/lib/hwasan/scripts/hwasan_symbolize -@@ -10,6 +10,7 @@ - # HWAddressSanitizer offline symbolization script. - # - #===------------------------------------------------------------------------===# -+from __future__ import print_function - import glob - import os - import re -@@ -41,14 +42,14 @@ class Symbolizer: - pass - - def __write(self, s): -- print >>self.__pipe.stdin, s -+ print(s,file=self.__pipe.stdin) - if self.__log: -- print >>sys.stderr, ("#>> |%s|" % (s,)) -+ print(("#>> |%s|" % (s,)),file=sys.stderr) - - def __read(self): - s = self.__pipe.stdout.readline().rstrip() - if self.__log: -- print >>sys.stderr, ("# << |%s|" % (s,)) -+ print(("# << |%s|" % (s,)),file=sys.stderr) - if s == '': - raise Symbolizer.__EOF - return s -@@ -73,7 +74,7 @@ class Symbolizer: - full_path = os.path.join(p, os.path.basename(name)) - if os.path.exists(full_path): - return full_path -- print >>sys.stderr, "Could not find symbols for", name -+ print("Could not find symbols for",name,file=sys.stderr) - return None - - def iter_locals(self, binary, addr): -@@ -125,16 +126,16 @@ def symbolize_line(line, symbolizer_path): - frames = list(symbolizer.iter_call_stack(binary, addr)) - - if len(frames) > 0: -- print "%s#%s%s%s in %s" % (match.group(1).encode('utf-8'), match.group(2).encode('utf-8'), -- match.group(3).encode('utf-8'), frames[0][0], frames[0][1]) -+ print("%s#%s%s%s in %s" % (match.group(1).encode('utf-8'), match.group(2).encode('utf-8'), -+ match.group(3).encode('utf-8'), frames[0][0], frames[0][1])) - for i in range(1, len(frames)): - space1 = ' ' * match.end(1) - space2 = ' ' * (match.start(4) - match.end(1) - 2) -- print "%s->%s%s in %s" % (space1, space2, frames[i][0], frames[i][1]) -+ print("%s->%s%s in %s" % (space1, space2, frames[i][0], frames[i][1])) - else: -- print line.rstrip().encode('utf-8') -+ print(line.rstrip().encode('utf-8')) - else: -- print line.rstrip().encode('utf-8') -+ print(line.rstrip().encode('utf-8')) - - def save_access_address(line): - global last_access_address, last_access_tag -@@ -174,10 +175,10 @@ def process_stack_history(line, symbolizer, ignore_tags=False): - tag_offset = local[5] - if not ignore_tags and (tag_offset is None or base_tag ^ tag_offset != last_access_tag): - continue -- print '' -- print 'Potentially referenced stack object:' -- print ' %d bytes inside variable "%s" in stack frame of function "%s"' % (obj_offset, local[2], local[0]) -- print ' at %s' % (local[1],) -+ print('') -+ print('Potentially referenced stack object:') -+ print(' %d bytes inside variable "%s" in stack frame of function "%s"' % (obj_offset, local[2], local[0])) -+ print(' at %s' % (local[1],)) - return True - return False - -@@ -200,7 +201,7 @@ if not binary_prefixes: - - for p in binary_prefixes: - if not os.path.isdir(p): -- print >>sys.stderr, "Symbols path does not exist or is not a directory:", p -+ print("Symbols path does not exist or is not a directory:",p,file=sys.stderr) - sys.exit(1) - - # Source location. -@@ -257,19 +258,19 @@ if not symbolizer_path: - symbolizer_path = candidates[0] - break - --if not os.path.exists(symbolizer_path): -- print >>sys.stderr, "Symbolizer path does not exist:", symbolizer_path -+if not os.path.exists(str(symbolizer_path)): -+ print("Symbolizer path does not exist:",symbolizer_path,file=sys.stderr) - sys.exit(1) - - if args.v: -- print "Looking for symbols in:" -+ print("Looking for symbols in:") - for s in binary_prefixes: -- print " %s" % (s,) -- print "Stripping source path prefixes:" -+ print(" %s" % (s,)) -+ print("Stripping source path prefixes:") - for s in paths_to_cut: -- print " %s" % (s,) -- print "Using llvm-symbolizer binary in:\n %s" % (symbolizer_path,) -- print -+ print(" %s" % (s,)) -+ print("Using llvm-symbolizer binary in:\n %s" % (symbolizer_path,)) -+ print() - - symbolizer = Symbolizer(symbolizer_path, binary_prefixes, paths_to_cut) - symbolizer.enable_logging(args.d) --- -2.23.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 deleted file mode 100644 index 3cfc122583c4d26c7e4ac9897ccedc348680a84a..0000000000000000000000000000000000000000 Binary files a/compiler-rt-10.0.1.src.tar.xz and /dev/null differ diff --git a/compiler-rt-8.0.1.src.tar.xz b/compiler-rt-8.0.1.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..c49c7abd37a1dc299d36a957088345e74dcf0318 Binary files /dev/null and b/compiler-rt-8.0.1.src.tar.xz differ diff --git a/compiler-rt.spec b/compiler-rt.spec index 4fa20d368df1422e9fbcbc03d598e4062a2ecfb3..69048bafb2d31918b3425341031cc18c2545856c 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -1,25 +1,21 @@ -%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: 10.0.1 -Release: 3 -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 -Patch0001: 0002-hwasan_symbolize-should-run-in-python2-and-python3.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} +%global libclang_rt_installdir lib/linux +%global crt_srcdir compiler-rt-%{version}.src +%global debug_package %{nil} + +Name: compiler-rt +Version: 8.0.1 +Release: 1%{?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-%{version}/%{crt_srcdir}.tar.xz +Patch0000: 0001-ipc_perm.patch + + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: python3 %description The compiler-rt project is a part of the LLVM project. It provides @@ -33,16 +29,16 @@ instrumentation, and Blocks C language extension. %build mkdir -p _build cd _build -%cmake .. \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ - \ +%cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_COMPILER_TARGET=%{_arch} \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ %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 # could be on? + .. %make_build @@ -50,19 +46,19 @@ cd _build cd _build %make_install -# 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/ +for file in asan_blacklist.txt msan_blacklist.txt dfsan_abilist.txt cfi_blacklist.txt hwasan_blacklist.txt; do + mv -v %{buildroot}%{_datadir}/${file} %{buildroot}%{_libdir}/clang/%{version}/share/ +done # 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 *.so do - ln -s ../$i linux/$i + ln -s ../$i linux/$i done popd @@ -70,47 +66,29 @@ popd %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 + 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 || : + 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 -#make check-all -C _build %files %{_includedir}/* -%{_libdir}/clang/%{version} -%ifarch x86_64 aarch64 -%{_bindir}/hwasan_symbolize -%endif - -%changelog -* Fri Sep 25 2020 Guoshuai Sun - 10.0.1-3 -- hwasan_symbolize should run in python2 and python3, and python3 is default now - -* Sat Sep 19 2020 Guoshuai Sun - 10.0.1-2 -- Keep "/usr/bin/env python" instead of /usr/bin/python3 in hwasan_symbolize - -* Thu Jul 30 2020 Guoshuai Sun - 10.0.1-1 -- Update to 10.0.1 - -* Thu Dec 5 2019 openEuler Buildteam - 7.0.0-2 -- Package init +%{_libdir}/clang/%{version} \ No newline at end of file diff --git a/compiler-rt.yaml b/compiler-rt.yaml deleted file mode 100644 index 7d98bd835f0acc97da741f20f900a6ebae1512c5..0000000000000000000000000000000000000000 --- a/compiler-rt.yaml +++ /dev/null @@ -1,4 +0,0 @@ -version_control: github -src_repo: llvm/llvm-project -tag_prefix: ^llvmorg- -seperator: .