#10 9.0.1 Release
Closed 4 years ago by tstellar. Opened 4 years ago by tstellar.
rpms/ tstellar/compiler-rt 9.0.1  into  master

file modified
+1
@@ -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

@@ -0,0 +1,84 @@ 

+ From 25395eb64390546dffe2a2494876909d27b999c3 Mon Sep 17 00:00:00 2001

+ From: Evgenii Stepanov <eugenis@google.com>

+ 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

+ 

0001-std-thread-copy-fix.patch 0001-PATCH-std-thread-copy.patch
file renamed
+23 -8
@@ -1,7 +1,18 @@ 

- 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 @@

+ From 45e85d0673a603618a4000c3839b0bd96c263762 Mon Sep 17 00:00:00 2001

+ From: Tom Stellard <tstellar@redhat.com>

+ 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<typename T>

   

         template<class Other>

         struct rebind { typedef fuzzer_allocator<Other> other;  };
@@ -14,10 +25,11 @@ 

     };

   

   template<typename T>

- 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 @@

+ 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<std::string> &Args,

     std::thread Pulse(PulseThread);

     Pulse.detach();

     for (unsigned i = 0; i < NumWorkers; i++)
@@ -26,3 +38,6 @@ 

     for (auto &T : V)

       T.join();

     return HasErrors ? 1 : 0;

+ -- 

+ 1.8.3.1

+ 

file modified
+7 -3
@@ -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 @@ 

  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 @@ 

  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 @@ 

  %{_libdir}/clang/%{version}

  

  %changelog

+ * Fri Dec 20 2019 Tom Stellard <tstellar@redhat.com> - 9.0.1-1

+ - 9.0.1 Release

+ 

  * Thu Sep 19 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1

  - 9.0.0 Release

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (compiler-rt-9.0.0.src.tar.xz) = a7bb0a67165d29317cee58c22ed79f0d6a9cb9279dcd355d4267f3cd6c531a7be455a28267c591d6e2c0f9c56e363d40c10a405391e07d02ab3e30f00ffef2a8

+ SHA512 (compiler-rt-9.0.1.src.tar.xz) = edd7e87197581d3888d5298e0f4464071d1ecd351781687f3bec91097e5e72ea0d290036c4b6713b06978b79b0b124fbad1cac4028df2ec4d5198e19c0ba9c95

no initial comment

Any news on that? It seems to be breaking the clang builds on an rawhide server utilized for CPython upstream CI: https://bugs.python.org/issue39398

I tried to produce an rpm out of this PR but it fails with:

/builddir/build/BUILD/compiler-rt-9.0.1.src/lib/builtins/emutls.c:41:39: error: 'PTHREAD_MUTEX_DEFAULT' undeclared here (not in a function)
41 | static pthread_mutex_t emutls_mutex = PTHREAD_MUTEX_INITIALIZER;
| ^

FYI it seems like right now, UBScan cannot be used on Fedora Rawhide: https://bugs.python.org/issue39398

clang-9.0.1-2.fc32.x86_64 cannot be used with compiler-rt-9.0.0-1.fc32.x86_64.

There was a glibc bug filed for this issue: https://sourceware.org/bugzilla/show_bug.cgi?id=25271

We are planning to resolve it when we do the 10.0.0 update, which will hopefully be soon.

Pull-Request has been closed by tstellar

4 years ago