Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alistair23/pmaports
  • exkc/pmaports
  • fossdd/pmaports
  • JustSoup321/pmaports
  • Eisenbahnfan/pmaports
  • raihan2000/pmaports
  • sleirsgoevy/pmaports
  • Adrian/pmaports
  • adamthiede/pmaports
  • jianhua/pmaports
  • knuxify/pmaports
  • Arnavion/pmaports
  • barni2000/pmaports
  • longnoserob/pmaports
  • smankusors/pmaports
  • Aren/pmaports
  • langfingaz/pmaports
  • sicelo/pmaports
  • kouta-kun/pmaports
  • craftyguy/pmaports
  • rdacayan/pmaports
  • rmader/pmaports
  • Haui111/pmaports
  • jakko/pmaports
  • dujem/pmaports
  • methanal/pmaports
  • WeirdTreeThing/pmaports
  • MightyM17/pmaports
  • sertonix/pmaports
  • amessier/pmaports
  • akemnade/pmaports
  • setotau/pmaports
  • kevinwidjaja21/pmaports
  • NekoCWD/pmaports
  • ollieparanoid/pmaports
  • manoedinata/pmaports
  • Drakulix/pmaports
  • grimler/pmaports
  • benpicco/pmaports
  • Frieder.Hannenheim/pmaports
  • andrisas/pmaports
  • EspiDev/pmaports
  • maze42/pmaports
  • anjandev/pmaports
  • danct12/pmaports
  • ijiki16/pmaports
  • jja2000/pmaports
  • fancsali/pmaports
  • bolilingmeng89006/pmaports
  • Minecrell/pmaports
  • chipiguay/pmaports
  • cherrypicker/pmaports
  • fortuna-mainline/pmaports
  • pevik/pmaports
  • Patriot-06/pmaports
  • JoseskVolpe/pmaports
  • verdre/pmaports
  • proycon/pmaports
  • AutumnSpark1226/pmaports
  • PsychoGame/pmaports
  • fraolt/pmaports
  • VaporGame/pmaports
  • pugzarecute/pmaports
  • CalcProgrammer1/pmaports
  • hexaheximal/pmaports
  • dabao1955/pmaports
  • HenriDellal/pmaports
  • semfault/pmaports
  • strobo5/pmaports
  • andrewgigena/pmaports
  • Athozus/pmaports
  • 1peter10/pmaports
  • vixalien/pmaports
  • Tooniis/pmaports
  • adomerle/pmaports
  • bjorn3/pmaports
  • StacyHarper/pmaports
  • Jack_Kekzoz/pmaports
  • Ceddicedced/pmaports
  • Justin_Zobel/pmaports
  • airtower-luna/pmaports
  • f-izzo/pmaports
  • cosmo/pmaports
  • 9lore/pmaports
  • postmarketOS/pmaports
  • Johnnynator/pmaports
  • iAboothahir/pmaports
  • N1kroks/pmaports
  • neuschaefer/pmaports
  • DylanVanAssche/pmaports
  • yehiashamaa987/pmaports
  • Operachi/pmaports
  • faveoled/pmaports
  • ilpianista/pmaports
  • johkra/pmaports
  • HDDTHR/pmaports
  • zsoltiv/pmaports
  • Justin/pmaports
  • Kaloyan501/pmaports_huawei_p8_lite_2015_fix
  • joelselvaraj/pmaports
  • rontti/pmaports
  • dsankouski/pmaports
  • StandaSK/pmaports
  • paricbat/pmaports
  • asdfugil/pmaports
  • komaru-yml/pmaports
  • MasterPlexus/pmaports
  • Felix/pmaports
  • ayakael/pmaports
  • feisuzhu/pmaports
  • AJ-RR/pmaports
  • SzczurekYT/pmaports
  • mediaberry/pmaports
  • justsomeguy/pmaports
  • Augis154/pmaports
  • hrdl/pmaports
  • sib0ndt/pmaports
  • 19atlas/pmaports
  • vipaoL/pmaports
  • wannjanjic/pmaports
  • dh/pmaports
  • LogicalErzor/pmaports
  • halamix2/pmaports
  • Shamilkv34/pmaports
  • Cogitri/pmaports
  • fallenritemonk/pmaports
  • user0-07161/pmaports
  • rock3tsprocket/pmaports
  • ellyq/pmaports
  • rodent/pmaports
  • mkorpershoek/pmaports
  • candrew/pmaports
  • fallaciousreasoning/pmaports
  • chalkin/pmaports
  • ungeskriptet/pmaports
  • r00t/pmaports
  • panpanpanpan/pmaports
  • celiffe/pmaports
  • davidfurey/pmaports
  • kidd/pmaports
  • tpikonen/pmaports
  • camelCaseNick/pmaports
  • ermine/pmaports
  • lgh/pmaports
  • sajattack/pmaports
  • StephanieBread/pmaports
  • M0Rf30/pmaports
  • notfound405/pmaports
  • samueldr/pmaports
  • r10nw7fd3/pmaports
  • treid998/pmaports-merge
  • denysvitali/pmaports
  • rodriguezst/pmaports
  • puppiestdoggo1/pmaports
  • donihalim/pmaports
  • EDKPiepaint/pmaports-apple-tonga-test
