Hello community,

here is the log from the commit of package gcc7.11981 for 
openSUSE:Leap:15.1:Update checked in at 2020-02-25 10:28:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.1:Update/gcc7.11981 (Old)
 and      /work/SRC/openSUSE:Leap:15.1:Update/.gcc7.11981.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gcc7.11981"

Tue Feb 25 10:28:54 2020 rev:1 rq:777607 version:7.5.0+r278197

Changes:
--------
New Changes file:

--- /dev/null   2019-12-19 10:12:34.003146842 +0100
+++ 
/work/SRC/openSUSE:Leap:15.1:Update/.gcc7.11981.new.26092/cross-aarch64-gcc7.changes
        2020-02-25 10:28:55.484124540 +0100
@@ -0,0 +1,533 @@
+-------------------------------------------------------------------
+Tue Jan  7 08:38:25 UTC 2020 - Richard Biener <[email protected]>
+
+- Add gcc7-bsc1160086.patch to fix miscompilation in vectorized code
+  for s390x.  [bsc#1160086] [gcc#92950]
+
+-------------------------------------------------------------------
+Thu Nov 14 09:29:39 UTC 2019 - Richard Biener <[email protected]>
+
+- Update to GCC 7.5.0 release.
+- Add gcc7-pr85887.patch to fix miscompilation with thread-safe local
+  static initialization.  [gcc#85887]
+
+-------------------------------------------------------------------
+Wed Oct  2 07:46:40 UTC 2019 - Richard Biener <[email protected]>
+
+- Add gcc7-bsc1146475.patch to fix debug info created for array
+  definitions that complete an earlier declaration.  [bsc#1146475]
+
+-------------------------------------------------------------------
+Mon Sep  9 07:33:54 UTC 2019 - Richard Biener <[email protected]>
+
+- Rework shared spec file parts to allow custom Summary and
+  Description for cross compilers.  Clarify their Summary
+  and Description.  [bsc#1148517]
+- Reorder things in cross.spec.in so the Version define comes before
+  the first use of %version.
+
+-------------------------------------------------------------------
+Thu Sep  5 13:29:56 UTC 2019 - Richard Biener <[email protected]>
+
+- Update to gcc-7-branch head (r275405).
+  * Pulls fix for POWER9 DARN miscompilation.
+    (bsc#1149145, CVE-2019-15847)
+  * Includes gcc8-pr89752.patch
+
+-------------------------------------------------------------------
+Fri Aug 16 09:51:33 UTC 2019 - Richard Biener <[email protected]>
+
+- Remove bogus fixed include bits/statx.h from glibc 2.30.  [gcc#91085]
+
+-------------------------------------------------------------------
+Thu Jul 25 10:51:53 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r273795).
+  * Includes fix for LTO linker plugin heap overflow.
+    (bsc#1142649, CVE-2019-14250)
+
+-------------------------------------------------------------------
+Mon Jul 22 09:47:10 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r273666).
+  * Fixes build with -Werror=return-type.
+
+-------------------------------------------------------------------
+Thu Jul 18 07:10:26 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r273559).
+  * Includes fix for vector shift miscompilation on s390.  [bsc#1141897]
+
+-------------------------------------------------------------------
+Wed Jun 12 10:37:51 UTC 2019 - Martin Liška <[email protected]>
+
+- Add gcc7-flive-patching.patch patch.  [bsc#1071995, fate#323487]
+
+-------------------------------------------------------------------
+Wed May 22 12:56:05 UTC 2019 - Martin Liška <[email protected]>
+
+- Strip -flto from $optflags.
+
+-------------------------------------------------------------------
+Wed Apr 24 09:52:10 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r270528).
+  * Disables switch jump-tables when retpolines are used.
+  [bsc#1131264, jsc#SLE-6738]
+
+-------------------------------------------------------------------
+Thu Mar 28 08:21:08 UTC 2019 - [email protected]
+
+- Add gcc8-pr89752.patch to fix ICE compiling tensorflow on aarch64.
+  [bsc#1129389]
+
+-------------------------------------------------------------------
+Thu Mar 14 09:19:08 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r269676).
+  * Pulls fix for aarch64 FMA steering pass use-after-free.  [bsc#1128794]
+  * Fixes ICE compiling tensorflow.  [bsc#1129389]
+- Change URLs to use https.
+
+-------------------------------------------------------------------
+Fri Feb  8 07:50:27 UTC 2019 - [email protected]
+
+- Update to gcc-7-branch head (r268660).
+  * Pulls fix for s390x FP load-and-test issue.  [bnc#1124644]
+- Improve build reproducability by disabling address-space randomization
+  during build.
+
+-------------------------------------------------------------------
+Mon Jan  7 08:35:49 UTC 2019 - [email protected]
+
+- Update gcc44-rename-info-files.patch to adjust gnat manual
+  entries in the info directory.  [bnc#1114592]
+
+-------------------------------------------------------------------
+Thu Dec  6 12:07:47 UTC 2018 - [email protected]
+
+- Update to GCC 7.4 release.
+- Fix AVR configuration to not use __cxa_atexit or libstdc++ headers.
+  Point to /usr/avr/sys-root/include as system header include directory.
+
+-------------------------------------------------------------------
+Fri Aug 17 08:36:04 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r263609).
+  * Includes fix for build with ISL 0.20.
+  * Includes fix to no longer try linking -lieee with -mieee-fp.
+    [bnc#1084842]
+
+-------------------------------------------------------------------
+Fri Jun 29 10:25:01 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r262243).
+  * Pulls fix for libcpp lexing bug on ppc64le manifesting during
+    build with gcc8.  [bnc#1099119]
+  * Pulls fix for forcing compile-time tuning even when building
+    with -march=z13 on s390x.  [bnc#1099192]
+
+-------------------------------------------------------------------
+Thu Jun  7 10:20:14 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r261272).
+  * Fixes support for 32bit ASAN with glibc 2.27+
+  * Includes gcc7-bnc1087550.diff
+
+-------------------------------------------------------------------
+Wed Apr 18 14:02:32 UTC 2018 - [email protected]
+
+- Update gcc7-bnc1087550.diff with latest changes.  [bnc#1087550]
+
+-------------------------------------------------------------------
+Wed Apr 11 07:35:40 UTC 2018 - [email protected]
+
+- Update gcc7-bnc1087550.diff with fix from upstream that supports
+  both ABIs for ios_base::failure.  [bnc#1087550]
+
+-------------------------------------------------------------------
+Mon Apr  9 13:51:55 UTC 2018 - [email protected]
+
+- Set SUSE_ASNEEDED to zero during %install so libasan keeps its
+  NEEDED entry for libstdc++.so.  [GCC#84428]
+
+-------------------------------------------------------------------
+Fri Apr  6 09:05:43 UTC 2018 - [email protected]
+
+- Enable --enable-fix-cortex-a53-835769 for aarch64.
+- Add gcc7-bnc1087550.diff to revert the ios_base::failure ABI
+  back to compatible behavior with the default ABI.  [bnc#1087550]
+
+-------------------------------------------------------------------
+Tue Apr  3 12:54:54 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r258812).
+  * Picks fix to no longer enable -mpc-relative-literal-loads by default
+    with --enable-fix-cortex-a53-843419.
+- Enable --enable-fix-cortex-a53-843419 on aarch64.  [bnc#1084812]
+  [bnc#1087930]
+
+-------------------------------------------------------------------
+Wed Mar  7 08:59:22 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r258313).
+  * includes spectre V2 mitigation patch for s390x.  [bnc#1083946]
+
+-------------------------------------------------------------------
+Thu Mar  1 13:03:25 UTC 2018 - [email protected]
+
+- Fix nvptx offload target compiler install so GCC can pick up
+  required files.  Split out the newlib part into cross-nvptx-newlib7-devel
+  and avoid conflicts with GCC 8 variant via Provides/Conflicts
+  of cross-nvptx-newlib-devel.
+
+-------------------------------------------------------------------
+Tue Feb 27 08:37:14 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r258025).
+  * includes fix for chromium build failure.  [bnc#1083290]
+
+-------------------------------------------------------------------
+Mon Feb 26 09:02:16 UTC 2018 - [email protected]
+
+- Update to gcc-7-branch head (r257981).
+- Add conflicts to non-bootstrap variant for cross packages to silence
+  repo-checker.
+- Amend gcc48-remove-mpfr-2.4.0-requirement.patch to fix build on SLE11.
+
++++ 336 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.1:Update/.gcc7.11981.new.26092/cross-aarch64-gcc7.changes
New Changes file:

cross-arm-gcc7.changes: same change
New Changes file:

cross-arm-none-gcc7-bootstrap.changes: same change
New Changes file:

cross-arm-none-gcc7.changes: same change
New Changes file:

cross-avr-gcc7-bootstrap.changes: same change
New Changes file:

cross-avr-gcc7.changes: same change
New Changes file:

cross-epiphany-gcc7-bootstrap.changes: same change
New Changes file:

cross-epiphany-gcc7.changes: same change
New Changes file:

cross-hppa-gcc7.changes: same change
New Changes file:

cross-i386-gcc7.changes: same change
New Changes file:

cross-m68k-gcc7.changes: same change
New Changes file:

cross-mips-gcc7.changes: same change
New Changes file:

cross-nvptx-gcc7.changes: same change
New Changes file:

cross-ppc64-gcc7.changes: same change
New Changes file:

cross-ppc64le-gcc7.changes: same change
New Changes file:

cross-rx-gcc7-bootstrap.changes: same change
New Changes file:

cross-rx-gcc7.changes: same change
New Changes file:

cross-s390x-gcc7.changes: same change
New Changes file:

cross-sparc-gcc7.changes: same change
New Changes file:

cross-sparc64-gcc7.changes: same change
New Changes file:

cross-x86_64-gcc7.changes: same change
New Changes file:

gcc7-testresults.changes: same change
New Changes file:

gcc7.changes: same change

New:
----
  README.First-for.SuSE.packagers
  _constraints
  change_spec
  check-build.sh
  cross-aarch64-gcc7.changes
  cross-aarch64-gcc7.spec
  cross-arm-gcc7.changes
  cross-arm-gcc7.spec
  cross-arm-none-gcc7-bootstrap.changes
  cross-arm-none-gcc7-bootstrap.spec
  cross-arm-none-gcc7.changes
  cross-arm-none-gcc7.spec
  cross-avr-gcc7-bootstrap.changes
  cross-avr-gcc7-bootstrap.spec
  cross-avr-gcc7.changes
  cross-avr-gcc7.spec
  cross-epiphany-gcc7-bootstrap.changes
  cross-epiphany-gcc7-bootstrap.spec
  cross-epiphany-gcc7.changes
  cross-epiphany-gcc7.spec
  cross-hppa-gcc7.changes
  cross-hppa-gcc7.spec
  cross-i386-gcc7.changes
  cross-i386-gcc7.spec
  cross-m68k-gcc7.changes
  cross-m68k-gcc7.spec
  cross-mips-gcc7.changes
  cross-mips-gcc7.spec
  cross-nvptx-gcc7.changes
  cross-nvptx-gcc7.spec
  cross-ppc64-gcc7.changes
  cross-ppc64-gcc7.spec
  cross-ppc64le-gcc7.changes
  cross-ppc64le-gcc7.spec
  cross-rx-gcc7-bootstrap.changes
  cross-rx-gcc7-bootstrap.spec
  cross-rx-gcc7.changes
  cross-rx-gcc7.spec
  cross-s390x-gcc7.changes
  cross-s390x-gcc7.spec
  cross-sparc-gcc7.changes
  cross-sparc-gcc7.spec
  cross-sparc64-gcc7.changes
  cross-sparc64-gcc7.spec
  cross-x86_64-gcc7.changes
  cross-x86_64-gcc7.spec
  cross.spec.in
  gcc-7.5.0+r278197.tar.xz
  gcc-add-defaultsspec.diff
  gcc.spec.in
  gcc41-ppc32-retaddr.patch
  gcc43-no-unwind-tables.diff
  gcc44-rename-info-files.patch
  gcc44-textdomain.patch
  gcc48-libstdc++-api-reference.patch
  gcc48-remove-mpfr-2.4.0-requirement.patch
  gcc5-no-return-gcc43-workaround.patch
  gcc7-avoid-fixinc-error.diff
  gcc7-bsc1146475.patch
  gcc7-bsc1160086.patch
  gcc7-flive-patching.patch
  gcc7-pr82248.diff
  gcc7-pr85887.patch
  gcc7-remove-Wexpansion-to-defined-from-Wextra.patch
  gcc7-rpmlintrc
  gcc7-stack-probe.diff
  gcc7-testresults.changes
  gcc7-testresults.spec
  gcc7.changes
  gcc7.spec
  nvptx-newlib.tar.xz
  pre_checkin.sh
  tls-no-direct.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cross-aarch64-gcc7.spec ++++++
++++ 809 lines (skipped)

cross-arm-gcc7.spec: same change
cross-arm-none-gcc7-bootstrap.spec: same change
cross-arm-none-gcc7.spec: same change
cross-avr-gcc7-bootstrap.spec: same change
cross-avr-gcc7.spec: same change
cross-epiphany-gcc7-bootstrap.spec: same change
cross-epiphany-gcc7.spec: same change
cross-hppa-gcc7.spec: same change
cross-i386-gcc7.spec: same change
cross-m68k-gcc7.spec: same change
cross-mips-gcc7.spec: same change
cross-nvptx-gcc7.spec: same change
cross-ppc64-gcc7.spec: same change
cross-ppc64le-gcc7.spec: same change
cross-rx-gcc7-bootstrap.spec: same change
cross-rx-gcc7.spec: same change
cross-s390x-gcc7.spec: same change
cross-sparc-gcc7.spec: same change
cross-sparc64-gcc7.spec: same change
cross-x86_64-gcc7.spec: same change
gcc7-testresults.spec: same change
gcc7.spec: same change
++++++ README.First-for.SuSE.packagers ++++++
IMPORTANT: Please change gcc.spec.in and then run ./pre_checkin.sh!
Do not change gcc.spec directly!

Since GCC comes with a testsuite that runs for quite a long time and
that test suite also contains some known failures, we should run the
testsuite of GCC whenever the compiler is changed to ensure a high
quality compiler.

The package is now split into multiple parts, gcc$VER,
gcc$VER-testresults and libffi$VER (plus various spec files for
cross and icecream cross compilers).  The testsuite is run from
gcc$VER-testresults, a dummy package with the testresults, gcc$VER-testresults,
is generated from it which contains testing logfiles and summary.

Before checking in a new compiler, please do the following steps as QA
measure to check that the new compiler does not introduce any new
failures:

- Run mbuild for all archs for at least the gcc$VER and the gcc$VER-testresults
  subpackages

- When mbuild is finished, call
  /suse/rguenther/bin/compare-testresults.sh mbuild-directory
  (for the gcc$VER-testresults build).
  The output of that script should not show any failures.  If it does,
  please fix them or discuss this with the gcc package maintainers.

- Do not remove this file.

Thanks,
Your GCC packagers.
++++++ _constraints ++++++
<constraints>
  <hardware>
    <disk>
      <size unit="G">16</size>
    </disk>
    <physicalmemory>
      <size unit="G">4</size>
    </physicalmemory>
    <processors>4</processors>
  </hardware>
</constraints>
++++++ change_spec ++++++
#!/bin/bash

do_crosses=1
do_optional_compiler_languages=0
rm -f gcc*-testresults.spec gcc*-testresults.changes gcc*.spec cross*.spec 
cross*.changes

# Default is to generate the normal gcc package
# unless a parameter is given.  In case that it is '-*',
# that parameter will be used as suffix for the package name
# and as suffix for the install path (/opt/gccSUFFIX)
# In case that it is '[0-9]*', that parameter will be used
# as a suffix for a versioned package name.

if [ $# -lt 1 ]; then
        echo No package suffix given
        outfile=gcc.spec
else
        case $1 in
        [0-9]*)
          base_ver=$1
          outfile=gcc$1.spec
        ;;
        *)
          echo Invalid package suffix
          exit 1
        ;;
        esac
fi

        : > $outfile
        if test "$do_optional_compiler_languages" = "1"; then
            echo '%define build_optional_compiler_languages 1' >> $outfile
        fi
        sed -e 's%@base_ver@%'$base_ver'%g' \
            gcc.spec.in \
        | sed -n -e '{
/^# PACKAGE-BEGIN/h
/^# PACKAGE-BEGIN/,/^# PACKAGE-END/H
/^# PACKAGE-BEGIN/,/^# PACKAGE-END/!p
/^# PACKAGE-END/{g
s/@variant@//g
p
g
s/@variant@/-32bit/g
p
g
s/@variant@/-64bit/g
p
}
}' >> $outfile

        echo '%define building_testsuite 1' > gcc$base_ver-testresults.spec
        echo '%define run_tests 1' >> gcc$base_ver-testresults.spec
        sed -e '/^# GCC-TESTSUITE-DELETE-BEGIN/,/^# 
GCC-TESTSUITE-DELETE-END/d;s/-n 
gcc@base_ver@-testresults$//g;s/^Name:[[:space:]]*gcc@base_ver@/Name: 
gcc@base_ver@-testresults/g' \
            gcc.spec.in \
        | sed -e 's%@base_ver@%'$base_ver'%g' \
>> gcc$base_ver-testresults.spec
  test -f gcc$base_ver.changes \
    && ( ln -f gcc$base_ver.changes gcc$base_ver-testresults.changes; )



add_cross() {
  local pkgname="$1"; shift
  local rpmtarget="$1"; shift
  local triplet="$1"; shift

  echo "%define pkgname $pkgname" > $pkgname.spec
  echo "%define cross_arch $rpmtarget" >> $pkgname.spec
  echo "%define gcc_target_arch $triplet" >> $pkgname.spec
  echo "$@" >> $pkgname.spec
  { sed -n -e '1,/SRC-COMMON-BEGIN/p' cross.spec.in
    sed -n -e '/SRC-COMMON-BEGIN/,/SRC-COMMON-END/p' $outfile
    sed -n -e '/SRC-COMMON-END/,/BUILD-COMMON-BEGIN/p' cross.spec.in
    sed -n -e '/BUILD-COMMON-BEGIN/,/BUILD-COMMON-END/p' $outfile
    sed -n -e '/BUILD-COMMON-END/,$p' cross.spec.in; } |
    sed -e "s#@base_ver@#$base_ver#" \
        -e "s/^\(ExclusiveArch.*\) $rpmtarget[^ \r]*/\1 /" \
      >> $pkgname.spec
  test -f gcc$base_ver.changes && ln -f gcc$base_ver.changes $pkgname.changes
}

add_newlib_cross() {
  add_cross $1-bootstrap $2 $3 "%define gcc_target_newlib 1
%define gcc_libc_bootstrap 1"
  add_cross $1           $2 $3 "%define gcc_target_newlib 1"
}

# We now support "proper" cross-compilers to suse targets via a
# cross-glibc package, enable that via for example
#
# add_cross cross-aarch64-gcc$base_ver aarch64 aarch64-suse-linux
#
# For now keep the old way of doing things
if test "$do_crosses" = 1 ; then
add_cross cross-aarch64-gcc$base_ver aarch64 aarch64-suse-linux %define 
gcc_icecream 1
add_cross cross-arm-gcc$base_ver arm arm-suse-linux-gnueabi %define 
gcc_icecream 0
add_cross cross-avr-gcc$base_ver-bootstrap avr avr "%define gcc_libc_bootstrap 
1"
add_cross cross-avr-gcc$base_ver avr avr
add_cross cross-i386-gcc$base_ver i386 i586-suse-linux %define gcc_icecream 1
add_cross cross-x86_64-gcc$base_ver x86_64 x86_64-suse-linux %define 
gcc_icecream 1
add_cross cross-s390x-gcc$base_ver s390x s390x-suse-linux %define gcc_icecream 1
add_cross cross-sparc-gcc$base_ver sparcv9 sparc-suse-linux %define 
gcc_icecream 1
add_cross cross-sparc64-gcc$base_ver sparc64 sparc64-suse-linux %define 
gcc_icecream 1
add_cross cross-ppc64-gcc$base_ver ppc64 powerpc64-suse-linux %define 
gcc_icecream 1
add_cross cross-ppc64le-gcc$base_ver ppc64le powerpc64le-suse-linux %define 
gcc_icecream 1
add_cross cross-m68k-gcc$base_ver m68k m68k-suse-linux %define gcc_icecream 1
add_cross cross-mips-gcc$base_ver mips mips-suse-linux %define gcc_icecream 1
add_cross cross-hppa-gcc$base_ver hppa hppa-suse-linux %define gcc_icecream 1
add_newlib_cross cross-arm-none-gcc$base_ver arm-none arm-none-eabi
add_newlib_cross cross-epiphany-gcc$base_ver epiphany epiphany-elf
add_newlib_cross cross-rx-gcc$base_ver rx rx-elf
#add_newlib_cross cross-rl78-gcc$base_ver rl78 rl78-elf
#add_newlib_cross cross-nds32le-gcc$base_ver nds32le nds32le-elf
fi
# the nvptx cross is used for offloading
add_cross cross-nvptx-gcc$base_ver nvptx nvptx-none %define gcc_accel 1

for f in *.spec; do
  sed -i -e '/^# .*-\(BEGIN\|END\)$/d' $f
done

osc service localrun format_spec_file

exit 0
++++++ check-build.sh ++++++
#!/bin/bash
# Copyright (c) 2003,2005 SUSE Linux Products GmbH, Germany.  All rights 
reserved.
#
# Authors: Thorsten Kukuk <[email protected]>
#
# this script use the following variable(s):
# 
# - $BUILD_BASENAME
#

case $BUILD_BASENAME in
   *ppc*)
        # Our biarch 32-bit compiler needs to be build on a 64-bit machine,
        # otherwise some configure checks fail.
        # Note that we cannot use uname here since powerpc32 was invoked
        # already.
        grep 'series64\|ppc64' /proc/version > /dev/null
        if [ $? -ne 0 ] ; then
          echo "build does not work on `hostname` for gcc"
          exit 1
        fi
        ;;
   *x86_64*)
        #if [ `ulimit -v` -le 740000 ] ; then
        #  echo "build does not work on ("`hostname`" for gcc)"
        #  exit 1
        #fi
        if [ `getconf _NPROCESSORS_CONF` -lt  2 ] ; then
          echo "build does not work on `hostname` for gcc"
          exit 1
        fi
        ;;
   *)
        ;;
esac

exit 0

++++++ cross.spec.in ++++++
#
# spec file for package gcc (Version 4.0.1)
#
# Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

# nospeccleaner

%define build_cp 0%{!?gcc_accel:1}
%define build_ada 0
%define build_libjava 0
%define build_java 0

%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_go 0
%define build_hsa 0
%define build_nvptx 0

%define enable_plugins 0

%define binutils_target %{cross_arch}
%if "%{cross_arch}" == "armv7l" || "%{cross_arch}" == "armv7hl"
%define binutils_target arm
%endif
%if "%{cross_arch}" == "armv6l" || "%{cross_arch}" == "armv6hl"
%define binutils_target arm
%endif
%if "%{cross_arch}" == "armv5tel"
%define binutils_target arm
%endif
%if "%{cross_arch}" == "arm-none"
%define binutils_target arm
%define build_cp 0
%endif
%if "%{cross_arch}" == "sparcv9"
%define binutils_target sparc
%endif
%define canonical_target %(echo %{binutils_target} | sed -e 
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if "%{binutils_target}" == "avr" || "%{binutils_target}" == "spu"
%define binutils_os %{canonical_target}
%else
%if "%{binutils_target}" == "epiphany" || "%{binutils_target}" == "nds32le" || 
"%{binutils_target}" == "rl78" || "%{binutils_target}" == "rx"
%define binutils_os %{canonical_target}-elf
%else
%if "%{binutils_target}" == "arm"
%define binutils_os %{canonical_target}-suse-linux-gnueabi
%else
%if 0%{?gcc_accel:1}
%define binutils_os %{gcc_target_arch}
%else
%define binutils_os %{canonical_target}-suse-linux
%endif
%endif
%endif
%endif

%if 0%{?gcc_icecream:1}
%define sysroot %{_prefix}/%{gcc_target_arch}
%else
# offloading builds newlib in-tree and can install in
# the GCC private path without extra sysroot
%if 0%{!?gcc_accel:1}
# use same sysroot as in binutils.spec
%define sysroot %{_prefix}/%{binutils_os}/sys-root
%endif
%endif

%if %{suse_version} >= 1220
%define selfconflict() %1
%else
%define selfconflict() otherproviders(%1)
%endif

Name:         %{pkgname}
# SRC-COMMON-BEGIN
# SRC-COMMON-END
%if "%{cross_arch}" != "nvptx"
BuildRequires: cross-%{binutils_target}-binutils
Requires: cross-%{binutils_target}-binutils
%endif
BuildRequires: gcc-c++
BuildRequires: bison
BuildRequires: flex
BuildRequires: gettext-devel
BuildRequires: glibc-devel-32bit
BuildRequires: mpc-devel
BuildRequires: mpfr-devel
BuildRequires: perl
%if %{suse_version} > 1220
BuildRequires: makeinfo
%else
BuildRequires: texinfo
%endif
BuildRequires: zlib-devel
%ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm
BuildRequires: isl-devel
%endif
%ifarch ia64
BuildRequires: libunwind-devel
%endif
%if 0%{!?gcc_icecream:1}
%if 0%{?gcc_target_newlib:1} && 0%{!?gcc_libc_bootstrap:1}
BuildRequires: cross-%cross_arch-newlib-devel
%endif
%if 0%{!?gcc_libc_bootstrap:1} && "%{cross_arch}" == "avr"
BuildRequires: avr-libc
%endif
%if 0%{?gcc_target_glibc:1}
BuildRequires: cross-%cross_arch-glibc-devel
%endif
%if "%{cross_arch}" == "nvptx"
BuildRequires: nvptx-tools
Requires: nvptx-tools
Requires: cross-nvptx-newlib-devel >= %{version}-%{release}
ExclusiveArch: x86_64
%define nvptx_newlib 1
%endif
%endif
%if 0%{?gcc_icecream:1}
ExclusiveArch: ppc64le ppc64 x86_64 s390x aarch64
%endif
%define _binary_payload w.ufdio
# Obsolete cross-ppc-gcc49 from cross-ppc64-gcc49 which has
# file conflicts with it and is no longer packaged
%if "%pkgname" == "cross-ppc64-gcc49"
Obsoletes: cross-ppc-gcc49 <= 4.9.0+r209354
%endif
%if 0%{?gcc_target_newlib:1}
# Generally only one cross for the same target triplet can be installed
# at the same time as we are populating a non-version-specific sysroot
Provides: %{gcc_target_arch}-gcc
Conflicts: %selfconflict %{gcc_target_arch}-gcc
%endif
%if 0%{?gcc_libc_bootstrap:1}
# The -bootstrap packages file-conflict with the non-bootstrap variants.
# Even if we don't actually (want to) distribute the bootstrap variants
# the following avoids repo-checker spamming us endlessly.
Conflicts: cross-%{cross_arch}-gcc@base_ver@
%endif
#!BuildIgnore: gcc-PIE
BuildRequires:  update-alternatives
Requires(post): update-alternatives
Requires(preun): update-alternatives
Summary:       The GNU Compiler Collection targeting %{cross_arch}
License:       GPL-3.0-or-later

%description
The GNU Compiler Collection as a cross-compiler targeting %{cross_arch}.
%if 0%{?gcc_icecream:1}
Note this is only useful for building freestanding things like the
kernel since it fails to include target libraries and headers.
%endif
%if 0%{?gcc_libc_bootstrap:1}
This is a package that is necessary for bootstrapping another package
only, it is not intended for any other use.
%endif

# BUILD-COMMON-BEGIN
# BUILD-COMMON-END
%if 0%{!?gcc_icecream:1} && 0%{!?gcc_libc_bootstrap:1}
make %{?_smp_mflags}
%else
make %{?_smp_mflags} all-host
%endif


%if 0%{?gcc_icecream:%gcc_icecream}
%package -n cross-%cross_arch-gcc@base_ver@-icecream-backend
Summary: Icecream backend for the GNU C Compiler
Group:  Development/Languages/C and C++

%description -n cross-%cross_arch-gcc@base_ver@-icecream-backend
This package contains the icecream environment for the GNU C Compiler
%endif


%if 0%{?nvptx_newlib:1}
%package -n cross-nvptx-newlib@base_ver@-devel
Summary: newlib for the nvptx offload target
Group:  Development/Languages/C and C++
Provides: cross-nvptx-newlib-devel = %{version}-%{release}
Conflicts: cross-nvptx-newlib-devel

%description -n cross-nvptx-newlib@base_ver@-devel
Newlib development files for the nvptx offload target compiler.
%endif


%define targetlibsubdir %{_libdir}/gcc/%{gcc_target_arch}/%{gcc_dir_version}

%install
cd obj-%{GCCDIST}

# install and fixup host parts
make DESTDIR=$RPM_BUILD_ROOT install-host
rm -rf $RPM_BUILD_ROOT/%{targetlibsubdir}/install-tools
rm -f $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.la
# common fixup
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a


# install and fixup target parts
# debugedit is not prepared for this and crashes
%if 0%{?gcc_icecream:1}
# so expect the sysroot to be populated from natively built binaries
%else
%if 0%{!?gcc_libc_bootstrap:1}
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
%define __debug_install_post %{nil}
: >../debugfiles.list
: >../debugsourcefiles.list
: >../debugsources.list
# We want shared libraries to reside in the sysroot but the .so symlinks
# on the host.  Once we have a cross target that has shared libs we need
# to manually fix up things here like we do for non-cross compilers
mkdir -p $RPM_BUILD_ROOT/%{?sysroot:%sysroot}
make DESTDIR=$RPM_BUILD_ROOT install-target
%if %{build_cp}
# So we installed libstdc++ headers into %prefix where they conflict
# with other host compilers.  Rip out the non-target specific parts
# again.  Note not all cross targets support libstdc++, so create the
# directory to make things easier.
mkdir -p $RPM_BUILD_ROOT/%_prefix/include/c++/%{gcc_dir_version}
find $RPM_BUILD_ROOT/%_prefix/include/c++/%{gcc_dir_version} -mindepth 1 
-maxdepth 1 -type d -a -not -name %{gcc_target_arch} | xargs -r rm -r
find $RPM_BUILD_ROOT/%_prefix/include/c++/%{gcc_dir_version} -maxdepth 1 -type 
f | xargs -r rm
# And also remove installed pretty printers which conflict in similar ways
rm -rf $RPM_BUILD_ROOT/%{_datadir}/gcc%{binsuffix}
%endif
%endif
%endif

%if 0%{?binutils_os:1}
for prog in as ld; do
  ln -s /usr/%{binutils_os}/bin/$prog $RPM_BUILD_ROOT%{targetlibsubdir}/
done
%endif

# remove docs
rm -rf $RPM_BUILD_ROOT%{_mandir}
rm -rf $RPM_BUILD_ROOT%{_infodir}

# for accelerators remove all frontends but lto1 and also install-tools
%if 0%{?gcc_accel:1}
rm -f $RPM_BUILD_ROOT%{libsubdir}/accel/%{gcc_target_arch}/cc1
rm -f $RPM_BUILD_ROOT%{libsubdir}/accel/%{gcc_target_arch}/cc1plus
rm -rf $RPM_BUILD_ROOT%{libsubdir}/accel/%{gcc_target_arch}/install-tools
rm -rf $RPM_BUILD_ROOT%{targetlibsubdir}/install-tools
# also move things from target directories into the accel path since
# that is the place where we later search for (only)
( cd $RPM_BUILD_ROOT%{targetlibsubdir} && tar cf - . ) | ( cd 
$RPM_BUILD_ROOT%{libsubdir}/accel/%{gcc_target_arch} && tar xf - )
rm -rf $RPM_BUILD_ROOT%{targetlibsubdir}
%endif

%if 0%{?gcc_icecream:%gcc_icecream}
# Build an icecream environment
# The assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D %{_prefix}/bin/%{binutils_os}-as \
        $RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-g++%{binsuffix} \
        $RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix} \
        $RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do 
        install -s -D $RPM_BUILD_ROOT/%{targetlibsubdir}/$back \
                $RPM_BUILD_ROOT/env%{targetlibsubdir}/$back
done
if test -f $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.so; then
  install -s -D $RPM_BUILD_ROOT/%{targetlibsubdir}/liblto_plugin.so \
                $RPM_BUILD_ROOT/env%{targetlibsubdir}/liblto_plugin.so
fi

# Make sure to also pull in all shared library requirements for the
# binaries we put into the environment which is operated by chrooting
# into it and execing the compiler
libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/* 
$RPM_BUILD_ROOT/env%{targetlibsubdir}/*; do \
  ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }'  ;\
done | sort -u `
for lib in $libs; do
  # Check wether the same library also exists in the parent directory,
  # and prefer that on the assumption that it is a more generic one.
  baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
  test -f "$baselib" && lib=$baselib
  install -s -D $lib $RPM_BUILD_ROOT/env$lib
done

cd $RPM_BUILD_ROOT/env
tar --no-recursion --mtime @${SOURCE_DATE_EPOCH:-$(date +%s)} --format=gnu -cv 
`find *|LC_ALL=C sort` |\
  gzip -n9 > ../%{name}_%{_arch}.tar.gz
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc >  usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils >  usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env
%endif

# we provide update-alternatives for selecting a compiler version for
# crosses
%if 0%{!?gcc_accel:1}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for ex in gcc cpp \
%if %{build_cp}
          c++ g++ \
%endif
          gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do
  ln -s %{_sysconfdir}/alternatives/%{gcc_target_arch}-$ex \
        %{buildroot}%{_bindir}/%{gcc_target_arch}-$ex
done

%post
%{_sbindir}/update-alternatives \
  --install %{_bindir}/%{gcc_target_arch}-gcc %{gcc_target_arch}-gcc 
%{_bindir}/%{gcc_target_arch}-gcc%{binsuffix} @base_ver@ \
  --slave %{_bindir}/%{gcc_target_arch}-cpp %{gcc_target_arch}-cpp 
%{_bindir}/%{gcc_target_arch}-cpp%{binsuffix} \
%if %{build_cp}
  --slave %{_bindir}/%{gcc_target_arch}-c++ %{gcc_target_arch}-c++ 
%{_bindir}/%{gcc_target_arch}-c++%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-g++ %{gcc_target_arch}-g++ 
%{_bindir}/%{gcc_target_arch}-g++%{binsuffix} \
%endif
  --slave %{_bindir}/%{gcc_target_arch}-gcc-ar %{gcc_target_arch}-gcc-ar 
%{_bindir}/%{gcc_target_arch}-gcc-ar%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-gcc-nm %{gcc_target_arch}-gcc-nm 
%{_bindir}/%{gcc_target_arch}-gcc-nm%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-gcc-ranlib 
%{gcc_target_arch}-gcc-ranlib 
%{_bindir}/%{gcc_target_arch}-gcc-ranlib%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-gcov %{gcc_target_arch}-gcov 
%{_bindir}/%{gcc_target_arch}-gcov%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-gcov-dump %{gcc_target_arch}-gcov-dump 
%{_bindir}/%{gcc_target_arch}-gcov-dump%{binsuffix} \
  --slave %{_bindir}/%{gcc_target_arch}-gcov-tool %{gcc_target_arch}-gcov-tool 
%{_bindir}/%{gcc_target_arch}-gcov-tool%{binsuffix}

%postun
if [ ! -f %{_bindir}/%{gcc_target_arch}-gcc ] ; then
  %{_sbindir}/update-alternatives --remove %{gcc_target_arch}-gcc 
%{_bindir}/%{gcc_target_arch}-gcc%{binsuffix}
fi
%endif

%files
%defattr(-,root,root)
%if 0%{?gcc_accel:1}
%{_prefix}/bin/%{GCCDIST}-accel-%{gcc_target_arch}-*
%dir %{libsubdir}
%dir %{libsubdir}/accel
%{libsubdir}/accel/%{gcc_target_arch}
%else
%{_prefix}/bin/%{gcc_target_arch}-gcc%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-cpp%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcc-ar%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcc-nm%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcc-ranlib%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcov%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcov-dump%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcov-tool%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-gcc
%{_prefix}/bin/%{gcc_target_arch}-cpp
%{_prefix}/bin/%{gcc_target_arch}-gcc-ar
%{_prefix}/bin/%{gcc_target_arch}-gcc-nm
%{_prefix}/bin/%{gcc_target_arch}-gcc-ranlib
%{_prefix}/bin/%{gcc_target_arch}-gcov
%{_prefix}/bin/%{gcc_target_arch}-gcov-dump
%{_prefix}/bin/%{gcc_target_arch}-gcov-tool
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcc
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-cpp
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcc-ar
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcc-nm
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcc-ranlib
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcov
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcov-dump
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-gcov-tool
%if %{build_cp}
%{_prefix}/bin/%{gcc_target_arch}-c++%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-g++%{binsuffix}
%{_prefix}/bin/%{gcc_target_arch}-c++
%{_prefix}/bin/%{gcc_target_arch}-g++
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-c++
%ghost %{_sysconfdir}/alternatives/%{gcc_target_arch}-g++
%if 0%{!?gcc_libc_bootstrap:1}
%if %{cross_arch} == "avr" || 0%{?gcc_target_newlib:1} || 
0%{?gcc_target_glibc:1}
%{_prefix}/include/c++
%endif
%endif
%endif
%dir %{targetlibsubdir}
%dir %{_libdir}/gcc/%{gcc_target_arch}
%{targetlibsubdir}
%endif
%if 0%{!?gcc_icecream:1} && 0%{!?gcc_libc_bootstrap:1} && 0%{?sysroot:1}
%{sysroot}
%endif

%if 0%{?gcc_icecream:%gcc_icecream}
%files -n cross-%cross_arch-gcc@base_ver@-icecream-backend
%defattr(-,root,root)
/usr/share/icecream-envs
%endif

%if 0%{?nvptx_newlib:1}
%files -n cross-nvptx-newlib@base_ver@-devel
%defattr(-,root,root)
%{_prefix}/%{gcc_target_arch}
%endif

%changelog -n cross-%{pkgname}-gcc@base_ver@
++++++ gcc-add-defaultsspec.diff ++++++
Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c.orig      2013-11-26 15:41:59.000000000 +0100
+++ gcc/gcc.c   2013-11-26 16:40:35.780548125 +0100
@@ -258,6 +258,7 @@ static const char *replace_outfile_spec_
 static const char *remove_outfile_spec_function (int, const char **);
 static const char *version_compare_spec_function (int, const char **);
 static const char *include_spec_function (int, const char **);
+static const char *include_noerr_spec_function (int, const char **);
 static const char *find_file_spec_function (int, const char **);
 static const char *find_plugindir_spec_function (int, const char **);
 static const char *print_asm_header_spec_function (int, const char **);
@@ -1357,6 +1358,7 @@ static const struct spec_function static
   { "remove-outfile",          remove_outfile_spec_function },
   { "version-compare",         version_compare_spec_function },
   { "include",                 include_spec_function },
+  { "include_noerr",            include_noerr_spec_function },
   { "find-file",               find_file_spec_function },
   { "find-plugindir",          find_plugindir_spec_function },
   { "print-asm-header",                print_asm_header_spec_function },
@@ -6480,6 +6482,8 @@ main (int argc, char **argv)
   if (access (specs_file, R_OK) == 0)
     read_specs (specs_file, true, false);
 
+  do_self_spec ("%:include_noerr(defaults.spec)%(default_spec)");
+
   /* Process any configure-time defaults specified for the command line
      options, via OPTION_DEFAULT_SPECS.  */
   for (i = 0; i < ARRAY_SIZE (option_default_specs); i++)
@@ -8401,6 +8405,21 @@ get_random_number (void)
   return ret ^ getpid ();
 }
 
+static const char *
+include_noerr_spec_function (int argc, const char **argv)
+{
+  char *file;
+
+  if (argc != 1)
+    abort ();
+
+  file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
+  if (file)
+    read_specs (file, FALSE, TRUE);
+
+  return NULL;
+}
+
 /* %:compare-debug-dump-opt spec function.  Save the last argument,
    expected to be the last -fdump-final-insns option, or generate a
    temporary.  */
++++++ gcc.spec.in ++++++
++++ 2490 lines (skipped)

++++++ gcc41-ppc32-retaddr.patch ++++++
2005-11-28  Jakub Jelinek  <[email protected]>

        * config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0,
        read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx
        instead of doing an extran indirection from frame_pointer_rtx.

        * gcc.dg/20051128-1.c: New test.

#Index: gcc/config/rs6000/rs6000.c
#===================================================================
#--- gcc/config/rs6000/rs6000.c.orig    2013-11-26 15:42:33.000000000 +0100
#+++ gcc/config/rs6000/rs6000.c 2013-11-26 16:44:14.566089231 +0100
#@@ -20878,18 +20878,22 @@ rs6000_return_addr (int count, rtx frame
   if (count != 0
       || ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN) && flag_pic))
     {
+      rtx x;
       cfun->machine->ra_needs_full_frame = 1;
 
-      return
-       gen_rtx_MEM
-         (Pmode,
-          memory_address
-          (Pmode,
-           plus_constant (Pmode,
-                          copy_to_reg
-                          (gen_rtx_MEM (Pmode,
-                                        memory_address (Pmode, frame))),
-                          RETURN_ADDRESS_OFFSET)));
+      if (count == 0)
+       {
+         gcc_assert (frame == frame_pointer_rtx);
+         x = arg_pointer_rtx;
+       }
+      else
+       {
+         x = memory_address (Pmode, frame);
+         x = copy_to_reg (gen_rtx_MEM (Pmode, x));
+       }
+
+      x = plus_constant (Pmode, x, RETURN_ADDRESS_OFFSET);
+      return gen_rtx_MEM (Pmode, memory_address (Pmode, x));
     }
 
   cfun->machine->ra_need_lr = 1;
Index: gcc/testsuite/gcc.dg/20051128-1.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/gcc.dg/20051128-1.c   2013-11-26 16:44:14.566089231 +0100
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void exit (int);
+extern void abort (void);
+
+int b;
+
+struct A
+{
+  void *pad[147];
+  void *ra, *h;
+  long o;
+};
+
+void
+__attribute__((noinline))
+foo (struct A *a, void *x)
+{
+  __builtin_memset (a, 0, sizeof (a));
+  if (!b)
+    exit (0);
+}
+
+void
+__attribute__((noinline))
+bar (void)
+{
+  struct A a;
+
+  __builtin_unwind_init ();
+  foo (&a, __builtin_return_address (0));
+}
+
+int
+main (void)
+{
+  bar ();
+  abort ();
+  return 0;
+}
++++++ gcc43-no-unwind-tables.diff ++++++
Index: libgcc/Makefile.in
===================================================================
--- libgcc/Makefile.in.orig     2015-12-14 11:33:03.225790694 +0100
+++ libgcc/Makefile.in  2015-12-17 15:09:45.415136693 +0100
@@ -288,7 +288,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN
   $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \
   -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
   -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
-  $(INHIBIT_LIBC_CFLAGS)
+  $(INHIBIT_LIBC_CFLAGS) -fno-unwind-tables -fno-asynchronous-unwind-tables
 
 # Extra flags to use when compiling crt{begin,end}.o.
 CRTSTUFF_T_CFLAGS =
++++++ gcc44-rename-info-files.patch ++++++
++++ 665 lines (skipped)

++++++ gcc44-textdomain.patch ++++++
#! /bin/sh -e

# DP: Set gettext's domain and textdomain to the versioned package name.

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0


Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in.orig        2013-11-26 16:46:03.000000000 +0100
+++ gcc/Makefile.in     2013-11-26 16:46:43.271816000 +0100
@@ -3795,8 +3795,8 @@ install-po:
          dir=$(localedir)/$$lang/LC_MESSAGES; \
          echo $(mkinstalldirs) $(DESTDIR)$$dir; \
          $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
-         echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
-         $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
+         echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-7.mo; \
+         $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-7.mo; \
        done
 
 # Rule for regenerating the message template (gcc.pot).
Index: gcc/intl.c
===================================================================
--- gcc/intl.c.orig     2013-11-26 15:42:31.000000000 +0100
+++ gcc/intl.c  2013-11-26 16:46:43.271816000 +0100
@@ -55,8 +55,8 @@ gcc_init_libintl (void)
   setlocale (LC_ALL, "");
 #endif
 
-  (void) bindtextdomain ("gcc", LOCALEDIR);
-  (void) textdomain ("gcc");
+  (void) bindtextdomain ("gcc-7", LOCALEDIR);
+  (void) textdomain ("gcc-7");
 
   /* Opening quotation mark.  */
   open_quote = _("`");
Index: libcpp/Makefile.in
===================================================================
--- libcpp/Makefile.in.orig     2013-11-26 16:26:56.000000000 +0100
+++ libcpp/Makefile.in  2013-11-26 16:47:15.764193260 +0100
@@ -49,6 +49,7 @@ LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 PACKAGE = @PACKAGE@
+PACKAGE_SUFFIX = -7
 RANLIB = @RANLIB@
 SHELL = @SHELL@
 USED_CATALOGS = @USED_CATALOGS@
@@ -74,8 +75,10 @@ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/.
        -I$(srcdir)/include
 
 ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG)
+ALL_CFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
 ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
        $(CPPFLAGS) $(PICFLAG)
+ALL_CXXFLAGS += -DPACKAGE_SUFFIX=\"$(strip $(PACKAGE_SUFFIX))\"
 
 # The name of the compiler to use.
 COMPILER = $(CXX)
@@ -164,8 +167,8 @@ install-strip install: all installdirs
          else continue; \
          fi; \
          dir=$(localedir)/$$lang/LC_MESSAGES; \
-         echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
-         $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+         echo $(INSTALL_DATA) $$cat 
$(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; \
+         $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(PACKAGE_SUFFIX).mo; 
\
        done
 
 mostlyclean:
Index: libcpp/system.h
===================================================================
--- libcpp/system.h.orig        2013-01-15 10:49:52.000000000 +0100
+++ libcpp/system.h     2013-11-26 16:46:43.271816000 +0100
@@ -280,7 +280,7 @@ extern int errno;
 #endif
 
 #ifndef _
-# define _(msgid) dgettext (PACKAGE, msgid)
+# define _(msgid) dgettext (PACKAGE PACKAGE_SUFFIX, msgid)
 #endif
 
 #ifndef N_
Index: libcpp/init.c
===================================================================
--- libcpp/init.c.orig  2013-11-26 15:42:40.000000000 +0100
+++ libcpp/init.c       2013-11-26 16:46:43.271816000 +0100
@@ -152,7 +152,7 @@ init_library (void)
       init_trigraph_map ();
 
 #ifdef ENABLE_NLS
-       (void) bindtextdomain (PACKAGE, LOCALEDIR);
+       (void) bindtextdomain (PACKAGE PACKAGE_SUFFIX, LOCALEDIR);
 #endif
     }
 }
++++++ gcc48-libstdc++-api-reference.patch ++++++
Index: libstdc++-v3/doc/html/index.html
===================================================================
--- libstdc++-v3/doc/html/index.html    (revision 210144)
+++ libstdc++-v3/doc/html/index.html    (working copy)
@@ -18,7 +18,7 @@
          </p></li><li class="listitem"><p>
            <a class="link" href="faq.html" title="Frequently Asked 
Questions">Frequently Asked Questions</a>
          </p></li><li class="listitem"><p>
-           <a class="link" href="api.html" title="The GNU C++ Library API 
Reference">API and Source Documentation</a>
+           <a class="link" href="api/index.html" title="The GNU C++ Library 
API Reference">API and Source Documentation</a>
          </p></li></ul></div><p>
     </p></div></div></div><hr /></div><div class="toc"><p><strong>Table of 
Contents</strong></p><dl class="toc"><dt><span class="book"><a 
href="manual/index.html">The GNU C++ Library 
Manual</a></span></dt><dd><dl><dt><span class="part"><a 
href="manual/intro.html">I. 
   Introduction

++++++ gcc48-remove-mpfr-2.4.0-requirement.patch ++++++
Index: configure.ac
===================================================================
--- configure.ac        (revision 216911)
+++ configure.ac        (working copy)
@@ -1454,7 +1454,7 @@ if test -d ${srcdir}/gcc && test "x$have
     AC_MSG_CHECKING([for the correct version of mpfr.h])
     AC_TRY_COMPILE([#include <gmp.h>
     #include <mpfr.h>],[
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1)
     choke me
     #endif
     ], [AC_TRY_COMPILE([#include <gmp.h>
Index: configure
===================================================================
--- configure   (revision 216911)
+++ configure   (working copy)
@@ -5524,7 +5524,7 @@ int
 main ()
 {
 
-    #if MPFR_VERSION < MPFR_VERSION_NUM(2,4,0)
+    #if MPFR_VERSION < MPFR_VERSION_NUM(2,3,1)
     choke me
     #endif
 
Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c      (revision 216911)
+++ gcc/fortran/simplify.c      (working copy)
@@ -4278,10 +4278,7 @@ gfc_simplify_mod (gfc_expr *a, gfc_expr
            return &gfc_bad_expr;
          }
 
-       gfc_set_model_kind (kind);
-       mpfr_fmod (result->value.real, a->value.real, p->value.real,
-                  GFC_RND_MODE);
-       break;
+       return NULL;
 
       default:
        gfc_internal_error ("gfc_simplify_mod(): Bad arguments");
@@ -4327,19 +4324,7 @@ gfc_simplify_modulo (gfc_expr *a, gfc_ex
            return &gfc_bad_expr;
          }
 
-       gfc_set_model_kind (kind);
-       mpfr_fmod (result->value.real, a->value.real, p->value.real,
-                  GFC_RND_MODE);
-       if (mpfr_cmp_ui (result->value.real, 0) != 0)
-         {
-           if (mpfr_signbit (a->value.real) != mpfr_signbit (p->value.real))
-             mpfr_add (result->value.real, result->value.real, p->value.real,
-                       GFC_RND_MODE);
-         }
-       else
-         mpfr_copysign (result->value.real, result->value.real,
-                        p->value.real, GFC_RND_MODE);
-       break;
+       return NULL;
 
       default:
        gfc_internal_error ("gfc_simplify_modulo(): Bad arguments");
Index: gcc/ubsan.c
===================================================================
--- gcc/ubsan.c.orig    2015-06-01 14:52:11.717105684 +0200
+++ gcc/ubsan.c 2015-06-01 14:52:26.945253071 +0200
@@ -1564,40 +1564,6 @@
          min = build_real (expr_type, minval2);
        }
     }
-  else if (REAL_MODE_FORMAT (mode)->b == 10)
-    {
-      /* For _Decimal128 up to 34 decimal digits, - sign,
-        dot, e, exponent.  */
-      char buf[64];
-      mpfr_t m;
-      int p = REAL_MODE_FORMAT (mode)->p;
-      REAL_VALUE_TYPE maxval, minval;
-
-      /* Use mpfr_snprintf rounding to compute the smallest
-        representable decimal number greater or equal than
-        1 << (prec - !uns_p).  */
-      mpfr_init2 (m, prec + 2);
-      mpfr_set_ui_2exp (m, 1, prec - !uns_p, GMP_RNDN);
-      mpfr_snprintf (buf, sizeof buf, "%.*RUe", p - 1, m);
-      decimal_real_from_string (&maxval, buf);
-      max = build_real (expr_type, maxval);
-
-      /* For unsigned, assume -1.0 is always representable.  */
-      if (uns_p)
-       min = build_minus_one_cst (expr_type);
-      else
-       {
-         /* Use mpfr_snprintf rounding to compute the largest
-            representable decimal number less or equal than
-            (-1 << (prec - 1)) - 1.  */
-         mpfr_set_si_2exp (m, -1, prec - 1, GMP_RNDN);
-         mpfr_sub_ui (m, m, 1, GMP_RNDN);
-         mpfr_snprintf (buf, sizeof buf, "%.*RDe", p - 1, m);
-         decimal_real_from_string (&minval, buf);
-         min = build_real (expr_type, minval);
-       }
-      mpfr_clear (m);
-    }
   else
     return NULL_TREE;
 
Index: gcc/gimple-ssa-sprintf.c
===================================================================
--- gcc/gimple-ssa-sprintf.c    (revision 257728)
+++ gcc/gimple-ssa-sprintf.c    (working copy)
@@ -1637,18 +1637,7 @@ get_mpfr_format_length (mpfr_ptr x, cons
        p = 1024;
     }
 
-  len = mpfr_snprintf (NULL, 0, fmtstr, (int)p, x);
-
-  /* Handle the unlikely (impossible?) error by returning more than
-     the maximum dictated by the function's return type.  */
-  if (len < 0)
-    return target_dir_max () + 1;
-
-  /* Adjust the return value by the difference.  */
-  if (p < prec)
-    len += prec - p;
-
-  return len;
+  return target_dir_max () + 1;
 }
 
 /* Return the number of bytes to format using the format specifier

Index: gcc/fortran/simplify.c
===================================================================
--- gcc/fortran/simplify.c      (revision 257983)
+++ gcc/fortran/simplify.c      (working copy)
@@ -1745,51 +1745,6 @@ simplify_trig_call (gfc_expr *icall)
     }
 }
 
-/* Convert a floating-point number from radians to degrees.  */
-
-static void
-degrees_f (mpfr_t x, mp_rnd_t rnd_mode)
-{
-  mpfr_t tmp;
-  mpfr_init (tmp);
-
-  /* Set x = x % 2pi to avoid offsets with large angles.  */
-  mpfr_const_pi (tmp, rnd_mode);
-  mpfr_mul_ui (tmp, tmp, 2, rnd_mode);
-  mpfr_fmod (tmp, x, tmp, rnd_mode);
-
-  /* Set x = x * 180.  */
-  mpfr_mul_ui (x, x, 180, rnd_mode);
-
-  /* Set x = x / pi.  */
-  mpfr_const_pi (tmp, rnd_mode);
-  mpfr_div (x, x, tmp, rnd_mode);
-
-  mpfr_clear (tmp);
-}
-
-/* Convert a floating-point number from degrees to radians.  */
-
-static void
-radians_f (mpfr_t x, mp_rnd_t rnd_mode)
-{
-  mpfr_t tmp;
-  mpfr_init (tmp);
-
-  /* Set x = x % 360 to avoid offsets with large angles.  */
-  mpfr_set_ui (tmp, 360, rnd_mode);
-  mpfr_fmod (tmp, x, tmp, rnd_mode);
-
-  /* Set x = x * pi.  */
-  mpfr_const_pi (tmp, rnd_mode);
-  mpfr_mul (x, x, tmp, rnd_mode);
-
-  /* Set x = x / 180.  */
-  mpfr_div_ui (x, x, 180, rnd_mode);
-
-  mpfr_clear (tmp);
-}
-
 
 /* Convert argument to radians before calling a trig function.  */
 
@@ -1803,12 +1758,7 @@ gfc_simplify_trigd (gfc_expr *icall)
   if (arg->ts.type != BT_REAL)
     gfc_internal_error ("in gfc_simplify_trigd(): Bad type");
 
-  if (arg->expr_type == EXPR_CONSTANT)
-    /* Convert constant to radians before passing off to simplifier.  */
-    radians_f (arg->value.real, GFC_RND_MODE);
-
-  /* Let the usual simplifier take over - we just simplified the arg.  */
-  return simplify_trig_call (icall);
+  return NULL;
 }
 
 /* Convert result of an inverse trig function to degrees.  */
@@ -1816,21 +1766,9 @@ gfc_simplify_trigd (gfc_expr *icall)
 gfc_expr *
 gfc_simplify_atrigd (gfc_expr *icall)
 {
-  gfc_expr *result;
-
   if (icall->value.function.actual->expr->ts.type != BT_REAL)
     gfc_internal_error ("in gfc_simplify_atrigd(): Bad type");
 
-  /* See if another simplifier has work to do first.  */
-  result = simplify_trig_call (icall);
-
-  if (result && result->expr_type == EXPR_CONSTANT)
-    {
-      /* Convert constant to degrees after passing off to actual simplifier.  
*/
-      degrees_f (result->value.real, GFC_RND_MODE);
-      return result;
-    }
-
   /* Let gfc_resolve_atrigd take care of the non-constant case.  */
   return NULL;
 }
@@ -1840,21 +1778,9 @@ gfc_simplify_atrigd (gfc_expr *icall)
 gfc_expr *
 gfc_simplify_atan2d (gfc_expr *y, gfc_expr *x)
 {
-  gfc_expr *result;
-
   if (x->ts.type != BT_REAL || y->ts.type != BT_REAL)
     gfc_internal_error ("in gfc_simplify_atan2d(): Bad type");
 
-  if (x->expr_type == EXPR_CONSTANT && y->expr_type == EXPR_CONSTANT)
-    {
-      result = gfc_simplify_atan2 (y, x);
-      if (result != NULL)
-       {
-         degrees_f (result->value.real, GFC_RND_MODE);
-         return result;
-       }
-    }
-
   /* Let gfc_resolve_atan2d take care of the non-constant case.  */
   return NULL;
 }
++++++ gcc5-no-return-gcc43-workaround.patch ++++++
Workaround

[ 3445s] I: Program returns random data in a function
[ 3445s] E: gcc5 no-return-in-nonvoid-function ../../gcc/cp/constexpr.c:3676

during stage1 when compiling with a GCC 4.3 host compiler

--- gcc/cp/constexpr.c.orig     2015-06-02 09:33:15.085636193 +0200
+++ gcc/cp/constexpr.c  2015-06-02 09:34:04.637080196 +0200
@@ -3668,11 +3668,10 @@
        {
          r = get_target_expr (r);
          TREE_CONSTANT (r) = true;
-         return r;
        }
     }
-  else
-    return r;
+
+  return r;
 }
 
 /* Returns true if T is a valid subexpression of a constant expression,
++++++ gcc7-avoid-fixinc-error.diff ++++++
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in     (revision 255402)
+++ gcc/Makefile.in     (working copy)
@@ -2993,13 +2993,6 @@ stmp-fixinc: gsyslimits.h macro_list fix
            sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
            multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
            fix_dir=include-fixed$${multi_dir}; \
-           if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
-             echo The directory that should contain system headers does not 
exist: >&2 ; \
-             echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
-             tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e 
"s,[^/]*/\.\.\/,," -e ta`; \
-             if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
-             then sleep 1; else exit 1; fi; \
-           fi; \
            $(mkinstalldirs) $${fix_dir}; \
            chmod a+rx $${fix_dir} || true; \
            (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; 
\
++++++ gcc7-bsc1146475.patch ++++++
2019-10-01  Alexandre Oliva <[email protected]>

        PR debug/91507
        * dwarf2out.c (override_type_for_decl_p): New.
        (gen_variable_die): Use it.

        * gcc.dg/debug/dwarf2/array-0.c: New.
        * gcc.dg/debug/dwarf2/array-1.c: New.
        * gcc.dg/debug/dwarf2/array-2.c: New.
        * gcc.dg/debug/dwarf2/array-3.c: New.
        * g++.dg/debug/dwarf2/array-0.C: New.
        * g++.dg/debug/dwarf2/array-1.C: New.
        * g++.dg/debug/dwarf2/array-2.C: New.  Based on libstdc++-v3's
        src/c++98/pool_allocator.cc:__pool_alloc_base::_S_heap_size.
        * g++.dg/debug/dwarf2/array-3.C: New.  Based on
        gcc's config/i386/i386-features.c:xlogue_layout::s_instances.
        * g++.dg/debug/dwarf2/array-4.C: New.

Index: gcc/testsuite/gcc.dg/debug/dwarf2/array-0.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/array-0.c (nonexistent)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/array-0.c (revision 276403)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+extern int array[42];
+
+int array[42];
+
+/* Verify that we get only one DW_TAG_subtrange_type (plus abbrev),
+   with a DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/gcc.dg/debug/dwarf2/array-2.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/array-2.c (nonexistent)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/array-2.c (revision 276403)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+int array[42];
+
+/* Verify that we get only one DW_TAG_subtrange_type (plus abbrev)
+   with DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/gcc.dg/debug/dwarf2/array-1.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/array-1.c (nonexistent)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/array-1.c (revision 276403)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+extern int array[];
+
+int array[42];
+
+/* Verify that we get two DW_TAG_subtrange_type (each with an abbrev),
+   but only one DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 4 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/gcc.dg/debug/dwarf2/array-3.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/array-3.c (nonexistent)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/array-3.c (revision 276403)
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+int array[] = { 0, 1, 2 };
+
+/* Verify that we get only one DW_TAG_subtrange_type (plus abbrev)
+   with DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/g++.dg/debug/dwarf2/array-1.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/array-1.C (nonexistent)
+++ gcc/testsuite/g++.dg/debug/dwarf2/array-1.C (revision 276403)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+struct S
+{
+  static int array[];
+};
+
+int S::array[42];
+
+/* Verify that we get two DW_TAG_subrange_type, only one of which with
+   a DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 4 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/g++.dg/debug/dwarf2/array-2.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/array-2.C (nonexistent)
+++ gcc/testsuite/g++.dg/debug/dwarf2/array-2.C (revision 276403)
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+struct S
+{
+  typedef int i_t;
+  static i_t array[42];
+};
+
+int S::array[42];
+
+/* Verify that we get two DW_TAG_subrange_type (plus abbrev), and two
+   DW_AT_upper_bound, because a different symbolic name is used for
+   the array element type.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 3 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 2 } } */
Index: gcc/testsuite/g++.dg/debug/dwarf2/array-3.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/array-3.C (nonexistent)
+++ gcc/testsuite/g++.dg/debug/dwarf2/array-3.C (revision 276403)
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+struct S
+{
+  S() {}
+  ~S() {}
+  static const S array[2];
+};
+
+const S S::array[2] = { S(), S() };
+
+/* Verify that we get only one DW_TAG_subrange_type (plus the abbrev),
+   and one DW_AT_upper_bound (non-abbrev), because the array
+   definition loses the readonly wrapper for the array type because of
+   the dynamic initializers.  The const types are 4: S, S*, int, and
+   S[4], plus the abbrev.  A const version of S[4] doesn't make sense,
+   but we output it.  */
+/* { dg-final { scan-assembler-times " DW_TAG_const_type" 5 } } */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/g++.dg/debug/dwarf2/array-0.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/array-0.C (nonexistent)
+++ gcc/testsuite/g++.dg/debug/dwarf2/array-0.C (revision 276403)
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+struct S
+{
+  static int array[42];
+};
+
+int S::array[42];
+
+/* Verify that we get only one DW_TAG_subrange_type with a
+   DW_AT_upper_bound.  */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/testsuite/g++.dg/debug/dwarf2/array-4.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/array-4.C (nonexistent)
+++ gcc/testsuite/g++.dg/debug/dwarf2/array-4.C (revision 276403)
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-2 -dA" } */
+struct S
+{
+  S() {}
+  ~S() {}
+};
+
+const S array[2] = { S(), S() };
+
+/* Like array-3, but with a non-member array without a separate
+   declaration, to check that we don't issue the nonsensical
+   DW_TAG_const_type used by the member array declaration there.  */
+/* { dg-final { scan-assembler-times " DW_TAG_const_type" 4 } } */
+/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
+/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c     (revision 276402)
+++ gcc/dwarf2out.c     (revision 276403)
@@ -23705,6 +23705,34 @@ local_function_static (tree decl)
     && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL;
 }
 
+/* Return true iff DECL overrides (presumably completes) the type of
+   OLD_DIE within CONTEXT_DIE.  */
+
+static bool
+override_type_for_decl_p (tree decl, dw_die_ref old_die,
+                         dw_die_ref context_die)
+{
+  tree type = TREE_TYPE (decl);
+  int cv_quals;
+
+  if (decl_by_reference_p (decl))
+    {
+      type = TREE_TYPE (type);
+      cv_quals = TYPE_UNQUALIFIED;
+    }
+  else
+    cv_quals = decl_quals (decl);
+
+  dw_die_ref type_die = modified_type_die (type,
+                                          cv_quals | TYPE_QUALS (type),
+                                          false,
+                                          context_die);
+
+  dw_die_ref old_type_die = get_AT_ref (old_die, DW_AT_type);
+
+  return type_die != old_type_die;
+}
+
 /* Generate a DIE to represent a declared data object.
    Either DECL or ORIGIN must be non-null.  */
 
@@ -23957,7 +23985,9 @@ gen_variable_die (tree decl, tree origin
          && !DECL_ABSTRACT_P (decl_or_origin)
          && variably_modified_type_p (TREE_TYPE (decl_or_origin),
                                       decl_function_context
-                                                       (decl_or_origin))))
+                                      (decl_or_origin)))
+      || (old_die && specialization_p
+         && override_type_for_decl_p (decl_or_origin, old_die, context_die)))
     {
       tree type = TREE_TYPE (decl_or_origin);
 
++++++ gcc7-bsc1160086.patch ++++++
2019-12-17  Andreas Krebbel  <[email protected]>

        Backport from mainline
        2019-12-16  Andreas Krebbel  <[email protected]>

        PR target/92950
        * config/s390/vector.md ("mov<mode>" for V_8): Replace lh, lhy,
        and lhrl with llc.

        * gcc.target/s390/vector/pr92950.c: New test.

Index: gcc/testsuite/gcc.target/s390/vector/pr92950.c
===================================================================
--- gcc/testsuite/gcc.target/s390/vector/pr92950.c      (nonexistent)
+++ gcc/testsuite/gcc.target/s390/vector/pr92950.c      (revision 279454)
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -mzarch -march=z13" } */
+
+struct a {
+  int b;
+  char c;
+};
+struct a d = {1, 16};
+struct a *e = &d;
+
+int f = 0;
+
+int main() {
+  struct a g = {0, 0 };
+  f = 0;
+
+  for (; f <= 1; f++) {
+    g = d;
+    *e = g;
+  }
+
+  if (d.c != 16)
+    __builtin_abort();
+}
Index: gcc/config/s390/vector.md
===================================================================
--- gcc/config/s390/vector.md   (revision 279453)
+++ gcc/config/s390/vector.md   (revision 279454)
@@ -289,9 +289,9 @@ (define_split
 ; However, this would probably be slower.
 
 (define_insn "mov<mode>"
-  [(set (match_operand:V_8 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  
v,d,  Q,  S,  Q,  S,  d,  d,d,d,d,R,T")
-        (match_operand:V_8 1 "general_operand"      " 
v,d,v,R,v,j00,jm1,jyy,jxx,d,j00,j00,jm1,jm1,j00,jm1,R,T,b,d,d"))]
-  ""
+  [(set (match_operand:V_8 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  
v,d,  Q,  S,  Q,  S,  d,  d,d,R,T")
+        (match_operand:V_8 1 "general_operand"      " 
v,d,v,R,v,j00,jm1,jyy,jxx,d,j00,j00,jm1,jm1,j00,jm1,T,d,d"))]
+  "TARGET_VX"
   "@
    vlr\t%v0,%v1
    vlvgb\t%v0,%1,0
@@ -309,12 +309,10 @@ (define_insn "mov<mode>"
    mviy\t%0,-1
    lhi\t%0,0
    lhi\t%0,-1
-   lh\t%0,%1
-   lhy\t%0,%1
-   lhrl\t%0,%1
+   llc\t%0,%1
    stc\t%1,%0
    stcy\t%1,%0"
-  [(set_attr "op_type"      
"VRR,VRS,VRS,VRX,VRX,VRI,VRI,VRI,VRI,RR,SI,SIY,SI,SIY,RI,RI,RX,RXY,RIL,RX,RXY")])
+  [(set_attr "op_type"      
"VRR,VRS,VRS,VRX,VRX,VRI,VRI,VRI,VRI,RR,SI,SIY,SI,SIY,RI,RI,RXY,RX,RXY")])
 
 (define_insn "mov<mode>"
   [(set (match_operand:V_16 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  
v,d,  Q,  Q,  d,  d,d,d,d,R,T,b")
++++++ gcc7-flive-patching.patch ++++++
++++ 662 lines (skipped)

++++++ gcc7-pr82248.diff ++++++
Index: gcc/config/arm/arm.md
===================================================================
--- gcc/config/arm/arm.md       (revision 255006)
+++ gcc/config/arm/arm.md       (working copy)
@@ -8613,7 +8613,7 @@ (define_insn "blockage"
 )
 
 (define_insn "probe_stack"
-  [(set (match_operand:SI 0 "memory_operand" "=m")
+  [(set (match_operand:SI 0 "memory_operand" "=o")
         (unspec:SI [(const_int 0)] UNSPEC_PROBE_STACK))]
   "TARGET_32BIT"
   "str%?\\tr0, %0"
++++++ gcc7-pr85887.patch ++++++
2019-10-22  Jakub Jelinek  <[email protected]>

        PR tree-optimization/85887
        * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
        and __cxa_guard_release.

Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c       (revision 277292)
+++ gcc/cp/decl.c       (revision 277293)
@@ -8589,14 +8589,14 @@ expand_static_init (tree decl, tree init
              (acquire_name, build_function_type_list (integer_type_node,
                                                       TREE_TYPE (guard_addr),
                                                       NULL_TREE),
-              NULL_TREE, ECF_NOTHROW | ECF_LEAF);
+              NULL_TREE, ECF_NOTHROW);
          if (!release_fn || !abort_fn)
            vfntype = build_function_type_list (void_type_node,
                                                TREE_TYPE (guard_addr),
                                                NULL_TREE);
          if (!release_fn)
            release_fn = push_library_fn (release_name, vfntype, NULL_TREE,
-                                          ECF_NOTHROW | ECF_LEAF);
+                                         ECF_NOTHROW);
          if (!abort_fn)
            abort_fn = push_library_fn (abort_name, vfntype, NULL_TREE,
                                        ECF_NOTHROW | ECF_LEAF);

++++++ gcc7-remove-Wexpansion-to-defined-from-Wextra.patch ++++++
Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt  (revision 246224)
+++ gcc/c-family/c.opt  (working copy)
@@ -596,7 +596,7 @@ C ObjC C++ ObjC++ Var(warn_double_promot
 Warn about implicit conversions from \"float\" to \"double\".
 
 Wexpansion-to-defined
-C ObjC C++ ObjC++ CPP(warn_expansion_to_defined) 
CppReason(CPP_W_EXPANSION_TO_DEFINED) Var(cpp_warn_expansion_to_defined) 
Init(0) Warning EnabledBy(Wextra || Wpedantic)
+C ObjC C++ ObjC++ CPP(warn_expansion_to_defined) 
CppReason(CPP_W_EXPANSION_TO_DEFINED) Var(cpp_warn_expansion_to_defined) 
Init(0) Warning EnabledBy(Wpedantic)
 Warn if \"defined\" is used outside #if.
 
 Wimplicit-function-declaration
++++++ gcc7-rpmlintrc ++++++
# This line is mandatory to access the configuration functions
from Config import *

# gcc/gcc-c++ are devel packages even if not called -devel...
addFilter ("gcc.*devel-file-in-non-devel-package")
addFilter ("gcc.*devel-dependency glibc-devel")
addFilter ("gcc.*devel-dependency libstdc")
# libstdc++6-devel is the devel package of libstdc++6, no better name exists
# and we do package static libs and the .so links (but in a gcc versioned
# directory)
addFilter ("libstdc.*shlib-policy-missing-lib")
# We have names lib libgcc_s1-gcc7 for non-default GCCs
addFilter ("shlib-policy-name-error")
addFilter ("shlib-legacy-policy-name-error")
# Packages provide libgcc_s1 = $version and conflict with other providers
# of libgcc_s1
addFilter ("conflicts-with-provides")

++++++ gcc7-stack-probe.diff ++++++
Index: gcc/common.opt
===================================================================
--- gcc/common.opt      (revision 244266)
+++ gcc/common.opt      (working copy)
@@ -2295,6 +2299,10 @@ fstack-check
 Common Alias(fstack-check=, specific, no)
 Insert stack checking code into the program.  Same as -fstack-check=specific.
 
+fstack-clash-protection
+Common Report Var(flag_stack_clash_protection)
+Insert probes per page for dynamically allocated stack space
+
 fstack-limit
 Common Var(common_deferred_options) Defer
 
Index: gcc/explow.c
===================================================================
--- gcc/explow.c        (revision 244266)
+++ gcc/explow.c        (working copy)
@@ -1277,6 +1277,8 @@ get_dynamic_stack_size (rtx *psize, unsi
   *psize = size;
 }
 
+#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
+
 /* Return an rtx representing the address of an area of memory dynamically
    pushed on the stack.
 
@@ -1305,6 +1307,8 @@ allocate_dynamic_stack_space (rtx size,
   HOST_WIDE_INT stack_usage_size = -1;
   rtx_code_label *final_label;
   rtx final_target, target;
+  rtx loop_lab, end_lab, skip_lab, last_size, before_skip;
+  int probe_pass = 0;
 
   /* If we're asking for zero bytes, it doesn't matter what we point
      to since we can't dereference it.  But return a reasonable
@@ -1440,6 +1444,30 @@ allocate_dynamic_stack_space (rtx size,
   /* Don't let anti_adjust_stack emit notes.  */
   suppress_reg_args_size = true;
 
+  if (flag_stack_clash_protection)
+    {
+#ifndef STACK_GROWS_DOWNWARD
+      sorry("-fstack-clash-protection is incompatible with upward growing 
stack");
+#endif
+      size = copy_to_mode_reg (Pmode, convert_to_mode (Pmode, size, 1));
+      loop_lab = gen_label_rtx ();
+      end_lab = gen_label_rtx ();
+      skip_lab = gen_label_rtx ();
+      /* We insert 'target = virtual_stack_dynamic_rtx' here, but target
+        is changed later, so that insn can be constructed only later.  */
+      before_skip = get_last_insn ();
+      emit_cmp_and_jump_insns (size, CONST0_RTX (Pmode), EQ, NULL_RTX,
+                              Pmode, 1, skip_lab);
+      emit_label (loop_lab);
+      emit_cmp_and_jump_insns (size, GEN_INT (PROBE_INTERVAL), LTU,
+                              NULL_RTX, Pmode, 1, end_lab);
+      last_size = expand_binop (Pmode, sub_optab, size, GEN_INT 
(PROBE_INTERVAL), size,
+                               1, OPTAB_WIDEN);
+      gcc_assert (last_size == size);
+      size = GEN_INT (PROBE_INTERVAL);
+    }
+
+again:
   /* Perform the required allocation from the stack.  Some systems do
      this differently than simply incrementing/decrementing from the
      stack pointer, such as acquiring the space by calling malloc().  */
@@ -1499,6 +1527,15 @@ allocate_dynamic_stack_space (rtx size,
       if (STACK_GROWS_DOWNWARD)
        emit_move_insn (target, virtual_stack_dynamic_rtx);
     }
+  if (flag_stack_clash_protection && probe_pass == 0)
+    {
+      probe_pass = 1;
+      emit_stack_probe (target);
+      emit_jump (loop_lab);
+      emit_label (end_lab);
+      size = last_size;
+      goto again;
+    }
 
   suppress_reg_args_size = false;
 
@@ -1510,6 +1547,17 @@ allocate_dynamic_stack_space (rtx size,
       emit_label (final_label);
       target = final_target;
     }
+  if (flag_stack_clash_protection)
+    {
+      rtx seq;
+      emit_stack_probe (target);
+      emit_label (skip_lab);
+      start_sequence ();
+      emit_move_insn (target, virtual_stack_dynamic_rtx);
+      seq = get_insns ();
+      end_sequence ();
+      emit_insn_after (seq, before_skip);
+    }
 
   target = align_dynamic_address (target, required_align);
 
@@ -1593,8 +1641,6 @@ emit_stack_probe (rtx address)
    the current stack pointer.  STACK_GROWS_DOWNWARD says whether to add
    or subtract them from the stack pointer.  */
 
-#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP)
-
 #if STACK_GROWS_DOWNWARD
 #define STACK_GROW_OP MINUS
 #define STACK_GROW_OPTAB sub_optab
++++++ pre_checkin.sh ++++++
#!/bin/bash
# This script is called automatically during autobuild checkin.

case $0 in
  \./*)
    here=$PWD
    ;;
  */*)
    here=${0%/*}
    ;;
  *)
    here=$PWD
    ;;
esac
case ${here##*/} in
  gcc*.*)
    # Handle maintainance projects with .$REPO suffix
    suffix=${here##*/}
    suffix=${suffix%%\.*}
    set ${suffix#gcc}
    ;;
  gcc-*)
    suffix=${here##*/}
    set ${suffix#*-}-
    ;;
  gcc[0-9]*)
    suffix=${here##*/}
    set ${suffix#gcc}
    ;;
esac
. ${here}/change_spec
++++++ tls-no-direct.diff ++++++
For i?86 negative offsets to %fs segment accesses cause a hypervisor
trap for Xen.  Avoid this by making accesses indirect.

???  Note that similar to the behavior on SLE11 this only affects
the compiler built on %ix86, not that on x86_64, even with -m32.

Index: gcc/config/i386/linux.h
===================================================================
--- gcc/config/i386/linux.h.orig        2015-12-17 15:07:37.785650062 +0100
+++ gcc/config/i386/linux.h     2015-12-17 15:08:06.393983290 +0100
@@ -24,3 +24,9 @@ along with GCC; see the file COPYING3.
 
 #undef MUSL_DYNAMIC_LINKER
 #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+
+/* This slows down Xen, so take a very small general performance hit
+   for not accessing the %fs segment with negative offsets by making
+   GCC not emit direct accesses to %fs at all.  */
+#undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
+#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT 0

Reply via email to