import compiler-rt-10.0.0-2.module+el8.3.0+7004+904a04ce

This commit is contained in:
CentOS Sources 2020-07-28 08:15:04 -04:00 committed by Stepan Oksanichenko
parent f0eda5fb2b
commit dd4cea4c9f
6 changed files with 117 additions and 23 deletions

View File

@ -1 +1,2 @@
4e00cb231ff87fd4f970f35b2da86185a612e0e2 SOURCES/compiler-rt-9.0.0.src.tar.xz
4744490da9c1186ba7f730d8a8f4fa4b0d4ee0bc SOURCES/compiler-rt-10.0.0.src.tar.xz
32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc

3
.gitignore vendored
View File

@ -1 +1,2 @@
SOURCES/compiler-rt-9.0.0.src.tar.xz
SOURCES/compiler-rt-10.0.0.src.tar.xz
SOURCES/hans-gpg-key.asc

View File

@ -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 <tstellar@redhat.com>
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 compiler-rt.orig/CMakeLists.txt compiler-rt/CMakeLists.txt
index f26ae25..a6ac032 100644
--- compiler-rt.orig/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)

View File

@ -0,0 +1,68 @@
From af38074874c605f9e598ae3f7e5d4befa3fe92bb Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 28 May 2020 17:50:31 +0200
Subject: [PATCH] Fix strict aliasing warning in msan.cpp
Use internal_memcpy instead.
Differential Revision: https://reviews.llvm.org/D80732
---
compiler-rt/lib/msan/msan.cpp | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git compiler-rt.orig/lib/msan/msan.cpp compiler-rt/lib/msan/msan.cpp
index 7095ee1bf20..8c789901adc 100644
--- compiler-rt.orig/lib/msan/msan.cpp
+++ compiler-rt/lib/msan/msan.cpp
@@ -617,34 +617,41 @@ u32 __msan_get_umr_origin() {
}
u16 __sanitizer_unaligned_load16(const uu16 *p) {
- *(uu16 *)&__msan_retval_tls[0] = *(uu16 *)MEM_TO_SHADOW((uptr)p);
+ internal_memcpy(&__msan_retval_tls[0], (void *)MEM_TO_SHADOW((uptr)p),
+ sizeof(uu16));
if (__msan_get_track_origins())
__msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p));
return *p;
}
u32 __sanitizer_unaligned_load32(const uu32 *p) {
- *(uu32 *)&__msan_retval_tls[0] = *(uu32 *)MEM_TO_SHADOW((uptr)p);
+ internal_memcpy(&__msan_retval_tls[0], (void *)MEM_TO_SHADOW((uptr)p),
+ sizeof(uu32));
if (__msan_get_track_origins())
__msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p));
return *p;
}
u64 __sanitizer_unaligned_load64(const uu64 *p) {
- __msan_retval_tls[0] = *(uu64 *)MEM_TO_SHADOW((uptr)p);
+ internal_memcpy(&__msan_retval_tls[0], (void *)MEM_TO_SHADOW((uptr)p),
+ sizeof(uu64));
if (__msan_get_track_origins())
__msan_retval_origin_tls = GetOriginIfPoisoned((uptr)p, sizeof(*p));
return *p;
}
void __sanitizer_unaligned_store16(uu16 *p, u16 x) {
- u16 s = *(uu16 *)&__msan_param_tls[1];
- *(uu16 *)MEM_TO_SHADOW((uptr)p) = s;
+ static_assert(sizeof(uu16) == sizeof(u16), "incompatible types");
+ u16 s;
+ internal_memcpy(&s, &__msan_param_tls[1], sizeof(uu16));
+ internal_memcpy((void *)MEM_TO_SHADOW((uptr)p), &s, sizeof(uu16));
if (s && __msan_get_track_origins())
if (uu32 o = __msan_param_origin_tls[2])
SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o);
*p = x;
}
void __sanitizer_unaligned_store32(uu32 *p, u32 x) {
- u32 s = *(uu32 *)&__msan_param_tls[1];
- *(uu32 *)MEM_TO_SHADOW((uptr)p) = s;
+ static_assert(sizeof(uu32) == sizeof(u32), "incompatible types");
+ u32 s;
+ internal_memcpy(&s, &__msan_param_tls[1], sizeof(uu32));
+ internal_memcpy((void *)MEM_TO_SHADOW((uptr)p), &s, sizeof(uu32));
if (s && __msan_get_track_origins())
if (uu32 o = __msan_param_origin_tls[2])
SetOriginIfPoisoned((uptr)p, (uptr)&s, sizeof(s), o);
--
2.25.2

Binary file not shown.

View File

@ -3,21 +3,35 @@
%global debug_package %{nil}
%endif
#%%global rc_ver 3
%global baserelease 1
#%%global rc_ver 6
%global baserelease 2
%global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src
# see https://sourceware.org/bugzilla/show_bug.cgi?id=25271
%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE)
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93615
%global optflags %(echo %{optflags} -Dasm=__asm__)
Name: compiler-rt
Version: 9.0.0
Version: 10.0.0
Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
Summary: LLVM "compiler-rt" runtime libraries
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
%if 0%{?rc_ver:1}
Source0: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{crt_srcdir}.tar.xz
Source1: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{crt_srcdir}.tar.xz.sig
%else
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{crt_srcdir}.tar.xz
Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{crt_srcdir}.tar.xz.sig
%endif
Source2: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
Patch0: 0001-PATCH-std-thread-copy.patch
Patch1: 0001-Fix-strict-aliasing-warning-in-msan.cpp.patch
# RHEL-specific patches
Patch100: 0001-Drop-fno-stack-protector-from-the-compiler-flags.patch
@ -40,7 +54,7 @@ instrumentation, and Blocks C language extension.
%prep
%autosetup -n %{crt_srcdir} -p1
pathfix.py -i %{__python3} -pn .
pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize
%build
mkdir -p _build
@ -62,18 +76,13 @@ make %{?_smp_mflags}
cd _build
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib
%ifarch aarch64
%global aarch64_blacklists hwasan_blacklist.txt
%endif
for file in %{aarch64_blacklists} asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt hwasan_blacklist.txt; do
mv -v %{buildroot}%{_datadir}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || :
done
# 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/
# 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
@ -117,8 +126,23 @@ fi
%files
%{_includedir}/*
%{_libdir}/clang/%{version}
%ifarch x86_64 aarch64
%{_bindir}/hwasan_symbolize
%endif
%changelog
* Mon Jun 15 2020 sguelton@redhat.com - 10.0.0-2
- Fix msan compilation warnings, see rhbz#1841165
* Wed Apr 8 2020 sguelton@redhat.com - 10.0.0-1
- 10.0.0 final
* Mon Jan 06 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-2
- Update fno-stack-protector patch to apply with -p2
* Fri Dec 20 2019 Tom Stellard <tstellar@redhat.com> - 9.0.1-1
- 9.0.1 Release
* Fri Sep 27 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
- 9.0.0 Release