diff --git a/.compiler-rt.metadata b/.compiler-rt.metadata index 4202299..3c9e49c 100644 --- a/.compiler-rt.metadata +++ b/.compiler-rt.metadata @@ -1 +1 @@ -f6520fb47fae9cc4362a9d50abee22019c27457a SOURCES/compiler-rt-8.0.1.src.tar.xz +b35bc6ed7ce40f18ac45c81f4cf02ffd1f14de82 SOURCES/compiler-rt-9.0.1.src.tar.xz diff --git a/.gitignore b/.gitignore index 568e7fc..9ede062 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/compiler-rt-8.0.1.src.tar.xz +SOURCES/compiler-rt-9.0.1.src.tar.xz diff --git a/SOURCES/0001-Drop-fno-stack-protector-from-the-compiler-flags.patch b/SOURCES/0001-Drop-fno-stack-protector-from-the-compiler-flags.patch index eea43d6..2f2573c 100644 --- a/SOURCES/0001-Drop-fno-stack-protector-from-the-compiler-flags.patch +++ b/SOURCES/0001-Drop-fno-stack-protector-from-the-compiler-flags.patch @@ -1,17 +1,17 @@ -From 66b952a4aeab83a7692d9d80a046034de79fe2e2 Mon Sep 17 00:00:00 2001 +From f007934385dc76b9299bd72cdef102fe979af93b Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 5 Sep 2018 21:07:42 -0700 Subject: [PATCH] Drop -fno-stack-protector from the compiler flags --- - CMakeLists.txt | 1 - + compiler-rt/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4b953b2..043cc31 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -207,7 +207,6 @@ if(NOT COMPILER_RT_DEBUG AND NOT APPLE) +diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt +index f26ae25..a6ac032 100644 +--- a/compiler-rt/CMakeLists.txt ++++ b/compiler-rt/CMakeLists.txt +@@ -271,7 +271,6 @@ if(NOT COMPILER_RT_DEBUG AND NOT APPLE) 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) diff --git a/SOURCES/0001-Fix-sanitizer-common-build-with-glibc-2.31.patch b/SOURCES/0001-Fix-sanitizer-common-build-with-glibc-2.31.patch new file mode 100644 index 0000000..d28aa3d --- /dev/null +++ b/SOURCES/0001-Fix-sanitizer-common-build-with-glibc-2.31.patch @@ -0,0 +1,84 @@ +From 25395eb64390546dffe2a2494876909d27b999c3 Mon Sep 17 00:00:00 2001 +From: Evgenii Stepanov +Date: Mon, 25 Nov 2019 13:52:17 -0800 +Subject: [PATCH] Fix sanitizer-common build with glibc 2.31 + +Summary: +As mentioned in D69104, glibc changed ABI recently with the [[ https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2f959dfe849e0646e27403f2e4091536496ac0f0| 2f959dfe ]] change. +D69104 dealt with just 32-bit ARM, but that is just one of the many affected architectures. +E.g. x86_64, i?86, riscv64, sparc 32-bit, s390 31-bit are affected too (and various others). + +This patch instead of adding a long list of further architectures that wouldn't be checked ever next to arm 32-bit changes the structures to match the 2.31 layout and performs the checking on Linux for ipc_perm mode position/size only on non-Linux or on Linux with glibc 2.31 or later. I think this matches what is done for aarch64 already. +If needed, we could list architectures that haven't changed ABI (e.g. powerpc), so that they would be checked even with older glibcs. AFAIK sanitizers don't actually use ipc_perm.mode and +so all they care about is the size and alignment of the whole structure. + +Note, s390 31-bit and arm 32-bit big-endian changed ABI even further, there will now be shmctl with old symbol version and shmctl@@GLIBC_2.31 which will be incompatible. I'm afraid this isn't really solvable unless the sanitizer libraries are symbol versioned and use matching symbol versions to glibc symbols for stuff they intercept, plus use dlvsym. +This patch doesn't try to address that. + +Patch by Jakub Jelinek. + +Reviewers: kcc, eugenis, dvyukov + +Reviewed By: eugenis + +Subscribers: jyknight, kristof.beyls, fedor.sergeev, simoncook, PkmX, s.egerton, steven.zhang, #sanitizers, llvm-commits + +Tags: #sanitizers, #llvm + +Differential Revision: https://reviews.llvm.org/D70662 +--- + .../sanitizer_common/sanitizer_platform_limits_posix.cc | 5 +++-- + .../sanitizer_common/sanitizer_platform_limits_posix.h | 15 +-------------- + 2 files changed, 4 insertions(+), 16 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +index b7fa6e8..abdf794 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1126,8 +1126,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) +-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) ++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit ++ on many architectures. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index f1a4fd7..029a209 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -203,26 +203,13 @@ namespace __sanitizer { + u64 __unused1; + u64 __unused2; + #elif defined(__sparc__) +-#if defined(__arch64__) + unsigned mode; +- unsigned short __pad1; +-#else +- unsigned short __pad1; +- unsigned short mode; + unsigned short __pad2; +-#endif + unsigned short __seq; + unsigned long long __unused1; + unsigned long long __unused2; +-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) +- unsigned int mode; +- unsigned short __seq; +- unsigned short __pad1; +- unsigned long __unused1; +- unsigned long __unused2; + #else +- unsigned short mode; +- unsigned short __pad1; ++ unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) +-- +1.8.3.1 + diff --git a/SOURCES/0001-PATCH-std-thread-copy.patch b/SOURCES/0001-PATCH-std-thread-copy.patch deleted file mode 100644 index 53d297d..0000000 --- a/SOURCES/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/SOURCES/0001-std-thread-copy-fix.patch b/SOURCES/0001-std-thread-copy-fix.patch new file mode 100644 index 0000000..6bf50f6 --- /dev/null +++ b/SOURCES/0001-std-thread-copy-fix.patch @@ -0,0 +1,43 @@ +From 45e85d0673a603618a4000c3839b0bd96c263762 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 20 Dec 2019 11:17:22 -0800 +Subject: [PATCH] std thread copy fix + +--- + 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 320b37d..37c4b2c 100644 +--- a/compiler-rt/lib/fuzzer/FuzzerDefs.h ++++ b/compiler-rt/lib/fuzzer/FuzzerDefs.h +@@ -183,6 +183,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 54c7ff0..47cd7ab 100644 +--- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp ++++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp +@@ -264,7 +264,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/SPECS/compiler-rt.spec b/SPECS/compiler-rt.spec index 1bfbbba..345775b 100644 --- a/SPECS/compiler-rt.spec +++ b/SPECS/compiler-rt.spec @@ -3,21 +3,25 @@ %global debug_package %{nil} %endif -#%%global rc_ver 2 +#%%global rc_ver 3 +%global baserelease 2 %global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src Name: compiler-rt -Version: 8.0.1 -Release: 1%{?rc_ver:.rc%{rc_ver}}%{?dist} +Version: 9.0.1 +Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?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}%{?rc_ver:-%{rc_ver}}/%{crt_srcdir}.tar.xz +Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{crt_srcdir}.tar.xz -Patch0: 0001-PATCH-std-thread-copy.patch -Patch1: 0001-Drop-fno-stack-protector-from-the-compiler-flags.patch +Patch0: 0001-std-thread-copy-fix.patch +Patch1: 0001-Fix-sanitizer-common-build-with-glibc-2.31.patch + +# RHEL-specific patches +Patch100: 0001-Drop-fno-stack-protector-from-the-compiler-flags.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -35,7 +39,7 @@ code generation, sanitizer runtimes and profiling library for code instrumentation, and Blocks C language extension. %prep -%autosetup -n %{crt_srcdir} -p1 +%autosetup -n %{crt_srcdir} -p2 pathfix.py -i %{__python3} -pn . @@ -71,7 +75,7 @@ done # move sanitizer libs to better place %global libclang_rt_installdir lib/linux -mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/libclang_rt* %{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 @@ -116,6 +120,15 @@ fi %{_libdir}/clang/%{version} %changelog +* Mon Jan 06 2020 Tom Stellard - 9.0.1-2 +- Update fno-stack-protector patch to apply with -p2 + +* Fri Dec 20 2019 Tom Stellard - 9.0.1-1 +- 9.0.1 Release + +* Fri Sep 27 2019 Tom Stellard - 9.0.0-1 +- 9.0.0 Release + * Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1 - 8.0.1 release