core/gcc to 13.2.1-5

This commit is contained in:
Kevin Mihelich 2024-02-04 14:56:46 +00:00
parent 729b85d026
commit 4990f466b6
3 changed files with 77 additions and 18 deletions

View file

@ -1,7 +1,7 @@
pkgbase = gcc
pkgdesc = The GNU Compiler Collection
pkgver = 13.2.1
pkgrel = 4
pkgrel = 5
url = https://gcc.gnu.org
arch = x86_64
license = GPL-3.0-with-GCC-exception
@ -28,7 +28,7 @@ pkgbase = gcc
source = c89
source = c99
source = gcc-ada-repro.patch
source = https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.patch
source = fix-asan-allocator-aslr.patch
validpgpkeys = F3691687D867B81B51CE07D9BBE43771487328A9
validpgpkeys = 86CFFCA918CF3AF47147588051E8B148A9999C34
validpgpkeys = 13975A70E63C361C73AE69EF6EEB81F8981C74C7
@ -37,11 +37,11 @@ pkgbase = gcc
sha256sums = de48736f6e4153f03d0a5d38ceb6c6fdb7f054e8f47ddd6af0a3dbf14f27b931
sha256sums = 2513c6d9984dd0a2058557bf00f06d8d5181734e41dcfe07be7ed86f2959622a
sha256sums = 1773f5137f08ac1f48f0f7297e324d5d868d55201c03068670ee4602babdef2f
sha256sums = 0fab2541ab06d281a0d9d6cfc256499ff0a8638228094f6797580b83704e6e7c
sha256sums = 5ede1f5fec5b664428412a0849b28895be1c8d8982d3c0d246a4e95fd4730d65
pkgname = gcc
pkgdesc = The GNU Compiler Collection - C and C++ frontends
depends = gcc-libs=13.2.1-4
depends = gcc-libs=13.2.1-5
depends = binutils>=2.28
depends = libmpc
depends = zstd
@ -80,7 +80,7 @@ pkgname = lib32-gcc-libs
pkgname = gcc-ada
pkgdesc = Ada front-end for GCC (GNAT)
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
provides = gcc-ada-multilib
replaces = gcc-ada-multilib
@ -89,7 +89,7 @@ pkgname = gcc-ada
pkgname = gcc-d
pkgdesc = D frontend for GCC
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
provides = gdc
replaces = gdc
@ -97,14 +97,14 @@ pkgname = gcc-d
pkgname = gcc-fortran
pkgdesc = Fortran front-end for GCC
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
provides = gcc-fortran-multilib
replaces = gcc-fortran-multilib
pkgname = gcc-go
pkgdesc = Go front-end for GCC
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
provides = go=1.17
provides = gcc-go-multilib
@ -113,22 +113,22 @@ pkgname = gcc-go
pkgname = gcc-m2
pkgdesc = Modula-2 frontend for GCC
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
pkgname = gcc-objc
pkgdesc = Objective-C front-end for GCC
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
provides = gcc-objc-multilib
replaces = gcc-objc-multilib
pkgname = lto-dump
pkgdesc = Dump link time optimization object files
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so
pkgname = libgccjit
pkgdesc = Just-In-Time Compilation with GCC backend
depends = gcc=13.2.1-4
depends = gcc=13.2.1-5
depends = libisl.so

View file