156 results
Show changes
Commits on Source (32)
Showing
with 1428 additions and 1002 deletions
#!/bin/sh -e
# Description: update a list of packages
# Options: native slow
# https://postmarketos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
......@@ -14,11 +11,7 @@ fi
git config --global --add safe.directory "$CI_PROJECT_DIR"
git config --global user.name "postmarketOS CI"
# pmaports
# The email address is the username of the bot (from the GitLab group members page) @noreply.gitlab.com
git config --global user.email "project_8065375_bot_13cf44ca4cd2c938688af6e3d500d9cb@noreply.gitlab.com"
# For testing with pmaports-autoupdate-test repo
# git config --global user.email "project_58002231_bot_be2d4e9e7aba929855726aafe12940d6@noreply.gitlab.com"
git config --global user.email "project_226_bot_a365eaa0c380d1bee0af03adf42ebea3@noreply.gitlab.postmarketos.org"
# Configure SSH key for signing
mkdir -p ~/.ssh
......
......@@ -100,7 +100,7 @@ def get_changed_files(removed=True):
commit_head = run_git(["rev-parse", "HEAD"])[:-1]
commit_upstream = run_git(["rev-parse", branch_upstream])[:-1]
print("commit HEAD: " + commit_head)
print(f"commit {branch_upstream}: f{commit_upstream}")
print(f"commit {branch_upstream}: {commit_upstream}")
# Check if we are HEAD on the upstream branch
if commit_head == commit_upstream:
......
......@@ -10,7 +10,12 @@ stages:
- lint
- build
- autoupdate
variables:
# Default of 20 is pretty small, sometimes MRs have >20 commits in them. 100
# seems like a reasonable balance. If this is too low, git merge-base (from ci/
# common.py) can fail
GIT_DEPTH: 100
# This defines the rules for when a pipeline should run.
workflow:
rules:
......
......@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-aarch64
pkgver=1.36.1
pkgrel=32
pkgver=1.37.0
pkgrel=3
_arch="aarch64"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
88f07677919711bb577f60e1861f4fa555168a8703a0a3b904550e24d4045135bb0296e00464899fc6231df07db09bb11f1bc81cdf593a71a8f74dfc3333c29e busybox-static-1.36.1-r32-aarch64-edge.apk
c0e12a73463638803a7adddb241f93ae0617498bb88bc349c62e2e1fe0b3ee25ebec1853e21bd0a42efb7578f09c8d0324073bc93a530855030d4f192a49e0b0 busybox-static-1.37.0-r3-aarch64-edge.apk
"
......@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armhf
pkgver=1.36.1
pkgrel=32
pkgver=1.37.0
pkgrel=3
_arch="armhf"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
b0985e2f62df8f1d4e1b7a1206dc3e462df1e6b2a8aae662e57cc497ca3f474f37cc952de0d3bbaad6532d569bf540f17ad4eccc9cabfdc3c9f95f8feaf08049 busybox-static-1.36.1-r32-armhf-edge.apk
a56b1f41818d5c4c9096c406e7a3d61ed1ea97624bd274c0f6f8914276cf041ee2cd6a170241f9cc93ed170fe13f183304166bfa12152d261cf898f838c1e781 busybox-static-1.37.0-r3-armhf-edge.apk
"
......@@ -7,8 +7,8 @@ if [ -z "$(type -t arch_to_hostspec)" ]; then
fi
pkgname=busybox-static-armv7
pkgver=1.36.1
pkgrel=32
pkgver=1.37.0
pkgrel=3
_arch="armv7"
_mirror="http://dl-4.alpinelinux.org/alpine/"
......@@ -32,5 +32,5 @@ package() {
}
sha512sums="
f383286e58183232b41a0d299528734cb29b11e51112eab1fe513322a269a2cdf90a1341d7e329ed7cd58e2d158e3a80bc3a5290ef93de2b28aaf7a25b78bfd7 busybox-static-1.36.1-r32-armv7-edge.apk
f4027d0be53ae42fb079208e04f2ad9ca6971b8b489389c4ebae364f423cea361d2a304dd0ceced1acf3780583456fc404d599760ea9df0550f77c11eac30a04 busybox-static-1.37.0-r3-armv7-edge.apk
"
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-aarch64
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for aarch64"
url="https://gcc.gnu.org"
arch="x86_64"
......@@ -44,9 +44,10 @@ depends="binutils-aarch64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-aarch64 binutils-aarch64"
subpackages="g++-aarch64:gpp libstdc++-dev-aarch64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +136,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +170,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +218,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +233,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +243,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +282,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +290,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +328,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +357,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +379,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +387,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +398,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +414,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +429,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +473,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +538,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +551,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +569,12 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +593,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +620,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +637,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +664,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +690,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +699,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +731,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +785,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armhf
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for armhf"
url="https://gcc.gnu.org"
arch="x86_64"
......@@ -44,9 +44,10 @@ depends="binutils-armhf mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armhf binutils-armhf"
subpackages="g++-armhf:gpp libstdc++-dev-armhf:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +136,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +170,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +218,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +233,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +243,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +282,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +290,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +328,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +357,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +379,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +387,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +398,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +414,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +429,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +473,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +538,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +551,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +569,12 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +593,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +620,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +637,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +664,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +690,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +699,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +731,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +785,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-armv7
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for armv7"
url="https://gcc.gnu.org"
arch="x86_64"
......@@ -44,9 +44,10 @@ depends="binutils-armv7 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-armv7 binutils-armv7"
subpackages="g++-armv7:gpp libstdc++-dev-armv7:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +136,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +170,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +218,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +233,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +243,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +282,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +290,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +328,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +357,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +379,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +387,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +398,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +414,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +429,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +473,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +538,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +551,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +569,12 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +593,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +620,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +637,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +664,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +690,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +699,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +731,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +785,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-riscv64
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for riscv64"
url="https://gcc.gnu.org"
arch="x86_64"
......@@ -44,9 +44,10 @@ depends="binutils-riscv64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-riscv64 binutils-riscv64"
subpackages="g++-riscv64:gpp libstdc++-dev-riscv64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +136,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +170,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +218,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +233,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +243,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +282,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +290,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +328,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +357,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +379,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +387,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +398,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +414,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +429,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +473,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +538,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +551,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +569,12 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +593,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +620,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +637,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +664,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +690,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +699,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +731,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +785,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-x86
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for x86"
url="https://gcc.gnu.org"
arch="x86_64"
......@@ -44,9 +44,10 @@ depends="binutils-x86 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-x86 binutils-x86"
subpackages="g++-x86:gpp libstdc++-dev-x86:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-x86_64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +136,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +170,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +218,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +233,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +243,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +282,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +290,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +328,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +357,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +379,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +387,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +398,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +414,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +429,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +473,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +538,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +551,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +569,12 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-x86_64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +593,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +620,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +637,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +664,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +690,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +699,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +731,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +785,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -34,7 +34,7 @@ _pkgsnap="${pkgver##*_git}"
[ "$CHOST" != "$CTARGET" ] && _target="-$CTARGET_ARCH" || _target=""
pkgname=gcc-x86_64
pkgrel=3
pkgrel=4
pkgdesc="Stage2 cross-compiler for x86_64"
url="https://gcc.gnu.org"
arch="aarch64"
......@@ -44,9 +44,11 @@ depends="binutils-x86_64 mpc1"
makedepends_build="gcc g++ bison flex texinfo gawk zip gmp-dev mpfr-dev mpc1-dev zlib-dev"
makedepends_host="linux-headers gmp-dev mpfr-dev mpc1-dev isl-dev zlib-dev musl-dev-x86_64 binutils-x86_64"
subpackages="g++-x86_64:gpp libstdc++-dev-x86_64:libcxx_dev"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc$_target"
[ "$CHOST" = "$CTARGET" ] && subpackages="gcc-gdb gcc-doc"
replaces="libstdc++ binutils"
options="!strip"
options="!strip !tracedeps"
depends="$depends so:libc.musl-aarch64.so.1 so:libgcc_s.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libstdc++.so.6 so:libz.so.1"
: "${LANG_CXX:=true}"
: "${LANG_D:=true}"
......@@ -135,7 +137,6 @@ else
export CXXFLAGS_FOR_TARGET="$CXXFLAGS"
export LDFLAGS_FOR_TARGET="$LDFLAGS"
export BOOT_CFLAGS="$CFLAGS"
export BOOT_CXXFLAGS="$CXXFLAGS"
export BOOT_LDFLAGS="$LDFLAGS"
fi
......@@ -170,7 +171,7 @@ esac
# currently on x86, x86_64 and ia64
_libquadmath=$LANG_FORTRAN
case "$CTARGET_ARCH" in
x86 | x86_64 | ppc64le) _libquadmath=$LANG_FORTRAN ;;
x86 | x86_64 | ppc64le) ;;
*) _libquadmath=false ;;
esac
......@@ -218,13 +219,12 @@ if $LANG_FORTRAN; then
_languages="$_languages,fortran"
fi
if $LANG_ADA; then
subpackages="$subpackages gcc-gnat$_target:gnat"
subpackages="$subpackages gcc-gnat$_target:gnat libgnat::$CTARGET_ARCH"
_languages="$_languages,ada"
if [ "$CBUILD" = "$CTARGET" ]; then
makedepends_build="$makedepends_build gcc-gnat-bootstrap"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH libgnat::$CTARGET_ARCH"
subpackages="$subpackages libgnat-static:libgnatstatic:$CTARGET_ARCH"
else
subpackages="$subpackages libgnat::$CTARGET_ARCH"
makedepends_build="$makedepends_build gcc-gnat gcc-gnat$_cross"
fi
fi
......@@ -234,7 +234,7 @@ fi
makedepends="$makedepends_build $makedepends_host"
# when using upstream releases, use this URI template
# https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
# https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
#
# right now, we are using a git snapshot. snapshots are taken from gcc.gnu.org/pub/gcc/snapshots.
# However, since they are periodically deleted from the GCC mirrors the utilized snapshots are
......@@ -244,7 +244,7 @@ makedepends="$makedepends_build $makedepends_host"
# PLEASE submit all patches to gcc to https://gitlab.alpinelinux.org/kaniini/alpine-gcc-patches,
# so that they can be properly tracked and easily rebased if needed.
#source="https://dev.alpinelinux.org/archive/gcc/${_pkgbase%%.*}-$_pkgsnap/gcc-${_pkgbase%%.*}-$_pkgsnap.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkgbase:-$pkgver}.tar.xz
source="https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgbase/gcc-$_pkgbase.tar.xz
0001-posix_memalign.patch
0002-gcc-poison-system-directories.patch
0003-specs-turn-on-Wl-z-now-by-default.patch
......@@ -283,6 +283,7 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
0036-libphobos-add-riscv64-and-loongarch64-support.patch
fix-arm64.patch
ppc64le-quadmath.patch
riscv64-improve-build-time.patch
"
# secfixes:
......@@ -290,44 +291,21 @@ source="https://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$pkgver}/gcc-${_pkg
# - CVE-2023-4039
# we build out-of-tree
#_gccdir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
_gccdir="$srcdir"/gcc-${_pkgbase:-$pkgver}
_gcclibdir="/usr/lib/gcc/$CTARGET/${_pkgbase:-$pkgver}"
_gcclibexec="/usr/libexec/gcc/$CTARGET/${_pkgbase:-$pkgver}"
#builddir="$srcdir"/gcc-${_pkgbase%%.*}-$_pkgsnap
builddir="$srcdir"/gcc-$_pkgbase
_gcclibdir="/usr/lib/gcc/$CTARGET/$_pkgbase"
_gcclibexec="/usr/libexec/gcc/$CTARGET/$_pkgbase"
prepare() {
cd "$_gccdir"
_err=
for i in $source; do
case "$i" in
*.patch)
msg "Applying $i"
patch -p1 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
if [ -n "$_err" ]; then
error "The following patches failed:"
for i in $_err; do
echo " $i"
done
return 1
fi
echo ${_pkgbase:-$pkgver} > gcc/BASE-VER
default_prepare
echo $_pkgbase > gcc/BASE-VER
}
build() {
local _arch_configure=
local _libc_configure=
local _bootstrap_configure=
local _symvers=
local _jit_configure=
cd "$_gccdir"
case "$CTARGET" in
aarch64-*-*-*) _arch_configure="--with-arch=armv8-a --with-abi=lp64";;
armv5-*-*-*eabi) _arch_configure="--with-arch=armv5te --with-tune=arm926ej-s --with-float=soft --with-abi=aapcs-linux";;
......@@ -351,15 +329,7 @@ build() {
*) _hash_style_configure="--with-linker-hash-style=gnu" ;;
esac
case "$CTARGET_LIBC" in
musl)
# musl does not support libsanitizer
# alpine musl provides libssp_nonshared.a, so we don't need libssp either
_libc_configure="--disable-libssp --disable-libsanitizer"
_symvers="--disable-symvers"
export libat_cv_have_ifunc=no
;;
esac
export libat_cv_have_ifunc=no
case "$BOOTSTRAP" in
......@@ -388,10 +358,8 @@ build() {
echo " CHOST=$CHOST"
echo " CTARGET=$CTARGET"
echo " CTARGET_ARCH=$CTARGET_ARCH"
echo " CTARGET_LIBC=$CTARGET_LIBC"
echo " languages=$_languages"
echo " arch_configure=$_arch_configure"
echo " libc_configure=$_libc_configure"
echo " cross_configure=$_cross_configure"
echo " bootstrap_configure=$_bootstrap_configure"
echo " hash_style_configure=$_hash_style_configure"
......@@ -412,7 +380,7 @@ build() {
--disable-multilib
--disable-nls
--disable-werror
$_symvers
--disable-symvers
--enable-__cxa_atexit
--enable-default-pie
--enable-default-ssp
......@@ -420,7 +388,8 @@ build() {
--enable-link-serialization=2
--enable-linker-build-id
$_arch_configure
$_libc_configure
--disable-libssp
--disable-libsanitizer
$_cross_configure
$_bootstrap_configure
--with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues
......@@ -430,7 +399,7 @@ build() {
mkdir -p "$_builddir"
cd "$_builddir"
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--with-pkgversion="$version"
msg "building gcc"
......@@ -446,7 +415,7 @@ build() {
if $LANG_JIT; then
mkdir -p "$_builddir"/libgccjit-build
cd "$_builddir"/libgccjit-build
"$_gccdir"/configure $gccconfiguration \
"$builddir"/configure $gccconfiguration \
--disable-bootstrap \
--enable-host-shared \
--enable-languages=jit \
......@@ -461,7 +430,7 @@ package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
ln -s gcc "$pkgdir"/usr/bin/cc
[ "$CHOST" = "$CTARGET" ] && ln -s gcc "$pkgdir"/usr/bin/cc
ln -s ${CTARGET}-gcc "$pkgdir"/usr/bin/${CTARGET}-cc
if $LANG_JIT; then
......@@ -505,25 +474,23 @@ package() {
# move ada runtime libs
if $LANG_ADA; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.so"); do
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 \( -name "libgna*.so" -o -name "libgna*.a" \) ); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
if [ "$CHOST" = "$CTARGET" ]; then
for i in $(find "$pkgdir"/$_gcclibdir/adalib/ -type f -maxdepth 1 -name "libgna*.a"); do
mv "$i" "$pkgdir"/usr/lib/
ln -s ../../../../${i##*/} $i
done
fi
fi
if [ "$CHOST" != "$CTARGET" ]; then
# cross-gcc: remove any files that would conflict with the
# native gcc package
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
rm -rf "$pkgdir"/usr/include "${pkgdir:?}"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# These are moved into packages with arch=$CTARGET_ARCH so remove
# cross prefix
#mv "$pkgdir"/usr/$CTARGET/lib/*.so.* "$pkgdir"/usr/lib/ # FIXME
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/"$CTARGET"/lib/*.so; do
......@@ -572,8 +539,7 @@ libatomic() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libatomic.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libatomic.so.*
}
libcxx() {
......@@ -586,8 +552,7 @@ libcxx() {
nm -D "$pkgdir"/usr/lib/libstdc++.so.* | grep clock_gettime
fi
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libstdc++.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libstdc++.so.*
}
libcxx_dev() {
......@@ -605,15 +570,13 @@ libcxx_dev() {
gpp() {
pkgdesc="GNU C++ standard library and compiler"
depends="libstdc++=$_gccrel libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel libc-dev"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/usr/bin \
"$subpkgdir"/usr/${_target:+$CTARGET/}include \
"$subpkgdir"/usr/${_target:+$CTARGET/}lib \
depends="libstdc++-dev$_target=$_gccrel gcc$_target=$_gccrel musl-dev"
depends="$depends so:libc.musl-aarch64.so.1 so:libgmp.so.10 so:libisl.so.23 so:libmpc.so.3 so:libmpfr.so.6 so:libz.so.1"
mv "$pkgdir/$_gcclibexec/cc1plus" "$subpkgdir/$_gcclibexec/"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libstdc++=$_gccrel"
mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
amove $_gcclibexec/cc1plus
amove usr/bin/*++
}
jit() {
......@@ -632,30 +595,26 @@ libobjc() {
pkgdesc="GNU Objective-C runtime"
replaces="objc"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libobjc.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libobjc.so.*
}
objc() {
pkgdesc="GNU Objective-C"
replaces="gcc"
depends="libc-dev gcc=$_gccrel libobjc=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include \
"$subpkgdir"/usr/lib
mv "$pkgdir/$_gcclibexec/cc1obj" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/objc "$subpkgdir"/$_gcclibdir/include/
mv "$pkgdir"/usr/lib/libobjc.so "$pkgdir"/usr/lib/libobjc.a \
"$subpkgdir"/usr/lib/
depends="musl-dev gcc=$_gccrel libobjc=$_gccrel"
amove $_gcclibexec/cc1obj
amove $_gcclibdir/include/objc
amove usr/lib/libobjc.so
amove usr/lib/libobjc.a
}
libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgcc_s.so.*
}
libgomp() {
......@@ -663,17 +622,15 @@ libgomp() {
depends=
replaces="gcc"
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/${_target:+$CTARGET/}lib/libgomp.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgomp.so.*
}
libgphobos() {
pkgdesc="D programming language standard library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgdruntime.so.* "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgdruntime.so.*
amove usr/lib/libgphobos.so.*
}
gdc() {
......@@ -682,42 +639,26 @@ gdc() {
[ "$CBUILD" = "$CTARGET" ] && depends="$depends libgphobos=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && provides="gcc-gdc-bootstrap=$_gccrel"
mkdir -p "$subpkgdir/$_gcclibexec" \
"$subpkgdir"/$_gcclibdir/include/d/ \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
# Copy: The installed '.d' files, the static lib, the binary itself
# The shared libs are part of 'libgphobos' so one can run program
# without installing the compiler
mv "$pkgdir/$_gcclibexec/d21" "$subpkgdir/$_gcclibexec/"
mv "$pkgdir"/$_gcclibdir/include/d/* "$subpkgdir"/$_gcclibdir/include/d/
amove $_gcclibexec/d21
amove $_gcclibdir/include/d
if [ "$CBUILD" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.so "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.so "$subpkgdir"/usr/lib/
fi
if [ "$CHOST" = "$CTARGET" ]; then
mv "$pkgdir"/usr/lib/libgdruntime.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.a "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/libgphobos.spec "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/gdc "$subpkgdir"/usr/bin/
else
mkdir -p "$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgdruntime.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.a \
"$subpkgdir"/usr/$CTARGET/lib/
mv "$pkgdir"/usr/$CTARGET/lib/libgphobos.spec \
"$subpkgdir"/usr/$CTARGET/lib/
amove usr/lib/libgdruntime.so
amove usr/lib/libgphobos.so
fi
mv "$pkgdir"/usr/bin/$CTARGET-gdc "$subpkgdir"/usr/bin/
amove usr/${_target:+$CTARGET/}lib/libgdruntime.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.a
amove usr/${_target:+$CTARGET/}lib/libgphobos.spec
amove usr/bin/*gdc
}
libgo() {
pkgdesc="Go runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgo.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgo.so.*
}
go() {
......@@ -725,31 +666,25 @@ go() {
depends="gcc=$_gccrel libgo=$_gccrel !go"
install="$pkgname-go.post-install"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/lib/go "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/bin/*gccgo "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/bin/*go "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gofmt "$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/go1 "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/cgo "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/buildid "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/test2json "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibexec/vet "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/usr/lib/libgo.a \
"$pkgdir"/usr/lib/libgo.so \
"$pkgdir"/usr/lib/libgobegin.a \
"$pkgdir"/usr/lib/libgolibbegin.a \
"$subpkgdir"/usr/lib/
amove usr/lib/go
amove usr/bin/*go
amove usr/bin/*gofmt
amove $_gcclibexec/go1
amove $_gcclibexec/cgo
amove $_gcclibexec/buildid
amove $_gcclibexec/test2json
amove $_gcclibexec/vet
amove usr/lib/libgo.a
amove usr/lib/libgo.so
amove usr/lib/libgobegin.a
amove usr/lib/libgolibbegin.a
}
libgfortran() {
pkgdesc="Fortran runtime library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgfortran.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libgfortran.so.*
}
libquadmath() {
......@@ -757,8 +692,7 @@ libquadmath() {
pkgdesc="128-bit math library for GCC"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libquadmath.so.* "$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.so.*
}
gfortran() {
......@@ -767,38 +701,30 @@ gfortran() {
$_libquadmath && depends="$depends libquadmath=$_gccrel"
replaces="gcc"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/lib \
"$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/*gfortran "$subpkgdir"/usr/bin/
mv "$pkgdir"/usr/lib/libgfortran.a \
"$pkgdir"/usr/lib/libgfortran.so \
"$subpkgdir"/usr/lib/
amove usr/bin/*gfortran
amove usr/lib/libgfortran.a
amove usr/lib/libgfortran.so
if $_libquadmath; then
mv "$pkgdir"/usr/lib/libquadmath.a \
"$pkgdir"/usr/lib/libquadmath.so \
"$subpkgdir"/usr/lib/
amove usr/lib/libquadmath.a
amove usr/lib/libquadmath.so
fi
mv "$pkgdir"/$_gcclibdir/finclude "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/$_gcclibexec/f951 "$subpkgdir"/$_gcclibexec
mv "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir
amove $_gcclibdir/finclude
amove $_gcclibexec/f951
mv -v "$pkgdir"/usr/lib/libgfortran.spec "$subpkgdir"/$_gcclibdir/
}
libgnat() {
pkgdesc="GNU Ada runtime shared libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.so "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.so
}
libgnatstatic() {
pkgdesc="GNU Ada static libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libgna*.a "$subpkgdir"/usr/lib/
amove usr/lib/libgna*.a
}
gnat() {
......@@ -807,12 +733,9 @@ gnat() {
provides="$pkgname-gnat-bootstrap=$_gccrel"
[ "$CHOST" = "$CTARGET" ] && depends="$depends libgnat=$_gccrel"
mkdir -p "$subpkgdir"/$_gcclibexec \
"$subpkgdir"/$_gcclibdir \
"$subpkgdir"/usr/bin
mv "$pkgdir"/$_gcclibexec/*gnat* "$subpkgdir"/$_gcclibexec/
mv "$pkgdir"/$_gcclibdir/*ada* "$subpkgdir"/$_gcclibdir/
mv "$pkgdir"/usr/bin/*gnat* "$subpkgdir"/usr/bin/
amove $_gcclibexec/*gnat*
amove $_gcclibdir/*ada*
amove usr/bin/*gnat*
}
gdb() {
......@@ -864,4 +787,5 @@ c4482ffc36e7894b2140800159f4cbc9a3e9011e43a69b69f4fa92d5a11e2ee645c7e21df4423dd1
06f64544fd8bc4b6c8b06410c5198aa8fb4e82c232afc0cad83b2c69ac5d39399968206defa78297222700cd18e7fd7e8244afa76d343406a01f657c86306453 0036-libphobos-add-riscv64-and-loongarch64-support.patch
00319c9770362520e8e93bd03fda1769dfa3622eba77d620e11d8af45a38e6d804a5e924046ae388e1cfaea605696e89c343fca507aaaa5edd58d80744fff14f fix-arm64.patch
815265826742400f86336f0c2d3e4edc37398dbc6505ee81107c0103c13ac0f406cff851438d2323033c6c6d0c0323765ee15b975eab8d1dd465f9e988168fb9 ppc64le-quadmath.patch
ea55e0fa6813fc95c4ca2e87f059182edc54dc61515ebb92bf6eb31dbbd176d0fe81edcc7ea28d32f84ca37e8d48a544623d3d9bc94aa41ffc0859326a616aa2 riscv64-improve-build-time.patch
"
Patch-Source: https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2cf89ae83225f932b226cd57ef2d083a59bcf8a3
--
From 2cf89ae83225f932b226cd57ef2d083a59bcf8a3 Mon Sep 17 00:00:00 2001
From: Richard Biener <rguenther@suse.de>
Date: Tue, 6 Aug 2024 14:56:26 +0200
Subject: [PATCH] tree-optimization/116166 - forward jump-threading going wild
Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.
The following makes the forward threader honor the search space
limit I introduced for the backward threader. This reduces
compile-time from minutes to seconds for the testcase in PR116166.
Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).
PR tree-optimization/116166
* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
Add limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
Honor and decrement limit parameter.
(jump_threader::thread_through_normal_block): Likewise.
(jump_threader::thread_across_edge): Initialize limit from
param_max_jump_thread_paths and pass it down to workers.
---
gcc/tree-ssa-threadedge.cc | 30 ++++++++++++++++++++++--------
gcc/tree-ssa-threadedge.h | 4 ++--
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc
index 7f82639b8ecc..0aa2aa851430 100644
--- a/gcc/tree-ssa-threadedge.cc
+++ b/gcc/tree-ssa-threadedge.cc
@@ -786,13 +786,17 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src)
bool
jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
edge taken_edge,
- bitmap visited)
+ bitmap visited, unsigned &limit)
{
basic_block bb = taken_edge->dest;
gimple_stmt_iterator gsi;
gimple *stmt;
tree cond;
+ if (limit == 0)
+ return false;
+ --limit;
+
/* The key property of these blocks is that they need not be duplicated
when threading. Thus they cannot have visible side effects such
as PHI nodes. */
@@ -830,7 +834,8 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
bitmap_set_bit (visited, taken_edge->dest->index);
- return thread_around_empty_blocks (path, taken_edge, visited);
+ return thread_around_empty_blocks (path, taken_edge, visited,
+ limit);
}
}
@@ -872,7 +877,7 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
m_registry->push_edge (path, taken_edge, EDGE_NO_COPY_SRC_BLOCK);
m_state->append_path (taken_edge->dest);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return true;
}
@@ -899,8 +904,13 @@ jump_threader::thread_around_empty_blocks (vec<jump_thread_edge *> *path,
int
jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge e, bitmap visited)
+ edge e, bitmap visited,
+ unsigned &limit)
{
+ if (limit == 0)
+ return 0;
+ limit--;
+
m_state->register_equivs_edge (e);
/* PHIs create temporary equivalences.
@@ -989,7 +999,7 @@ jump_threader::thread_through_normal_block (vec<jump_thread_edge *> *path,
visited. This may be overly conservative. */
bitmap_set_bit (visited, dest->index);
bitmap_set_bit (visited, e->dest->index);
- thread_around_empty_blocks (path, taken_edge, visited);
+ thread_around_empty_blocks (path, taken_edge, visited, limit);
return 1;
}
}
@@ -1075,9 +1085,12 @@ jump_threader::thread_across_edge (edge e)
bitmap_set_bit (visited, e->src->index);
bitmap_set_bit (visited, e->dest->index);
+ /* Limit search space. */
+ unsigned limit = param_max_jump_thread_paths;
+
int threaded = 0;
if ((e->flags & EDGE_DFS_BACK) == 0)
- threaded = thread_through_normal_block (path, e, visited);
+ threaded = thread_through_normal_block (path, e, visited, limit);
if (threaded > 0)
{
@@ -1148,11 +1161,12 @@ jump_threader::thread_across_edge (edge e)
m_registry->push_edge (path, e, EDGE_START_JUMP_THREAD);
m_registry->push_edge (path, taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
- found = thread_around_empty_blocks (path, taken_edge, visited);
+ found = thread_around_empty_blocks (path, taken_edge, visited, limit);
if (!found)
found = thread_through_normal_block (path,
- path->last ()->e, visited) > 0;
+ path->last ()->e, visited,
+ limit) > 0;
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
diff --git a/gcc/tree-ssa-threadedge.h b/gcc/tree-ssa-threadedge.h
index 9f6cbfe93307..245b3506a550 100644
--- a/gcc/tree-ssa-threadedge.h
+++ b/gcc/tree-ssa-threadedge.h
@@ -101,9 +101,9 @@ private:
unsigned limit);
bool thread_around_empty_blocks (vec<class jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
int thread_through_normal_block (vec<jump_thread_edge *> *path,
- edge, bitmap visited);
+ edge, bitmap visited, unsigned &limit);
void thread_across_edge (edge);
bool record_temporary_equivalences_from_phis (edge);
gimple *record_temporary_equivalences_from_stmts_at_dest (edge);
--
2.43.5
......@@ -8,7 +8,7 @@ fi
pkgname=musl-aarch64
pkgver=1.2.5
pkgrel=3
pkgrel=5
arch="x86_64"
subpackages="musl-dev-aarch64:package_dev"
......@@ -57,6 +57,6 @@ package_dev() {
}
sha512sums="
30c20d050028bbe9a2203a0db0bb1453d921ac381fc3a7dc2c79c535a7ac25ecf65d7ee367b17178a37aa0e26d028a860d03567e9662c6251171c53bf2562893 musl-1.2.5-r3-aarch64-edge.apk
43ef19c8698e98eb473116e7c21dbb9e66d994bd1cd63837d0f0c43ceaf1ce4f1db582e48b22478574ef7fe4bc309aa7bb387af2f99d8d88bcecfaf7763ec82c musl-dev-1.2.5-r3-aarch64-edge.apk
5b3c6f1f1d87164a8a72c9d90b6e35ccc256bb2f6e1a12e4a3ff04b6309fff6c438eef60b824e4993958c4348c122fb96ef8f59dc468e10ee5be69aa81e6f4bc musl-1.2.5-r5-aarch64-edge.apk
ebbd7300b2102f322633dbc01449b5d4f25374609193359bf5da97e3a6cf34f1288a69ed0638bd5505b4548fdeb1efa481c9cd3a031ae3a98759b36cbf2db46e musl-dev-1.2.5-r5-aarch64-edge.apk
"
......@@ -8,7 +8,7 @@ fi
pkgname=musl-armhf
pkgver=1.2.5
pkgrel=3
pkgrel=5
arch="x86_64"
subpackages="musl-dev-armhf:package_dev"
......@@ -57,6 +57,6 @@ package_dev() {
}
sha512sums="
b98e17b30e5968ca8f6c963e8752544112337b641186c269dbc4dd4b0a9496de9f4a549deb1bbf03e419b145b86b0c48fd22db1b8dff188bd3b451632b8c2b3f musl-1.2.5-r3-armhf-edge.apk
0e9fa461b75f3a9832e26f8086c9397b9d5dbea9c5821cf7898c0ccf64281f603137265606ee97810cba988fdff967ea7ec240e4e59c1d87da7e001cd4bf719a musl-dev-1.2.5-r3-armhf-edge.apk
302f14e5dc60b4c55f5f299be6cd158fe0955549e8b559afb5985c29a5c98432f82586732954c0dc3776104efc072b11ad9e4818842e6592df2e1931ba3590de musl-1.2.5-r5-armhf-edge.apk
71fc34ce05c5ed73136e77baa478986ec205f882f02602f54f772498451c70a254c89301e932c1e9d3b48a4b4513ca99f64b54de38bdd95966421c297e81ac5b musl-dev-1.2.5-r5-armhf-edge.apk
"