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 958 additions and 669 deletions
......@@ -6,7 +6,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
......
......@@ -6,7 +6,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
apk add git openssh-keygen grep curl
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0 $*"
fi
......@@ -90,9 +90,9 @@ update_linux_next() {
}
# For testing
#git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.com/postmarketOS/pmaports-autoupdate-test.git
#git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.postmarketos.org/postmarketOS/pmaports-autoupdate-test.git
git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.com/postmarketOS/pmaports.git
git remote add gitlab https://pmos-ci:"$PMAPORTS_PUSH_TOKEN"@gitlab.postmarketos.org/postmarketOS/pmaports.git
git fetch gitlab
git checkout --track gitlab/master
......
......@@ -11,7 +11,7 @@ if [ "$(id -u)" = 0 ]; then
# In .gitlab-ci.yml currently .ci/pytest.sh runs before this and
# already downloads and runs install_pmbootstrap.sh.
if ! [ -e install_pmbootstrap.sh ]; then
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
fi
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
......
......@@ -57,7 +57,7 @@ fi
POSTMARKETOS_WALLPAPER_PATH='/usr/share/wallpapers/postmarketos.jpg'
# The excluded devices are "grandfathered in". New devices should not be added here.
# See https://gitlab.com/postmarketOS/pmaports/-/issues/2529
# See https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/2529
if grep -qr $POSTMARKETOS_WALLPAPER_PATH \
--exclude-dir='device-pine64-pinetab' \
--exclude-dir='device-oneplus-kebab' \
......
......@@ -6,7 +6,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
......
......@@ -5,7 +5,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
......
......@@ -36,7 +36,7 @@ def run_git(parameters, check=True, stderr=None):
def add_upstream_git_remote():
""" Add a remote pointing to postmarketOS/pmaports. """
run_git(["remote", "add", "upstream",
"https://gitlab.com/postmarketOS/pmaports.git"], False)
"https://gitlab.postmarketos.org/postmarketOS/pmaports.git"], False)
run_git(["fetch", "-q", "upstream"])
......@@ -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:
......
......@@ -8,7 +8,7 @@
if [ "$(id -u)" = 0 ]; then
set -x
wget "https://gitlab.com/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
wget "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/install_pmbootstrap.sh"
sh ./install_pmbootstrap.sh pytest
exec su "${TESTUSER:-pmos}" -c "sh -e $0"
fi
......
......@@ -28,7 +28,7 @@ def test_directories():
# Ensure no file in pmaports are executable.
# see https://gitlab.com/postmarketOS/pmaports/-/issues/593.
# see https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/593.
def test_executable_files():
for file in glob.iglob("[!temp]**/**/*", recursive=True):
if os.path.isdir(file) or os.path.islink(file):
......
......@@ -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:
......@@ -119,7 +124,7 @@ mr-settings:
- *global_before_scripts
- apk -q add python3
script:
- wget -q "https://gitlab.com/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
- wget -q "https://gitlab.postmarketos.org/postmarketOS/ci-common/-/raw/master/check_mr_settings.py"
- python3 ./check_mr_settings.py
# build changed aports
......
......@@ -20,7 +20,7 @@
pkgname=crossdirect
pkgver=5.1.0
pkgrel=0
pkgrel=1
pkgdesc="Wrappers to launch native cross compilers in foreign chroots"
url="https://postmarketOS.org"
arch="all"
......@@ -82,7 +82,7 @@ package() {
sha512sums="
0f4b48f250425dc57f63955fc8b38477d23db793bee367c3fbe03c3d2a559ba576434d07518310db4cae9d90d501af4051b80038b10fae94b980e537fc9374ad cargo.sh
500107e5aff8b34e74b54982ebcd447fc41bc8283956d506561b031a055cb30ec12698047c2604918b4b6d8560fe03db427a63dff2b83c907e8494b7f5233f29 crossdirect.c
a1af3d2876dc05bb840e4bfb8b6e1c1dcf5b952375a6644dcb9cf659d82ec8bfc4be5d813064057fe9626104a10907ae7072a9d5fd7ac40f3b87e90dbf535eaf crossdirect.c
de2aa6929bbff5db9132673e667f4525b333d062cb1f7a0597dd924de9e5c7215a9f8e2e6263b6fb5ace06f2c4b64f4ebfd0ede9b78add07c2cd08ec8613e98f rustc.sh
ea9bf8db3810d03d0a7395057f3d6e57f7127d87c55deaedc171c255288f5f3cc6fbcc680a5a1b92786cf573875d5dc22521173799fe2639acc97d0715ff905b rust-qemu-linker.sh
"
......@@ -43,7 +43,7 @@
void exit_userfriendly()
{
fprintf(stderr, "Please report this at: https://gitlab.com/postmarketOS/pmaports/issues\n");
fprintf(stderr, "Please report this at: https://gitlab.postmarketos.org/postmarketOS/pmaports/issues\n");
fprintf(stderr, "As a workaround, you can compile without crossdirect.\n");
fprintf(stderr, "See 'pmbootstrap -h' for related options.\n");
exit(1);
......
......@@ -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