Hello community, here is the log from the commit of package gcc9.13223 for openSUSE:Leap:15.2:Update checked in at 2020-07-17 18:29:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2:Update/gcc9.13223 (Old) and /work/SRC/openSUSE:Leap:15.2:Update/.gcc9.13223.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gcc9.13223" Fri Jul 17 18:29:52 2020 rev:1 rq:819691 version:9.3.1+git1296 Changes: -------- New Changes file: --- /dev/null 2020-07-16 02:54:20.700682797 +0200 +++ /work/SRC/openSUSE:Leap:15.2:Update/.gcc9.13223.new.3592/cross-nvptx-gcc9.changes 2020-07-17 18:29:53.316248651 +0200 @@ -0,0 +1,427 @@ +------------------------------------------------------------------- +Mon Apr 6 06:16:10 UTC 2020 - Richard Biener <[email protected]> + +- Update to releases/gcc-9 head (6db837a5288ee3ca5ec504fbd5a76581). + * Includes GCC 9.3 release + * Includes fix for [bsc#1167898, gcc#93597] + +------------------------------------------------------------------- +Fri Mar 6 08:58:58 UTC 2020 - Richard Biener <[email protected]> + +- Update to releases/gcc-9 head (c5edde44f5b17b4891f17a63517f355b). + * Includes GCC 9.3.0 RC1 + +------------------------------------------------------------------- +Mon Mar 2 08:33:11 UTC 2020 - Richard Biener <[email protected]> + +- Update to releases/gcc-9 head (eaaee438bf836c2c1ed3424ecbf85de3ed941e87). + * Includes fix for binutils version parsing [gcc#93965] + +------------------------------------------------------------------- +Tue Feb 25 13:44:51 UTC 2020 - Richard Biener <[email protected]> + +- Add libstdc++6-pp provides and conflicts to avoid file conflicts + with same minor version of libstdc++6-pp from gcc10. + +------------------------------------------------------------------- +Wed Feb 12 09:16:06 UTC 2020 - Andreas Schwab <[email protected]> + +- Install go tool buildid for bootstrapping go + +------------------------------------------------------------------- +Tue Jan 28 10:14:36 UTC 2020 - Richard Biener <[email protected]> + +- Update to releases/gcc-9 head (83f65674e78d97d27537361de1a9d74067ff228d). + * Includes fix for [gcc#92692] + +------------------------------------------------------------------- +Thu Jan 9 11:12:37 UTC 2020 - Richard Biener <[email protected]> + +- Update to gcc-9-branch head (r280037). + * Includes fix for [gcc#92154] + +------------------------------------------------------------------- +Mon Dec 9 10:46:24 UTC 2019 - Richard Biener <[email protected]> + +- Update to gcc-9-branch head (r279103). + * Includes gcc9-pr91772.patch + +------------------------------------------------------------------- +Mon Oct 7 16:37:37 UTC 2019 - [email protected] + +- Refresh gcc48-remove-mpfr-2.4.0-requirement.patch to apply + again. +- Use new license and header also in gcc.spec.in to reduce churn + with format_spec_file. +- Use BuildRoot tag again for old distros (SLE-11). + +------------------------------------------------------------------- +Fri Oct 4 08:45:43 UTC 2019 - Richard Biener <[email protected]> + +- Make cross-arm-gcc a gcc_icecream cross. Remove the disabling + of debuginfo stripping. [bsc#1152590] + +------------------------------------------------------------------- +Wed Sep 18 08:15:19 UTC 2019 - Richard Biener <[email protected]> + +- Add gcc9-pr91772.patch and gcc9-pr91763.patch to fix fallout + of gcc9-autodetect-g-at-lto-link.patch. + +------------------------------------------------------------------- +Wed Sep 11 11:22:02 UTC 2019 - Richard Biener <[email protected]> + +- Add gcc9-autodetect-g-at-lto-link.patch. [bsc#1149995] + +------------------------------------------------------------------- +Mon Sep 9 07:25:31 UTC 2019 - Richard Biener <[email protected]> + +- Reorder things in cross.spec.in so the Version define comes before + the first use of %version. +- Revert removal of defattr, it breaks building on SLES12. + +------------------------------------------------------------------- +Tue Sep 3 08:01:01 UTC 2019 - Richard Biener <[email protected]> + +- Update to gcc-9-branch head (r275327). + * Pulls fix for POWER9 DARN miscompilation. + (bsc#1149145, CVE-2019-15847) + +------------------------------------------------------------------- +Wed Aug 28 13:21:47 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] + +------------------------------------------------------------------- +Tue Aug 27 07:54:34 UTC 2019 - Jan Engelhardt <[email protected]> + +- Replace old $RPM_* shell vars by macros (where possible). +- Drop defattr and BuildRoot. + +------------------------------------------------------------------- +Fri Aug 23 11:36:20 UTC 2019 - Martin Liška <[email protected]> + +- Update gcc9-add-flto=auto.patch by adding backport + of upstream revision r274849. + +------------------------------------------------------------------- +Tue Aug 20 13:21:09 UTC 2019 - Richard Biener <[email protected]> + +- Update to gcc-9-branch head (r274709). +- Add gcc9-pr91307.patch to make symbols for aggregated global + constructor names stable when using LTO. + +------------------------------------------------------------------- +Mon Aug 12 12:55:48 UTC 2019 - Richard Biener <[email protected]> + +- Update to gcc-9-branch head (r274311). + * Includes GCC 9.2 release. [jsc#SLE-6536, jsc#SLE-6533, jsc#ECO-368] +- Update nvptx-newlib.tar.xz to official newlib-3.1.0.tar.xz + since nvptx support is now upstream. + +------------------------------------------------------------------- +Mon Aug 12 08:27:54 UTC 2019 - Martin Liška <[email protected]> + +- Add gcc9-add-flto=auto.patch in order to support -flto=auto. + +------------------------------------------------------------------- +Thu Aug 8 09:07:09 UTC 2019 - Andreas Schwab <[email protected]> + +- Enable cross compilers on riscv64 + +------------------------------------------------------------------- +Mon Aug 5 12:37:28 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r274111). + * GCC 9.2 RC1. +- Remove bogus fixed include bits/statx.h from glibc 2.30. [gcc#91085] + +------------------------------------------------------------------- +Thu Jul 25 11:02:46 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r273795): + * Includes fix for LTO linker plugin heap overflow. + (bsc#1142649, CVE-2019-14250) +- Add systemtap-headers BuildRequires. [bsc#1142654] + +------------------------------------------------------------------- +Tue Jul 23 11:21:03 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r273734). + * Includes fix for opencv3 build with LTO. [gcc#91231] + +------------------------------------------------------------------- +Thu Jul 18 07:32:46 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r273566). + * Includes fix for vector shift miscompilation on s390. [bsc#1141897] + +------------------------------------------------------------------- +Wed Jul 3 13:23:08 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r273003). + +------------------------------------------------------------------- +Fri Jun 14 13:34:59 UTC 2019 - Dominique Leuenberger <[email protected]> + +- Fix default for ringdisabled: bcond_with means 'conditionally + with': so only do so if explicitly specified. + +------------------------------------------------------------------- +Thu Jun 13 19:40:35 UTC 2019 - Dominique Leuenberger <[email protected]> + +- Do not build cross-* variants in stagings/rings. + +------------------------------------------------------------------- +Thu Jun 13 09:37:24 UTC 2019 - Martin Liška <[email protected]> + +- Add gcc9-value-prof.patch in order to provide more stable builds + for single value counters. + +------------------------------------------------------------------- +Tue Jun 11 08:33:28 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r272147). + * Pulls fix for random debug info differences when compiling D code. + [gcc#90778] + +------------------------------------------------------------------- +Thu Jun 6 08:14:15 UTC 2019 - [email protected] + +- Update to gcc-9-branch head (r271995). + * installs workaround for broken lapack C interfaces +- Drop gcc9-spectrev1.patch, add gcc9-reproducible-builds.patch + and gcc9-reproducible-builds-buildid-for-checksum.patch moving + reproducible build improvements over from GCC 8 package. +- Split out libstdc++ pretty-printers into a separate package ++++ 230 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:Leap:15.2:Update/.gcc9.13223.new.3592/cross-nvptx-gcc9.changes New Changes file: gcc9-testresults.changes: same change New Changes file: gcc9.changes: same change New: ---- README.First-for.SuSE.packagers _constraints change_spec check-build.sh cross-nvptx-gcc9.changes cross-nvptx-gcc9.spec cross.spec.in gcc-9.3.1+git1296.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 gcc7-avoid-fixinc-error.diff gcc7-remove-Wexpansion-to-defined-from-Wextra.patch gcc9-add-flto=auto.patch gcc9-autodetect-g-at-lto-link.patch gcc9-pr91307.patch gcc9-pr91763.patch gcc9-reproducible-builds-buildid-for-checksum.patch gcc9-reproducible-builds.patch gcc9-rpmlintrc gcc9-testresults-rpmlintrc gcc9-testresults.changes gcc9-testresults.spec gcc9-value-prof.patch gcc9.changes gcc9.spec newlib-3.1.0.tar.xz pre_checkin.sh tls-no-direct.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cross-nvptx-gcc9.spec ++++++ ++++ 826 lines (skipped) gcc9-testresults.spec: same change gcc9.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">22</size> </disk> <memory> <size unit="G">8</size> </memory> <processors>4</processors> </hardware> <overwrite> <conditions> <arch>x86_64</arch> <arch>ppc64le</arch> <arch>aarch64</arch> <package>gcc9</package> <package>gcc9-testresults</package> </conditions> <hardware> <disk> <size unit="G">30</size> </disk> <memory> <size unit="G">9</size> </memory> <processors>8</processors> <jobs>8</jobs> </hardware> </overwrite> </constraints> ++++++ change_spec ++++++ #!/bin/bash do_crosses=0 do_optional_compiler_languages=1 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 1 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_cross cross-riscv64-gcc$base_ver riscv64 riscv64-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-nds32le-gcc$base_ver nds32le nds32le-elf add_newlib_cross cross-riscv64-elf-gcc$base_ver riscv64 riscv64-elf #add_newlib_cross cross-rl78-gcc$base_ver rl78 rl78-elf add_newlib_cross cross-rx-gcc$base_ver rx rx-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 # In the staging/ring projects, we don't want to build the cross-* packages, but by default, we do: %bcond_with ringdisabled %if %{with ringdisabled} ExclusiveArch: do-not-build %endif %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 build_d 0 %define enable_plugins 0 %define use_lto_bootstrap 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}" == "riscv64-elf" %define binutils_target riscv64 %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 BuildRequires: isl-devel %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 riscv64 %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 %if 0%{?gcc_icecream:1} # so expect the sysroot to be populated from natively built binaries %else %if 0%{!?gcc_libc_bootstrap:1} # 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 ++++++ ++++ 2531 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 ++++++ ++++ 706 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-9.mo; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc-9.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-9", LOCALEDIR); + (void) textdomain ("gcc-9"); /* 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 = -9 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.orig 2019-10-07 18:32:31.000000000 +0200 +++ configure.ac 2019-10-07 18:34:36.000000000 +0200 @@ -1542,7 +1542,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.orig 2019-10-07 18:32:31.000000000 +0200 +++ configure 2019-10-07 18:34:36.000000000 +0200 @@ -5692,7 +5692,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.orig 2019-09-03 09:48:46.000000000 +0200 +++ gcc/fortran/simplify.c 2019-10-07 18:36:00.000000000 +0200 @@ -1791,51 +1791,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. */ @@ -1849,12 +1804,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. */ @@ -1862,21 +1812,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; } @@ -1886,21 +1824,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; } @@ -5878,9 +5804,7 @@ gfc_simplify_mod (gfc_expr *a, gfc_expr mpz_tdiv_r (result->value.integer, a->value.integer, p->value.integer); else { - gfc_set_model_kind (kind); - mpfr_fmod (result->value.real, a->value.real, p->value.real, - GFC_RND_MODE); + return NULL; } return range_check (result, "MOD"); @@ -5930,18 +5854,7 @@ gfc_simplify_modulo (gfc_expr *a, gfc_ex mpz_fdiv_r (result->value.integer, a->value.integer, p->value.integer); else { - 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); + return NULL; } return range_check (result, "MODULO"); Index: gcc/ubsan.c =================================================================== --- gcc/ubsan.c.orig 2019-01-31 14:22:44.000000000 +0100 +++ gcc/ubsan.c 2019-10-07 18:34:36.000000000 +0200 @@ -1847,40 +1847,6 @@ ubsan_instrument_float_cast (location_t 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.orig 2019-10-07 18:32:31.000000000 +0200 +++ gcc/gimple-ssa-sprintf.c 2019-10-07 18:34:36.000000000 +0200 @@ -1580,18 +1580,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 ++++++ gcc7-avoid-fixinc-error.diff ++++++ Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 255776) +++ gcc/Makefile.in (working copy) @@ -3066,13 +3066,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 ${BUILD_SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${BUILD_SYSTEM_HEADER_DIR}" >&2 ; \ - tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \ - if test "x${BUILD_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-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 ++++++ gcc9-add-flto=auto.patch ++++++ # The patch is master backport of the following patches: # - f12fbeb535f192f742025cc4f9b69a48136730f1 # - e63ca5570db076ec7b7bdfa55d51ef6f654d9412 # - d25b1154d110c5403525b66fa54c5aefddd50de7 # - 907e3499443d0e441fcb3b7575d6432598413bff # - 567ef43c98f6783dde4290467476f8de389c3c10 # - 267389902a985871dd172ab5c5b651f0cd082290 # - 5aa3a1348175aff8d670cb9d0fb5f28444e84aa5 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6ef36ce02aa..83d384f1933 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10327,7 +10327,7 @@ If you specify the optional @var{n}, the optimization and code generation done at link time is executed in parallel using @var{n} parallel jobs by utilizing an installed @command{make} program. The environment variable @env{MAKE} may be used to override the program -used. The default value for @var{n} is 1. +used. You can also specify @option{-flto=jobserver} to use GNU make's job server mode to determine the number of parallel jobs. This @@ -10336,6 +10336,10 @@ You must prepend a @samp{+} to the command recipe in the parent Makefile for this to work. This option likely only works if @env{MAKE} is GNU make. +Use @option{-flto=auto} to use GNU make's job server, if available, +or otherwise fall back to autodetection of the number of CPU threads +present in your system. + @item -flto-partition=@var{alg} @opindex flto-partition Specify the partitioning algorithm used by the link-time optimizer. diff --git a/gcc/gcc.c b/gcc/gcc.c index 4f57765b012..69fab920938 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -8261,6 +8261,8 @@ driver::maybe_run_linker (const char *argv0) const { int tmp = execution_count; + detect_jobserver (); + if (! have_c) { #if HAVE_LTO_PLUGIN > 0 @@ -8350,6 +8352,46 @@ driver::final_actions () const } } +/* Detect whether jobserver is active and working. If not drop + --jobserver-auth from MAKEFLAGS. */ + +void +driver::detect_jobserver () const +{ + /* Detect jobserver and drop it if it's not working. */ + const char *makeflags = env.get ("MAKEFLAGS"); + if (makeflags != NULL) + { + const char *needle = "--jobserver-auth="; + const char *n = strstr (makeflags, needle); + if (n != NULL) + { + int rfd = -1; + int wfd = -1; + + bool jobserver + = (sscanf (n + strlen (needle), "%d,%d", &rfd, &wfd) == 2 + && rfd > 0 + && wfd > 0 + && is_valid_fd (rfd) + && is_valid_fd (wfd)); + + /* Drop the jobserver if it's not working now. */ + if (!jobserver) + { + unsigned offset = n - makeflags; + char *dup = xstrdup (makeflags); + dup[offset] = '\0'; + + const char *space = strchr (makeflags + offset, ' '); + if (space != NULL) + strcpy (dup + offset, space); + xputenv (concat ("MAKEFLAGS=", dup, NULL)); + } + } + } +} + /* Determine what the exit code of the driver should be. */ int diff --git a/gcc/gcc.h b/gcc/gcc.h index a0a1d94c6e6..dc77dba67fb 100644 --- a/gcc/gcc.h +++ b/gcc/gcc.h @@ -51,6 +51,7 @@ class driver void do_spec_on_infiles () const; void maybe_run_linker (const char *argv0) const; void final_actions () const; + void detect_jobserver () const; int get_exit_code () const; private: diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index ac971494054..7116fdd1873 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1109,6 +1109,136 @@ cmp_priority (const void *a, const void *b) return *((const int *)b)-*((const int *)a); } +/* Number of CPUs that can be used for parallel LTRANS phase. */ + +static unsigned long nthreads_var = 0; + +#ifdef HAVE_PTHREAD_AFFINITY_NP +unsigned long cpuset_size; +static unsigned long get_cpuset_size; +cpu_set_t *cpusetp; + +unsigned long +static cpuset_popcount (unsigned long cpusetsize, cpu_set_t *cpusetp) +{ +#ifdef CPU_COUNT_S + /* glibc 2.7 and above provide a macro for this. */ + return CPU_COUNT_S (cpusetsize, cpusetp); +#else +#ifdef CPU_COUNT + if (cpusetsize == sizeof (cpu_set_t)) + /* glibc 2.6 and above provide a macro for this. */ + return CPU_COUNT (cpusetp); +#endif + size_t i; + unsigned long ret = 0; + STATIC_ASSERT (sizeof (cpusetp->__bits[0]) == sizeof (unsigned long int)); + for (i = 0; i < cpusetsize / sizeof (cpusetp->__bits[0]); i++) + { + unsigned long int mask = cpusetp->__bits[i]; + if (mask == 0) + continue; + ret += __builtin_popcountl (mask); + } + return ret; +#endif +} +#endif + +/* At startup, determine the default number of threads. It would seem + this should be related to the number of cpus online. */ + +static void +init_num_threads (void) +{ +#ifdef HAVE_PTHREAD_AFFINITY_NP +#if defined (_SC_NPROCESSORS_CONF) && defined (CPU_ALLOC_SIZE) + cpuset_size = sysconf (_SC_NPROCESSORS_CONF); + cpuset_size = CPU_ALLOC_SIZE (cpuset_size); +#else + cpuset_size = sizeof (cpu_set_t); +#endif + + cpusetp = (cpu_set_t *) xmalloc (gomp_cpuset_size); + do + { + int ret = pthread_getaffinity_np (pthread_self (), gomp_cpuset_size, + cpusetp); + if (ret == 0) + { + /* Count only the CPUs this process can use. */ + nthreads_var = cpuset_popcount (cpuset_size, cpusetp); + if (nthreads_var == 0) + break; + get_cpuset_size = cpuset_size; +#ifdef CPU_ALLOC_SIZE + unsigned long i; + for (i = cpuset_size * 8; i; i--) + if (CPU_ISSET_S (i - 1, cpuset_size, cpusetp)) + break; + cpuset_size = CPU_ALLOC_SIZE (i); +#endif + return; + } + if (ret != EINVAL) + break; +#ifdef CPU_ALLOC_SIZE + if (cpuset_size < sizeof (cpu_set_t)) + cpuset_size = sizeof (cpu_set_t); + else + cpuset_size = cpuset_size * 2; + if (cpuset_size < 8 * sizeof (cpu_set_t)) + cpusetp + = (cpu_set_t *) realloc (cpusetp, cpuset_size); + else + { + /* Avoid fatal if too large memory allocation would be + requested, e.g. kernel returning EINVAL all the time. */ + void *p = realloc (cpusetp, cpuset_size); + if (p == NULL) + break; + cpusetp = (cpu_set_t *) p; + } +#else + break; +#endif + } + while (1); + cpuset_size = 0; + nthreads_var = 1; + free (cpusetp); + cpusetp = NULL; +#endif +#ifdef _SC_NPROCESSORS_ONLN + nthreads_var = sysconf (_SC_NPROCESSORS_ONLN); +#endif +} + +/* FIXME: once using -std=c11, we can use std::thread::hardware_concurrency. */ + +/* Return true when a jobserver is running and can accept a job. */ + +static bool +jobserver_active_p (void) +{ + const char *makeflags = getenv ("MAKEFLAGS"); + if (makeflags == NULL) + return false; + + const char *needle = "--jobserver-auth="; + const char *n = strstr (makeflags, needle); + if (n == NULL) + return false; + + int rfd = -1; + int wfd = -1; + + return (sscanf (n + strlen (needle), "%d,%d", &rfd, &wfd) == 2 + && rfd > 0 + && wfd > 0 + && is_valid_fd (rfd) + && is_valid_fd (wfd)); +} /* Execute gcc. ARGC is the number of arguments. ARGV contains the arguments. */ @@ -1123,6 +1253,7 @@ run_gcc (unsigned argc, char *argv[]) const char *collect_gcc, *collect_gcc_options; int parallel = 0; int jobserver = 0; + int auto_parallel = 0; bool no_partition = false; struct cl_decoded_option *fdecoded_options = NULL; struct cl_decoded_option *offload_fdecoded_options = NULL; @@ -1247,8 +1378,13 @@ run_gcc (unsigned argc, char *argv[]) case OPT_flto_: if (strcmp (option->arg, "jobserver") == 0) { + parallel = 1; jobserver = 1; + } + else if (strcmp (option->arg, "auto") == 0) + { parallel = 1; + auto_parallel = 1; } else { @@ -1290,8 +1426,14 @@ run_gcc (unsigned argc, char *argv[]) { lto_mode = LTO_MODE_LTO; jobserver = 0; + auto_parallel = 0; parallel = 0; } + else if (!jobserver && auto_parallel && jobserver_active_p ()) + { + parallel = 1; + jobserver = 1; + } if (linker_output) { @@ -1483,7 +1625,21 @@ cont1: strcpy (tmp, ltrans_output_file); if (jobserver) - obstack_ptr_grow (&argv_obstack, xstrdup ("-fwpa=jobserver")); + { + if (verbose) + fprintf (stderr, "Using make jobserver\n"); + obstack_ptr_grow (&argv_obstack, xstrdup ("-fwpa=jobserver")); + } + else if (auto_parallel) + { + char buf[256]; + init_num_threads (); + if (verbose) + fprintf (stderr, "LTO parallelism level set to %ld\n", + nthreads_var); + sprintf (buf, "-fwpa=%ld", nthreads_var); + obstack_ptr_grow (&argv_obstack, xstrdup (buf)); + } else if (parallel > 1) { char buf[256]; @@ -1691,7 +1847,8 @@ cont: i = 3; if (!jobserver) { - snprintf (jobs, 31, "-j%d", parallel); + snprintf (jobs, 31, "-j%ld", + auto_parallel ? nthreads_var : parallel); new_argv[i++] = jobs; } new_argv[i++] = "all"; diff --git a/gcc/opts.c b/gcc/opts.c index 6164d49fa08..80dc04cedaf 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -2738,6 +2738,15 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_lto = value ? "" : NULL; break; + case OPT_flto_: + if (strcmp (arg, "none") != 0 + && strcmp (arg, "jobserver") != 0 + && strcmp (arg, "auto") != 0 + && atoi (arg) == 0) + error_at (loc, + "unrecognized argument to %<-flto=%> option: %qs", arg); + break; + case OPT_w: dc->dc_inhibit_warnings = true; break; diff --git a/gcc/testsuite/g++.dg/lto/devirt-19_0.C b/gcc/testsuite/g++.dg/lto/devirt-19_0.C index 696d8c0fc83..b43527e324e 100644 --- a/gcc/testsuite/g++.dg/lto/devirt-19_0.C +++ b/gcc/testsuite/g++.dg/lto/devirt-19_0.C @@ -1,5 +1,5 @@ /* { dg-lto-do link } */ /* { dg-lto-options { "-O2 -fdump-ipa-cp -Wno-return-type -flto -r -nostdlib" } } */ -/* { dg-extra-ld-options "-flinker-output=nolto-rel" } */ +/* { dg-extra-ld-options "-flinker-output=nolto-rel -flto=auto" } */ #include "../ipa/devirt-19.C" /* { dg-final { scan-wpa-ipa-dump-times "Discovered a virtual call to a known target" 1 "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/spellcheck-options-21.c b/gcc/testsuite/gcc.dg/spellcheck-options-21.c new file mode 100644 index 00000000000..3e0e8a8ebaf --- /dev/null +++ b/gcc/testsuite/gcc.dg/spellcheck-options-21.c @@ -0,0 +1,3 @@ +/* { dg-do compile } */ +/* { dg-options "-flto=sparta" } */ +/* { dg-error "unrecognized argument to '-flto=' option: 'sparta'" "" { target *-*-* } 0 } */ diff --git a/include/libiberty.h b/include/libiberty.h index 57476135026..70e8c9e1076 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -137,6 +137,10 @@ extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRI extern char *lrealpath (const char *); +/* Return true when FD file descriptor exists. */ + +extern int is_valid_fd (int fd); + /* Concatenate an arbitrary number of strings. You must pass NULL as the last argument of this function, to terminate the list of strings. Allocates memory using xmalloc. */ diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 0be45b4ae8e..f1628d4ee0d 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -127,7 +127,7 @@ CFILES = alloca.c argv.c asprintf.c atexit.c \ calloc.c choose-temp.c clock.c concat.c cp-demangle.c \ cp-demint.c cplus-dem.c crc32.c \ d-demangle.c dwarfnames.c dyn-string.c \ - fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \ + fdmatch.c ffs.c fibheap.c filedescriptor.c filename_cmp.c floatformat.c \ fnmatch.c fopen_unlocked.c \ getcwd.c getopt.c getopt1.c getpagesize.c getpwd.c getruntime.c \ gettimeofday.c \ @@ -171,6 +171,7 @@ REQUIRED_OFILES = \ ./cp-demint.$(objext) ./crc32.$(objext) ./d-demangle.$(objext) \ ./dwarfnames.$(objext) ./dyn-string.$(objext) \ ./fdmatch.$(objext) ./fibheap.$(objext) \ + ./filedescriptor.$(objext) \ ./filename_cmp.$(objext) ./floatformat.$(objext) \ ./fnmatch.$(objext) ./fopen_unlocked.$(objext) \ ./getopt.$(objext) ./getopt1.$(objext) ./getpwd.$(objext) \ @@ -756,6 +757,17 @@ $(CONFIGURED_OFILES): stamp-picdir stamp-noasandir else true; fi $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION) +./filedescriptor.$(objext): $(srcdir)/filedescriptor.c config.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/libiberty.h + if [ x"$(PICFLAG)" != x ]; then \ + $(COMPILE.c) $(PICFLAG) $(srcdir)/filedescriptor.c -o pic/$@; \ + else true; fi + if [ x"$(NOASANFLAG)" != x ]; then \ + $(COMPILE.c) $(PICFLAG) $(NOASANFLAG) $(srcdir)/filedescriptor.c -o noasan/$@; \ + else true; fi + $(COMPILE.c) $(srcdir)/filedescriptor.c $(OUTPUT_OPTION) + + ./filename_cmp.$(objext): $(srcdir)/filename_cmp.c config.h $(INCDIR)/ansidecl.h \ $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ $(INCDIR)/safe-ctype.h diff --git a/libiberty/filedescriptor.c b/libiberty/filedescriptor.c new file mode 100644 index 00000000000..3a1a68d1eef --- /dev/null +++ b/libiberty/filedescriptor.c @@ -0,0 +1,47 @@ +/* File descriptor related functions. + + Copyright (C) 2019 Free Software Foundation, Inc. + + This file is part of the libiberty library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ + +#include "config.h" +#include "ansidecl.h" +#include "libiberty.h" + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#if defined (_WIN32) +#define WIN32_LEAN_AND_MEAN +#include <windows.h> /* for GetFullPathName */ +#endif +/* Return true when FD file descriptor exists. */ + +int +is_valid_fd (int fd) +{ +#if defined(_WIN32) + HANDLE h = (HANDLE) _get_osfhandle (fd); + return h != (HANDLE) -1; +#elif defined(F_GETFD) + return fcntl (fd, F_GETFD) >= 0; +#else + return dup2 (fd, fd) < 0; +#endif +} ++++++ gcc9-autodetect-g-at-lto-link.patch ++++++ Backport of r275640. 2019-09-11 Richard Biener <[email protected]> * lto-opts.c (lto_write_options): Stream -g when debug is enabled. * lto-wrapper.c (merge_and_complain): Pick up -g. (append_compiler_options): Likewise. (run_gcc): Re-instantiate handling -g0 at link-time. * doc/invoke.texi (flto): Document debug info generation. Index: gcc/lto-opts.c =================================================================== --- gcc/lto-opts.c (revision 275454) +++ gcc/lto-opts.c (working copy) @@ -94,6 +94,10 @@ lto_write_options (void) : "-fno-pie"); } + /* If debug info is enabled append -g. */ + if (debug_info_level > DINFO_LEVEL_NONE) + append_to_collect_gcc_options (&temporary_obstack, &first_p, "-g"); + /* Append options from target hook and store them to offload_lto section. */ if (lto_stream_offload_p) { Index: gcc/lto-wrapper.c =================================================================== --- gcc/lto-wrapper.c (revision 275454) +++ gcc/lto-wrapper.c (working copy) @@ -265,6 +265,7 @@ merge_and_complain (struct cl_decoded_op case OPT_fshow_column: case OPT_fcommon: case OPT_fgnu_tm: + case OPT_g: /* Do what the old LTO code did - collect exactly one option setting per OPT code, we pick the first we encounter. ??? This doesn't make too much sense, but when it doesn't @@ -617,6 +618,7 @@ append_compiler_options (obstack *argv_o case OPT_fopenacc: case OPT_fopenacc_dim_: case OPT_foffload_abi_: + case OPT_g: case OPT_O: case OPT_Ofast: case OPT_Og: @@ -1399,6 +1401,10 @@ run_gcc (unsigned argc, char *argv[]) linker_output_rel = !strcmp (option->arg, "rel"); break; + case OPT_g: + /* Recognize -g0. */ + skip_debug = option->arg && !strcmp (option->arg, "0"); + break; default: break; Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 275454) +++ gcc/doc/invoke.texi (working copy) @@ -10335,6 +10335,14 @@ conflicting translation units. Specific precedence; and for example @option{-ffp-contract=off} takes precedence over @option{-ffp-contract=fast}. You can override them at link time. +To enable debug info generation you need to supply @option{-g} at +compile-time. If any of the input files at link time were built +with debug info generation enabled the link will enable debug info +generation as well. Any elaborate debug info settings +like the dwarf level @option{-gdwarf-5} need to be explicitely repeated +at the linker command line and mixing different settings in different +translation units is discouraged. + If LTO encounters objects with C linkage declared with incompatible types in separate translation units to be linked together (undefined behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be ++++++ gcc9-pr91307.patch ++++++ 2019-08-20 Richard Biener <[email protected]> PR lto/91307 * ipa.c (cgraph_build_static_cdtor_1): Use names not recognizable by collect2 when targetm.have_ctors_dtors which avoids dragging in temporary filenames from LTO input objects. Index: gcc/ipa.c =================================================================== --- gcc/ipa.c (revision 274536) +++ gcc/ipa.c (working copy) @@ -836,13 +836,18 @@ cgraph_build_static_cdtor_1 (char which, /* The priority is encoded in the constructor or destructor name. collect2 will sort the names and arrange that they are called at program startup. */ - if (final) - sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++); + if (!targetm.have_ctors_dtors && final) + { + sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++); + name = get_file_function_name (which_buf); + } else - /* Proudce sane name but one not recognizable by collect2, just for the - case we fail to inline the function. */ - sprintf (which_buf, "sub_%c_%.5d_%d", which, priority, counter++); - name = get_file_function_name (which_buf); + { + /* Proudce sane name but one not recognizable by collect2, just for the + case we fail to inline the function. */ + sprintf (which_buf, "_sub_%c_%.5d_%d", which, priority, counter++); + name = get_identifier (which_buf); + } decl = build_decl (input_location, FUNCTION_DECL, name, build_function_type_list (void_type_node, NULL_TREE)); ++++++ gcc9-pr91763.patch ++++++ 2019-09-18 Richard Biener <[email protected]> PR lto/91763 * lto-streamer-in.c (input_eh_regions): Move EH init to lto_materialize_function. * tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): Likewise. lto/ * lto.c (lto_materialize_function): Initialize EH by looking at the function personality and flag_exceptions setting. Index: gcc/lto-streamer-in.c =================================================================== --- gcc/lto-streamer-in.c (revision 275800) +++ gcc/lto-streamer-in.c (working copy) @@ -615,11 +615,6 @@ input_eh_regions (struct lto_input_block lto_tag_check_range (tag, LTO_eh_table, LTO_eh_table); - /* If the file contains EH regions, then it was compiled with - -fexceptions. In that case, initialize the backend EH - machinery. */ - lto_init_eh (); - gcc_assert (fn->eh); root_region = streamer_read_hwi (ib); Index: gcc/tree-streamer-in.c =================================================================== --- gcc/tree-streamer-in.c (revision 275800) +++ gcc/tree-streamer-in.c (working copy) @@ -800,12 +800,6 @@ lto_input_ts_function_decl_tree_pointers } } #endif - - /* If the file contains a function with an EH personality set, - then it was compiled with -fexceptions. In that case, initialize - the backend EH machinery. */ - if (DECL_FUNCTION_PERSONALITY (expr)) - lto_init_eh (); } Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 275800) +++ gcc/lto/lto.c (working copy) @@ -218,6 +218,12 @@ lto_materialize_function (struct cgraph_ return; if (DECL_FUNCTION_PERSONALITY (decl) && !first_personality_decl) first_personality_decl = DECL_FUNCTION_PERSONALITY (decl); + /* If the file contains a function with a language specific EH + personality set or with EH enabled initialize the backend EH + machinery. */ + if (DECL_FUNCTION_PERSONALITY (decl) + || opt_for_fn (decl, flag_exceptions)) + lto_init_eh (); } /* Let the middle end know about the function. */ ++++++ gcc9-reproducible-builds-buildid-for-checksum.patch ++++++ Use the binaries build-id as checksum for PCH purposes. Index: gcc/c-family/c-pch.c =================================================================== --- gcc/c-family/c-pch.c (revision 269204) +++ gcc/c-family/c-pch.c (working copy) @@ -69,6 +65,66 @@ static FILE *pch_outfile; static const char *get_ident (void); +#if _GNU_SOURCE +#include <link.h> + +#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1)) + +static int +get_build_id_1 (struct dl_phdr_info *info, size_t, void *data) +{ + for (unsigned i = 0; i < info->dlpi_phnum; ++i) + { + if (info->dlpi_phdr[i].p_type != PT_NOTE) + continue; + ElfW(Nhdr) *nhdr + = (ElfW(Nhdr) *)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr); + ptrdiff_t size = info->dlpi_phdr[i].p_filesz; + ptrdiff_t align = info->dlpi_phdr[i].p_align; + if (align != 8) + align = 4; + while (size >= (ptrdiff_t)sizeof (ElfW(Nhdr))) + { + if (nhdr->n_type == NT_GNU_BUILD_ID + && nhdr->n_namesz == 4 + && strncmp ((char *)nhdr + + sizeof (ElfW(Nhdr)), + "GNU", 4) == 0 + && nhdr->n_descsz >= 16) + { + memcpy (data, + (char *)nhdr + + ALIGN (sizeof (ElfW(Nhdr)) + + nhdr->n_namesz, align), 16); + return 1; + } + size_t offset = (ALIGN (sizeof (ElfW(Nhdr)) + + nhdr->n_namesz, align) + + ALIGN(nhdr->n_descsz, align)); + nhdr = (ElfW(Nhdr) *)((char *)nhdr + offset); + size -= offset; + } + } + + return 0; +} + +static const unsigned char * +get_build_id () +{ + static unsigned char build_id[16]; + if (!dl_iterate_phdr (get_build_id_1, build_id)) + return NULL; + return build_id; +} +#else +static const unsigned char * +get_build_id () +{ + return NULL; +} +#endif + /* Compute an appropriate 8-byte magic number for the PCH file, so that utilities like file(1) can identify it, and so that GCC can quickly ignore non-PCH files and PCH files that are of a completely different @@ -126,8 +180,11 @@ pch_init (void) v.pch_init = &pch_init; target_validity = targetm.get_pch_validity (&v.target_data_length); + const unsigned char *chksum = get_build_id (); + if (!chksum) + chksum = executable_checksum; if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1 - || fwrite (executable_checksum, 16, 1, f) != 1 + || fwrite (chksum, 16, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 || fwrite (target_validity, v.target_data_length, 1, f) != 1) fatal_error (input_location, "can%'t write to %s: %m", pch_file); @@ -245,7 +300,10 @@ c_common_valid_pch (cpp_reader *pfile, c } return 2; } - if (memcmp (ident + IDENT_LENGTH, executable_checksum, 16) != 0) + const unsigned char *chksum = get_build_id (); + if (!chksum) + chksum = executable_checksum; + if (memcmp (ident + IDENT_LENGTH, chksum, 16) != 0) { if (cpp_get_options (pfile)->warn_invalid_pch) cpp_error (pfile, CPP_DL_WARNING, Index: gcc/genchecksum.c =================================================================== --- gcc/genchecksum.c (revision 269204) +++ gcc/genchecksum.c (working copy) @@ -113,8 +113,13 @@ main (int argc, char ** argv) puts ("#include \"config.h\""); puts ("#include \"system.h\""); fputs ("EXPORTED_CONST unsigned char executable_checksum[16] = { ", stdout); +#if _GNU_SOURCE + for (i = 0; i < 16; i++) + printf ("0x%02x%s", 0, i == 15 ? " };\n" : ", "); +#else for (i = 0; i < 16; i++) printf ("0x%02x%s", result[i], i == 15 ? " };\n" : ", "); +#endif return 0; } ++++++ gcc9-reproducible-builds.patch ++++++ Avoid leaking current data on generated file for Ada. Index: gcc/ada/gcc-interface/Makefile.in =================================================================== --- gcc/ada/gcc-interface/Makefile.in (revision 268977) +++ gcc/ada/gcc-interface/Makefile.in (working copy) @@ -2407,6 +2407,7 @@ $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib $(OSCONS_CPP) ; \ $(OSCONS_EXTRACT) ; \ ../bldtools/oscons/xoscons s-oscons) + touch -r $(fsrcpfx)ada/gsocket.h $@ gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads test -f $(RTSDIR)/s-oscons.ads || exit 1 ++++++ gcc9-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") ++++++ gcc9-testresults-rpmlintrc ++++++ # This line is mandatory to access the configuration functions from Config import * # Currently gotools.log contains $RPM_BUILD_ROOT and there's nothing # to be done about that and neither do we care addFilter ("gcc.*-testresults.*file-contains-buildroot") # The package should _not_ be noarch, testresults differ from architecture # to architecture addFilter ("gcc.*-testresults.*no-binary") ++++++ gcc9-value-prof.patch ++++++ ++++ 1298 lines (skipped) ++++++ 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
