Skip to content

Commit

Permalink
updpkg: gcc
Browse files Browse the repository at this point in the history
Remove faulty LTO bootstrap in more elegant way.

Co-authored-by: XieJiSS <[email protected]>
  • Loading branch information
r-value and XieJiSS committed Apr 11, 2022
1 parent e3724dc commit 210340e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 80 deletions.
42 changes: 0 additions & 42 deletions gcc/change-lto-arg.patch

This file was deleted.

68 changes: 30 additions & 38 deletions gcc/riscv64.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git PKGBUILD PKGBUILD
index 167aed24..23e6ac62 100644
index 167aed24..eff59b8f 100644
--- PKGBUILD
+++ PKGBUILD
@@ -7,7 +7,7 @@
@@ -7,11 +7,11 @@
# toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc
# NOTE: libtool requires rebuilt with each new gcc version

Expand All @@ -11,6 +11,11 @@ index 167aed24..23e6ac62 100644
pkgver=11.2.0
_majorver=${pkgver%%.*}
_islver=0.24
-pkgrel=4
+pkgrel=4.4
pkgdesc='The GNU Compiler Collection'
arch=(x86_64)
license=(GPL LGPL FDL custom)
@@ -19,13 +19,9 @@ url='https://gcc.gnu.org'
makedepends=(
binutils
Expand All @@ -25,7 +30,7 @@ index 167aed24..23e6ac62 100644
python
zstd
)
@@ -41,9 +37,12 @@ _libdir=usr/lib/gcc/$CHOST/${pkgver%%+*}
@@ -41,6 +37,8 @@ _libdir=usr/lib/gcc/$CHOST/${pkgver%%+*}
# _commit=6beb39ee6c465c21d0cc547fd66b445100cdcc35
# source=(git://gcc.gnu.org/git/gcc.git#commit=$_commit
source=(https://sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz{,.sig}
Expand All @@ -34,11 +39,7 @@ index 167aed24..23e6ac62 100644
c89 c99
gdc_phobos_path.patch
gcc-ada-repro.patch
+ change-lto-arg.patch
)
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # [email protected]
86CFFCA918CF3AF47147588051E8B148A9999C34 # [email protected]
@@ -51,10 +50,13 @@ validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.
@@ -51,6 +49,8 @@ validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.
D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <[email protected]>
sha256sums=('d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b'
'SKIP'
Expand All @@ -47,13 +48,7 @@ index 167aed24..23e6ac62 100644
'de48736f6e4153f03d0a5d38ceb6c6fdb7f054e8f47ddd6af0a3dbf14f27b931'
'2513c6d9984dd0a2058557bf00f06d8d5181734e41dcfe07be7ed86f2959622a'
'c86372c207d174c0918d4aedf1cb79f7fc093649eb1ad8d9450dccc46849d308'
- '1773f5137f08ac1f48f0f7297e324d5d868d55201c03068670ee4602babdef2f')
+ '1773f5137f08ac1f48f0f7297e324d5d868d55201c03068670ee4602babdef2f'
+ 'f8311eeae6425aa8f150e6a477994b0d834f30cc85638fe640beae778c5c9f50')

