diff --git a/.gitignore b/.gitignore index 195f2bd..6185751 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ /compiler-rt-9.0.0rc2.src.tar.xz /compiler-rt-9.0.0rc3.src.tar.xz /compiler-rt-9.0.0.src.tar.xz +/compiler-rt-9.0.1.src.tar.xz diff --git a/0001-Fix-sanitizer-common-build-with-glibc-2.31.patch b/0001-Fix-sanitizer-common-build-with-glibc-2.31.patch new file mode 100644 index 0000000..d28aa3d --- /dev/null +++ b/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/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/0001-std-thread-copy-fix.patch b/0001-std-thread-copy-fix.patch new file mode 100644 index 0000000..6bf50f6 --- /dev/null +++ b/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/compiler-rt.spec b/compiler-rt.spec index 3e8819a..b3ca27f 100644 --- a/compiler-rt.spec +++ b/compiler-rt.spec @@ -9,7 +9,7 @@ %global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src Name: compiler-rt -Version: 9.0.0 +Version: 9.0.1 Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist} Summary: LLVM "compiler-rt" runtime libraries @@ -17,7 +17,8 @@ License: NCSA or MIT URL: http://llvm.org 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 +Patch0: 0001-std-thread-copy-fix.patch +Patch1: 0001-Fix-sanitizer-common-build-with-glibc-2.31.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -35,7 +36,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 . @@ -116,6 +117,9 @@ fi %{_libdir}/clang/%{version} %changelog +* Fri Dec 20 2019 Tom Stellard - 9.0.1-1 +- 9.0.1 Release + * Thu Sep 19 2019 Tom Stellard - 9.0.0-1 - 9.0.0 Release diff --git a/sources b/sources index 54c0f50..5f34f0e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (compiler-rt-9.0.0.src.tar.xz) = a7bb0a67165d29317cee58c22ed79f0d6a9cb9279dcd355d4267f3cd6c531a7be455a28267c591d6e2c0f9c56e363d40c10a405391e07d02ab3e30f00ffef2a8 +SHA512 (compiler-rt-9.0.1.src.tar.xz) = edd7e87197581d3888d5298e0f4464071d1ecd351781687f3bec91097e5e72ea0d290036c4b6713b06978b79b0b124fbad1cac4028df2ec4d5198e19c0ba9c95