12.0.1-rc3 Release

This commit is contained in:
Tom Stellard 2021-07-01 02:55:55 +00:00
parent a05b5d30b4
commit 330edc056d
6 changed files with 9 additions and 252 deletions

2
.gitignore vendored
View File

@ -77,3 +77,5 @@
/compiler-rt-12.0.0.src.tar.xz.sig
/compiler-rt-12.0.1rc1.src.tar.xz
/compiler-rt-12.0.1rc1.src.tar.xz.sig
/compiler-rt-12.0.1rc3.src.tar.xz
/compiler-rt-12.0.1rc3.src.tar.xz.sig

View File

@ -1,71 +0,0 @@
From ffd0f69c375f12f081a1a5158a02a05000b7a93c Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka@google.com>
Date: Fri, 16 Apr 2021 09:50:24 -0700
Subject: [PATCH][compiler-rt] Sanitizer built against glibc 2.34 doesn't work
As mentioned in https://gcc.gnu.org/PR100114 , glibc starting with the
https://sourceware.org/git/?p=glibc.git;a=commit;h=6c57d320484988e87e446e2e60ce42816bf51d53
change doesn't define SIGSTKSZ and MINSIGSTKSZ macros to constants, but to sysconf function call.
sanitizer_posix_libcdep.cpp has
static const uptr kAltStackSize = SIGSTKSZ * 4; // SIGSTKSZ is not enough.
which is generally fine, just means that when SIGSTKSZ is not a compile time constant will be initialized later.
The problem is that kAltStackSize is used in SetAlternateSignalStack which is called very early, from .preinit_array
initialization, i.e. far before file scope variables are constructed, which means it is not initialized and
mmapping 0 will fail:
==145==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)
Here is one possible fix, another one could be to make kAltStackSize a preprocessor macro if _SG_SIGSTKSZ is defined
(but perhaps with having an automatic const variable initialized to it so that sysconf isn't at least called twice
during SetAlternateSignalStack.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D100645
(cherry picked from commit 82150606fb11d28813ae6da1101f5bda638165fe)
---
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
index d29438c..2b10bdd 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -165,7 +165,11 @@ bool SupportsColoredOutput(fd_t fd) {
#if !SANITIZER_GO
// TODO(glider): different tools may require different altstack size.
-static const uptr kAltStackSize = SIGSTKSZ * 4; // SIGSTKSZ is not enough.
+static uptr GetAltStackSize() {
+ // SIGSTKSZ is not enough.
+ static const uptr kAltStackSize = SIGSTKSZ * 4;
+ return kAltStackSize;
+}
void SetAlternateSignalStack() {
stack_t altstack, oldstack;
@@ -176,10 +180,10 @@ void SetAlternateSignalStack() {
// TODO(glider): the mapped stack should have the MAP_STACK flag in the
// future. It is not required by man 2 sigaltstack now (they're using
// malloc()).
- void* base = MmapOrDie(kAltStackSize, __func__);
+ void *base = MmapOrDie(GetAltStackSize(), __func__);
altstack.ss_sp = (char*) base;
altstack.ss_flags = 0;
- altstack.ss_size = kAltStackSize;
+ altstack.ss_size = GetAltStackSize();
CHECK_EQ(0, sigaltstack(&altstack, nullptr));
}
@@ -187,7 +191,7 @@ void UnsetAlternateSignalStack() {
stack_t altstack, oldstack;
altstack.ss_sp = nullptr;
altstack.ss_flags = SS_DISABLE;
- altstack.ss_size = kAltStackSize; // Some sane value required on Darwin.
+ altstack.ss_size = GetAltStackSize(); // Some sane value required on Darwin.
CHECK_EQ(0, sigaltstack(&altstack, &oldstack));
UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);
}
--
1.8.3.1

View File

@ -1,54 +0,0 @@
From 96339090681ae1dd9afe186ea14a460b61794707 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Tue, 11 May 2021 14:38:21 +0200
Subject: [PATCH][compiler-rt] Prevent introduction of a dependency of
libasan.a on libstdc++
This an attempt to fix an issue introduced by https://reviews.llvm.org/D70662
Function-scope static initialization are guarded in C++, so we should probably
not use it because it introduces a dependency on __cxa_guard* symbols.
In the context of clang, libasan is linked statically, and it currently needs to
the odd situation where compiling C code with clang and asan requires -lstdc++.
I'm unsure of the portability requirements, providing a potential solution in
this review.
Differential Revision: https://reviews.llvm.org/D102475
---
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
index 2b10bdd..818f1af 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -15,6 +15,7 @@
#if SANITIZER_POSIX
+#include "sanitizer_atomic.h"
#include "sanitizer_common.h"
#include "sanitizer_flags.h"
#include "sanitizer_platform_limits_netbsd.h"
@@ -166,9 +167,14 @@ bool SupportsColoredOutput(fd_t fd) {
#if !SANITIZER_GO
// TODO(glider): different tools may require different altstack size.
static uptr GetAltStackSize() {
- // SIGSTKSZ is not enough.
- static const uptr kAltStackSize = SIGSTKSZ * 4;
- return kAltStackSize;
+ static atomic_uintptr_t kAltStackSize{0};
+ uptr ret = atomic_load(&kAltStackSize, memory_order_relaxed);
+ if (ret == 0) {
+ // SIGSTKSZ is not enough.
+ ret = SIGSTKSZ * 4;
+ atomic_store(&kAltStackSize, ret, memory_order_relaxed);
+ }
+ return ret;
}
void SetAlternateSignalStack() {
--
1.8.3.1

View File

@ -1,120 +0,0 @@
From c9a8c70be89cfa62aa51862f4c8e0fa4c50134d2 Mon Sep 17 00:00:00 2001
From: Tamar Christina <tamar.christina@arm.com>
Date: Thu, 20 May 2021 18:55:11 +0100
Subject: [PATCH][compiler-rt] libsanitizer: Remove cyclades inclusion in
sanitizer
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.
libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.
Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.
As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.
[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D102059
(cherry picked from commit 68d5235cb58f988c71b403334cd9482d663841ab)
---
.../sanitizer_common/sanitizer_common_interceptors_ioctl.inc | 9 ---------
.../lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | 11 -----------
.../lib/sanitizer_common/sanitizer_platform_limits_posix.h | 10 ----------
3 files changed, 30 deletions(-)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 7f18125..b7da659 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
#if SANITIZER_GLIBC
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
- _(CYGETDEFTHRESH, WRITE, sizeof(int));
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
- _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
- _(CYGETTHRESH, WRITE, sizeof(int));
- _(CYGETTIMEOUT, WRITE, sizeof(int));
- _(CYSETDEFTHRESH, NONE, 0);
- _(CYSETDEFTIMEOUT, NONE, 0);
- _(CYSETTHRESH, NONE, 0);
- _(CYSETTIMEOUT, NONE, 0);
_(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
_(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
_(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index 12dd39e..7abaeb8 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
# include <sys/procfs.h>
#endif
#include <sys/user.h>
-#include <linux/cyclades.h>
#include <linux/if_eql.h>
#include <linux/if_plip.h>
#include <linux/lp.h>
@@ -459,7 +458,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
#if SANITIZER_GLIBC
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
#if EV_VERSION > (0x010000)
unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
#else
@@ -823,15 +821,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
#endif // SANITIZER_LINUX
#if SANITIZER_LINUX && !SANITIZER_ANDROID
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
- unsigned IOCTL_CYGETMON = CYGETMON;
- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
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 836b178..8a156b7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
#if SANITIZER_LINUX && !SANITIZER_ANDROID
extern unsigned struct_ax25_parms_struct_sz;
-extern unsigned struct_cyclades_monitor_sz;
extern unsigned struct_input_keymap_entry_sz;
extern unsigned struct_ipx_config_data_sz;
extern unsigned struct_kbdiacrs_sz;
@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
#endif // SANITIZER_LINUX
#if SANITIZER_LINUX && !SANITIZER_ANDROID
-extern unsigned IOCTL_CYGETDEFTHRESH;
-extern unsigned IOCTL_CYGETDEFTIMEOUT;
-extern unsigned IOCTL_CYGETMON;
-extern unsigned IOCTL_CYGETTHRESH;
-extern unsigned IOCTL_CYGETTIMEOUT;
-extern unsigned IOCTL_CYSETDEFTHRESH;
-extern unsigned IOCTL_CYSETDEFTIMEOUT;
-extern unsigned IOCTL_CYSETTHRESH;
-extern unsigned IOCTL_CYSETTIMEOUT;
extern unsigned IOCTL_EQL_EMANCIPATE;
extern unsigned IOCTL_EQL_ENSLAVE;
extern unsigned IOCTL_EQL_GETMASTRCFG;
--
1.8.3.1

View File

@ -1,4 +1,4 @@
%global rc_ver 1
%global rc_ver 3
%global compiler_rt_version 12.0.1
%global crt_srcdir compiler-rt-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src
@ -11,7 +11,7 @@
Name: compiler-rt
Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}}
Release: 2%{?dist}
Release: 1%{?dist}
Summary: LLVM "compiler-rt" runtime libraries
License: NCSA or MIT
@ -21,9 +21,6 @@ Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compil
Source2: tstellar-gpg-key.asc
Patch0: 0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch
Patch1: 0002-PATCH-compiler-rt-Sanitizer-built-against-glibc-2.34.patch
Patch3: 0003-PATCH-compiler-rt-Prevent-introduction-of-a-dependen.patch
Patch4: 0004-PATCH-compiler-rt-libsanitizer-Remove-cyclades-inclu.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -113,6 +110,9 @@ popd
%endif
%changelog
* Wed Jun 30 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1~rc3-1
- 12.0.1-rc3 Release
* Fri Jun 04 2021 Tom Stellard <tstellar@redhat.com> - 12.0.1~rc1-2
- Fix installation paths

View File

@ -1,2 +1,2 @@
SHA512 (compiler-rt-12.0.1rc1.src.tar.xz) = 66981e1ac4d45dd0c2e5404d4a13bfd5f43ad1ac85679dc8301248efc94df250b7ea4dd3fb3f764a282f960ba6493d9ed24d4aa6234972dafde41abdf38bf2a8
SHA512 (compiler-rt-12.0.1rc1.src.tar.xz.sig) = 7761eff17eee33b15f6e2f73cb95918215add90715004feb8c368ab1aecdb054b985fd9374825d3fc22d614aa2cebc6e7dcd669fe33120b7bae158e6e71c7b0f
SHA512 (compiler-rt-12.0.1rc3.src.tar.xz) = 7a6d544ae0f50168c9d9642dde9350d1eb45f73d72fbec6a942a5ce0b5552f89a5cedc40cfd0b14e70e63cbb5bb1e5832de1a9470169492a34be9c76955e65da
SHA512 (compiler-rt-12.0.1rc3.src.tar.xz.sig) = 5a0a6acc6c0e72220fdfde26ed732cc85877676dd7eab5cd4c380ad7dd87ed7660727ee6497e353ea5ff8204942c0e6737de68e278cbc222bbacbd39019fefc2