prepare() {
[[ ! -d gcc ]] && ln -s gcc-${pkgver/+/-} gcc
@@ -66,12 +68,18 @@ prepare() {
@@ -66,6 +66,10 @@ prepare() {
# Arch Linux installs x86_64 libraries /lib
sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64

Expand All @@ -64,15 +59,7 @@ index 167aed24..23e6ac62 100644
# D hacks
patch -Np1 -i "$srcdir/gdc_phobos_path.patch"

# Reproducible gcc-ada
patch -Np0 < "$srcdir/gcc-ada-repro.patch"

+ patch -Np1 < "$srcdir/change-lto-arg.patch" # disable lto bootstrap because it is faulty
+
mkdir -p "$srcdir/gcc-build"
mkdir -p "$srcdir/libgccjit-build"
}
@@ -95,7 +103,7 @@ build() {
@@ -95,19 +99,21 @@ build() {
--enable-gnu-unique-object \
--enable-linker-build-id \
--enable-lto \
Expand All @@ -81,7 +68,12 @@ index 167aed24..23e6ac62 100644
--enable-plugin \
--enable-shared \
--enable-threads=posix \
@@ -108,6 +116,9 @@ build() {
--disable-libssp \
--disable-libstdcxx-pch \
--disable-werror \
- --with-build-config=bootstrap-lto \
--enable-link-serialization=1 \
gdc_include_dir=/usr/include/dlang/gdc"

cd gcc-build

Expand All @@ -91,7 +83,7 @@ index 167aed24..23e6ac62 100644
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/gcc/PKGBUILD
# TODO: properly deal with the build issues resulting from this
@@ -115,7 +126,7 @@ build() {
@@ -115,7 +121,7 @@ build() {
CXXFLAGS=${CXXFLAGS/-Werror=format-security/}

"$srcdir/gcc/configure" \
Expand All @@ -100,7 +92,7 @@ index 167aed24..23e6ac62 100644
--enable-bootstrap \
$_confflags

@@ -129,6 +140,10 @@ build() {
@@ -129,6 +135,10 @@ build() {
# make documentation
make -O -C $CHOST/libstdc++-v3/doc doc-man-doxygen

Expand All @@ -111,7 +103,7 @@ index 167aed24..23e6ac62 100644
# Build libgccjit separately, to avoid building all compilers with --enable-host-shared
# which brings a performance penalty
cd "${srcdir}"/libgccjit-build
@@ -163,9 +178,9 @@ check() {
@@ -163,9 +173,9 @@ check() {
package_gcc-libs() {
pkgdesc='Runtime libraries shipped by GCC'
depends=('glibc>=2.27')
Expand All @@ -123,7 +115,7 @@ index 167aed24..23e6ac62 100644
replaces=($pkgname-multilib libgphobos)

cd gcc-build
@@ -176,11 +191,9 @@ package_gcc-libs() {
@@ -176,11 +186,9 @@ package_gcc-libs() {
libgfortran \
libgo \
libgomp \
Expand All @@ -137,7 +129,7 @@ index 167aed24..23e6ac62 100644
make -C $CHOST/$lib DESTDIR="$pkgdir" install-toolexeclibLTLIBRARIES
done

@@ -192,24 +205,22 @@ package_gcc-libs() {
@@ -192,24 +200,22 @@ package_gcc-libs() {
rm -f "$pkgdir"/usr/lib/libgphobos.spec

for lib in libgomp \
Expand Down Expand Up @@ -165,7 +157,7 @@ index 167aed24..23e6ac62 100644
provides=($pkgname-multilib)
replaces=($pkgname-multilib)
options=(!emptydirs staticlibs debug)
@@ -223,22 +234,18 @@ package_gcc() {
@@ -223,22 +229,18 @@ package_gcc() {
install -m755 -t "$pkgdir/${_libdir}/" gcc/{cc1,cc1plus,collect2,lto1}

make -C $CHOST/libgcc DESTDIR="$pkgdir" install
Expand All @@ -190,7 +182,7 @@ index 167aed24..23e6ac62 100644

make DESTDIR="$pkgdir" install-fixincludes
make -C gcc DESTDIR="$pkgdir" install-mkheaders
@@ -249,20 +256,14 @@ package_gcc() {
@@ -249,20 +251,14 @@ package_gcc() {
"$pkgdir/usr/lib/bfd-plugins/"

make -C $CHOST/libgomp DESTDIR="$pkgdir" install-nodist_{libsubinclude,toolexeclib}HEADERS
Expand All @@ -212,7 +204,7 @@ index 167aed24..23e6ac62 100644

make -C libcpp DESTDIR="$pkgdir" install
make -C gcc DESTDIR="$pkgdir" install-po
@@ -277,9 +278,6 @@ package_gcc() {
@@ -277,9 +273,6 @@ package_gcc() {
# install the libstdc++ man pages
make -C $CHOST/libstdc++-v3/doc DESTDIR="$pkgdir" doc-install-man

Expand All @@ -222,7 +214,7 @@ index 167aed24..23e6ac62 100644
# byte-compile python libraries
python -m compileall "$pkgdir/usr/share/gcc-${pkgver%%+*}/"
python -O -m compileall "$pkgdir/usr/share/gcc-${pkgver%%+*}/"
@@ -299,8 +297,6 @@ package_gcc-fortran() {
@@ -299,8 +292,6 @@ package_gcc-fortran() {
cd gcc-build
make -C $CHOST/libgfortran DESTDIR="$pkgdir" install-cafexeclibLTLIBRARIES \
install-{toolexeclibDATA,nodist_fincludeHEADERS,gfor_cHEADERS}
Expand All @@ -231,7 +223,7 @@ index 167aed24..23e6ac62 100644
make -C $CHOST/libgomp DESTDIR="$pkgdir" install-nodist_fincludeHEADERS
make -C gcc DESTDIR="$pkgdir" fortran.install-{common,man,info}
install -Dm755 gcc/f951 "$pkgdir/${_libdir}/f951"
@@ -330,45 +326,6 @@ package_gcc-objc() {
@@ -330,45 +321,6 @@ package_gcc-objc() {
"$pkgdir/usr/share/licenses/$pkgname/"
}

Expand Down Expand Up @@ -277,7 +269,7 @@ index 167aed24..23e6ac62 100644
package_gcc-go() {
pkgdesc='Go front-end for GCC'
depends=("gcc=$pkgver-$pkgrel" libisl.so)
@@ -378,11 +335,10 @@ package_gcc-go() {
@@ -378,11 +330,10 @@ package_gcc-go() {

cd gcc-build
make -C $CHOST/libgo DESTDIR="$pkgdir" install-exec-am
Expand All @@ -290,7 +282,7 @@ index 167aed24..23e6ac62 100644
install -Dm755 gcc/go1 "$pkgdir/${_libdir}/go1"

# Install Runtime Library Exception
@@ -391,43 +347,6 @@ package_gcc-go() {
@@ -391,43 +342,6 @@ package_gcc-go() {
"$pkgdir/usr/share/licenses/$pkgname/"
}

Expand Down Expand Up @@ -334,7 +326,7 @@ index 167aed24..23e6ac62 100644
package_gcc-d() {
pkgdesc="D frontend for GCC"
depends=("gcc=$pkgver-$pkgrel" libisl.so)
@@ -443,7 +362,6 @@ package_gcc-d() {
@@ -443,7 +357,6 @@ package_gcc-d() {

make -C $CHOST/libphobos DESTDIR="$pkgdir" install
rm -f "$pkgdir/usr/lib/"lib{gphobos,gdruntime}.so*
Expand Down

0 comments on commit 210340e

Please sign in to comment.