Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updpkg: gcc #1096

Merged
merged 2 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions gcc/change-lto-arg.patch

This file was deleted.

70 changes: 34 additions & 36 deletions gcc/riscv64.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git PKGBUILD PKGBUILD
index 167aed24..f31567af 100644
index 167aed24..4e2c0ef0 100644
--- PKGBUILD
+++ PKGBUILD
@@ -7,7 +7,7 @@
Expand All @@ -25,7 +25,7 @@ index 167aed24..f31567af 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 +34,7 @@ index 167aed24..f31567af 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 +43,7 @@ index 167aed24..f31567af 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 +54,7 @@ index 167aed24..f31567af 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 +63,12 @@ index 167aed24..f31567af 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 +78,7 @@ index 167aed24..f31567af 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 +87,18 @@ index 167aed24..f31567af 100644
--enable-bootstrap \
$_confflags

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

+ # Patch spec strings embedded in binaries
+ sed -i 's/%{pthread:--push-state --as-needed -latomic --pop-state}/ --push-state --as-needed -latomic --pop-state /' gcc/xgcc
+ sed -i 's/%{pthread:--push-state --as-needed -latomic --pop-state}/ --push-state --as-needed -latomic --pop-state /' gcc/xg++
+
# Build libgccjit separately, to avoid building all compilers with --enable-host-shared
# which brings a performance penalty
cd "${srcdir}"/libgccjit-build
@@ -163,9 +173,9 @@ check() {
package_gcc-libs() {
pkgdesc='Runtime libraries shipped by GCC'
depends=('glibc>=2.27')
Expand All @@ -112,7 +110,7 @@ index 167aed24..f31567af 100644
replaces=($pkgname-multilib libgphobos)

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

@@ -192,24 +201,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 @@ -154,7 +152,7 @@ index 167aed24..f31567af 100644
provides=($pkgname-multilib)
replaces=($pkgname-multilib)
options=(!emptydirs staticlibs debug)
@@ -223,22 +230,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 @@ -179,7 +177,7 @@ index 167aed24..f31567af 100644

make DESTDIR="$pkgdir" install-fixincludes
make -C gcc DESTDIR="$pkgdir" install-mkheaders
@@ -249,20 +252,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 @@ -201,7 +199,7 @@ index 167aed24..f31567af 100644

make -C libcpp DESTDIR="$pkgdir" install
make -C gcc DESTDIR="$pkgdir" install-po
@@ -277,9 +274,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 @@ -211,7 +209,7 @@ index 167aed24..f31567af 100644
# byte-compile python libraries
python -m compileall "$pkgdir/usr/share/gcc-${pkgver%%+*}/"
python -O -m compileall "$pkgdir/usr/share/gcc-${pkgver%%+*}/"
@@ -299,8 +293,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 @@ -220,7 +218,7 @@ index 167aed24..f31567af 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 +322,6 @@ package_gcc-objc() {
@@ -330,45 +321,6 @@ package_gcc-objc() {
"$pkgdir/usr/share/licenses/$pkgname/"
}

Expand Down Expand Up @@ -266,7 +264,7 @@ index 167aed24..f31567af 100644
package_gcc-go() {
pkgdesc='Go front-end for GCC'
depends=("gcc=$pkgver-$pkgrel" libisl.so)
@@ -378,11 +331,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 @@ -279,7 +277,7 @@ index 167aed24..f31567af 100644
install -Dm755 gcc/go1 "$pkgdir/${_libdir}/go1"

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

Expand Down Expand Up @@ -323,7 +321,7 @@ index 167aed24..f31567af 100644
package_gcc-d() {
pkgdesc="D frontend for GCC"
depends=("gcc=$pkgver-$pkgrel" libisl.so)
@@ -443,7 +358,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