@ -21,7 +21,7 @@ pkgname=(gcc gcc-libs gcc-d gcc-fortran gcc-go gcc-m2 gcc-objc lto-dump libgccji
pkgver=13.2.1
_majorver=${pkgver%%.*}
_commit=860b0f0ef787f756c0e293671b4c4622dff63a79
pkgrel=4
pkgrel=5
pkgdesc='The GNU Compiler Collection'
arch=(x86_64)
license=(GPL-3.0-with-GCC-exception GFDL-1.3-or-later)
@ -50,7 +50,7 @@ _libdir=usr/lib/gcc/$CHOST/${pkgver%%+*}
source=(git+https://sourceware.org/git/gcc.git#commit=${_commit}
c89 c99
gcc-ada-repro.patch
https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.patch
fix-asan-allocator-aslr.patch
844a5c8ca.patch::'https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=844a5c8ca768dc0cc90c1a943756610832d686a8'
)
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
@ -61,7 +61,7 @@ sha256sums=('SKIP'
'de48736f6e4153f03d0a5d38ceb6c6fdb7f054e8f47ddd6af0a3dbf14f27b931'
'2513c6d9984dd0a2058557bf00f06d8d5181734e41dcfe07be7ed86f2959622a'
'1773f5137f08ac1f48f0f7297e324d5d868d55201c03068670ee4602babdef2f'
'0fab2541ab06d281a0d9d6cfc256499ff0a8638228094f6797580b83704e6e7c'
'5ede1f5fec5b664428412a0849b28895be1c8d8982d3c0d246a4e95fd4730d65'
'6dc8d32e76bc6c7c1a24ae527062ec1b4f393c9f7e0e25f6ab4acc98f622a80f')
prepare() {
@ -88,7 +88,7 @@ prepare() {
[[ $CARCH == "aarch64" ]] && CONFIGFLAG="--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419"
#ASan: move allocator base to avoid conflict with high-entropy ASLR for x86-64 Linux'
patch -Np3 < "$srcdir/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.patch" -d libsanitizer/
patch -Np3 < "$srcdir/fix-asan-allocator-aslr.patch" -d libsanitizer/
mkdir -p "$srcdir/gcc-build"
mkdir -p "$srcdir/libgccjit-build"
@ -273,7 +273,7 @@ package_gcc() {
make -C $CHOST/libsanitizer/lsan DESTDIR="$pkgdir" install-nodist_toolexeclibHEADERS
make -C gcc DESTDIR="$pkgdir" install-man install-info
rm "$pkgdir"/usr/share/man/man1/{gccgo,gfortran,lto-dump,gdc}.1
rm "$pkgdir"/usr/share/man/man1/{gccgo,gfortran,lto-dump,gdc,gm2}.1
rm "$pkgdir"/usr/share/info/{gccgo,gfortran,gdc}.info
make -C libcpp DESTDIR="$pkgdir" install
@ -385,7 +385,6 @@ package_gcc-m2() {
install -Dm755 gcc/cc1gm2 "$pkgdir/$_libdir"/cc1gm2
install -Dm755 gcc/gm2 "$pkgdir"/usr/bin/gm2
install -Dm644 gcc/plugin/m2rte.so "$pkgdir/$_libdir"/plugin/m2rte.so
make -C $CHOST/libgm2 DESTDIR="$pkgdir" install

View file

@ -0,0 +1,60 @@
From fb77ca05ffb4f8e666878f2f6718a9fb4d686839 Mon Sep 17 00:00:00 2001
From: Thurston Dang <thurston@google.com>
Date: Thu, 13 Apr 2023 23:55:01 +0000
Subject: [PATCH] Re-land 'ASan: move allocator base to avoid conflict with
high-entropy ASLR for x86-64 Linux'
D147984 was reverted because it broke lit tests on Mac. This revision is based on D147984
but maintains the old behavior for Apple.
Note that, per the follow-up discussion with MaskRay in D147984, this patch excludes Apple
but includes other platforms (e.g., aarch64, MIPS64) and OSes (e.g., FreeBSD, S390X), not just
x86-64 Linux.
Original commit message from D147984:
Users have discovered [*] that when CONFIG_ARCH_MMAP_RND_BITS == 32,
it will frequently conflict with ASan's allocator on x86-64 Linux, because the
PIE program segment base address of 0x555555555554 plus an ASLR shift of up to
((2**32) * 4K == 0x100000000000) will sometimes exceed ASan's hardcoded
base address of 0x600000000000. We fix this by simply moving the allocator base
to 0x500000000000, which is below the PIE program segment base address. This is
cleaner than trying to move it to another location that is sandwiched between
the PIE program and library segments, because if either of those grow too large,
it will collide with the allocator region.
Note that we will never need to change this base address again (unless we want to increase
the size of the allocator), because ASLR cannot be set above 32-bits for x86-64 Linux (the
PIE program segment and library segments would collide with each other; see also
ARCH_MMAP_RND_BITS_MAX in https://github.com/torvalds/linux/blob/master/arch/x86/Kconfig).
[*] see https://b.corp.google.com/issues/276925478
and https://groups.google.com/a/google.com/g/chrome-os-gardeners/c/BbfzCP3dEeo/m/h3C_vVUxCQAJ
Differential Revision: https://reviews.llvm.org/D148280
---
compiler-rt/lib/asan/asan_allocator.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index 0b4dbf03bb9d5..6a12a6c602528 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -143,11 +143,15 @@ typedef DefaultSizeClassMap SizeClassMap;
const uptr kAllocatorSpace = ~(uptr)0;
const uptr kAllocatorSize = 0x8000000000ULL; // 500G
typedef DefaultSizeClassMap SizeClassMap;
-# else
+# elif SANITIZER_APPLE
const uptr kAllocatorSpace = 0x600000000000ULL;
const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
typedef DefaultSizeClassMap SizeClassMap;
-# endif
+# else
+const uptr kAllocatorSpace = 0x500000000000ULL;
+const uptr kAllocatorSize = 0x40000000000ULL; // 4T.
+typedef DefaultSizeClassMap SizeClassMap;
+# endif
template <typename AddressSpaceViewTy>
struct AP64 { // Allocator64 parameters. Deliberately using a short name.
static const uptr kSpaceBeg = kAllocatorSpace;