From 1ec95799a02d246220b80496fa8afe401acaf655 Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Tue, 19 May 2026 18:31:50 -0400 Subject: [PATCH] import UBI gcc-14.3.1-4.4.el10 --- .gitignore | 2 +- gcc.spec | 1032 +++++++++++++++++++++- gcc14-gcov-function-summaries.patch | 142 +++ gcc14-tests-color.patch | 107 +++ gcc14-tests-dg-regexp.patch | 40 + gcc14-tests-env-native.patch | 26 + gcc14-tests-gcov-native.patch | 922 +++++++++++++++++++ gcc14-tests-guality-native.patch | 232 +++++ gcc14-tests-installed-plugin.patch | 229 +++++ gcc14-tests-installed-site-exp.patch | 92 ++ gcc14-tests-installed-target.patch | 54 ++ gcc14-tests-misc-native.patch | 69 ++ gcc14-tests-simulate-thread-native.patch | 115 +++ gcc14-tests-ssp-native.patch | 55 ++ gcc14-tests-tree-prof-native.patch | 63 ++ sources | 2 +- 16 files changed, 3161 insertions(+), 21 deletions(-) create mode 100644 gcc14-gcov-function-summaries.patch create mode 100644 gcc14-tests-color.patch create mode 100644 gcc14-tests-dg-regexp.patch create mode 100644 gcc14-tests-env-native.patch create mode 100644 gcc14-tests-gcov-native.patch create mode 100644 gcc14-tests-guality-native.patch create mode 100644 gcc14-tests-installed-plugin.patch create mode 100644 gcc14-tests-installed-site-exp.patch create mode 100644 gcc14-tests-installed-target.patch create mode 100644 gcc14-tests-misc-native.patch create mode 100644 gcc14-tests-simulate-thread-native.patch create mode 100644 gcc14-tests-ssp-native.patch create mode 100644 gcc14-tests-tree-prof-native.patch diff --git a/.gitignore b/.gitignore index b13e880..bf84ed9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -gcc-14.3.1-20250617.tar.xz +gcc-14.3.1-20251022.tar.xz isl-0.24.tar.bz2 newlib-cygwin-d45261f62a15f8abd94a1031020b9a9f455e4eed.tar.xz nvptx-tools-87ce9dc5999e5fca2e1d3478a30888d9864c9804.tar.xz diff --git a/gcc.spec b/gcc.spec index 20000d8..605c4ec 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,10 +1,10 @@ -%global DATE 20250617 -%global gitrev 74a421064f3d0de5d604bc051d9c21c1b9763064 +%global DATE 20251022 +%global gitrev 7cb09bad6a2ef6c95cdcb57821f7f01f477c5437 %global gcc_version 14.3.1 %global gcc_major 14 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 2 +%global gcc_release 4 %global nvptx_tools_gitrev 87ce9dc5999e5fca2e1d3478a30888d9864c9804 %global newlib_cygwin_gitrev d45261f62a15f8abd94a1031020b9a9f455e4eed %global _unpackaged_files_terminate_build 0 @@ -140,10 +140,33 @@ %else %global build_annobin_plugin 0 %endif +%if 0%{?rhel} == 10 +%ifarch x86_64 +%global build_cross 1 +%else +%global build_cross 0 +%endif +%else +%dnl rhel != 10 +%global build_cross 0 +%endif +%global cross_targets aarch64-redhat-linux ppc64le-redhat-linux s390x-redhat-linux +# sysroot package support (taken from that for glibc). These contain +# arch-specific packages, so turn off the rpmbuild check. +%global _binaries_in_noarch_packages_terminate_build 0 +# Variant of %%dist that contains just the distribution release, no affixes. +%{?fedora:%global sysroot_dist fc%{fedora}} +%{?rhel:%global sysroot_dist el%{rhel}} +%{?!sysroot_dist:%global sysroot_dist root} +# The name of the sysroot package (suffixed with a library name). +%global sysroot_package_arch sysroot-%{_arch}-%{sysroot_dist} +# Installed path for the sysroot tree. Must contain /sys-root/, which +# triggers filtering. +%global sysroot_prefix /usr/%{_arch}-redhat-linux/sys-root/%{sysroot_dist} Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.1%{?dist} +Release: %{gcc_release}.4%{?dist} # License notes for some of the less obvious ones: # gcc/doc/cppinternals.texi: Linux-man-pages-copyleft-2-para # isl: MIT, BSD-2-Clause @@ -314,6 +337,23 @@ Patch100: gcc14-fortran-fdec-duplicates.patch Patch1000: gcc14-libstdc++-prettyprinter-update-15.patch Patch1001: gcc14-libstdc++-prettyprinter-update-15-tests.patch +# Backports +Patch2000: gcc14-gcov-function-summaries.patch + +# Improvements for installed / cross testing and results comparison +Patch3000: gcc14-tests-dg-regexp.patch +Patch3001: gcc14-tests-installed-site-exp.patch +Patch3002: gcc14-tests-installed-target.patch +Patch3003: gcc14-tests-installed-plugin.patch +Patch3004: gcc14-tests-ssp-native.patch +Patch3005: gcc14-tests-guality-native.patch +Patch3006: gcc14-tests-simulate-thread-native.patch +Patch3007: gcc14-tests-gcov-native.patch +Patch3008: gcc14-tests-misc-native.patch +Patch3009: gcc14-tests-tree-prof-native.patch +Patch3010: gcc14-tests-color.patch +Patch3011: gcc14-tests-env-native.patch + # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. %ifnarch %{arm} @@ -890,6 +930,249 @@ This package adds a version of the annobin plugin for gcc. This version of the plugin is explicitly built by the same version of gcc that is installed so that there cannot be any synchronization problems. +%package -n cross-gcc-aarch64 +Summary: Cross targeted AArch64 gcc for developer use. Not intended for production. +Provides: cross-gcc-aarch64 = %{version}-%{release} +%if %{build_cross} +Requires: cross-binutils-aarch64 >= 2.41 +BuildRequires: sysroot-aarch64-el10-glibc >= 2.39 +BuildRequires: cross-binutils-aarch64 >= 2.41 +%endif +# Don't provide e.g. liblto_plugin.so()(64bit). +AutoReqProv: no + +%description -n cross-gcc-aarch64 +This package contains a version of gcc that can compile code for AArch64 +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-c++-aarch64 +Summary: Cross targeted AArch64 gcc-c++ for developer use. Not intended for production. +Provides: cross-gcc-c++-aarch64 = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-aarch64 = %{version}-%{release} +BuildRequires: sysroot-aarch64-el10-glibc >= 2.39 +BuildRequires: cross-binutils-aarch64 >= 2.41 +%endif +# ??? Otherwise this subpackage couldn't be installed, depends on libm.so +# and libgcc_s.so +AutoReqProv: no + +%description -n cross-gcc-c++-aarch64 +This package contains a version of g++ that can compile code for AArch64 +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-plugin-aarch64 +Summary: Plugin headers for cross targeted AArch64 gcc for developer use. Not intended for production. +Provides: cross-gcc-plugin-aarch64 = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-aarch64 = %{version}-%{release} +BuildRequires: sysroot-aarch64-el10-glibc >= 2.39 +BuildRequires: cross-binutils-aarch64 >= 2.41 +%endif +AutoReqProv: no + +%description -n cross-gcc-plugin-aarch64 +This package contains header files and other support files for compiling GCC +plugins for use with the non-production AArch64 cross compiler. + +%package -n cross-gcc-ppc64le +Summary: Cross targeted PPC64le gcc for developer use. Not intended for production. +Provides: cross-gcc-ppc64le = %{version}-%{release} +%if %{build_cross} +Requires: cross-binutils-ppc64le >= 2.41 +BuildRequires: sysroot-ppc64le-el10-glibc >= 2.39 +BuildRequires: cross-binutils-ppc64le >= 2.41 +%endif +# Don't provide e.g. liblto_plugin.so()(64bit). +AutoReqProv: no + +%description -n cross-gcc-ppc64le +This package contains a version of gcc that can compile code for PPC64le +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-c++-ppc64le +Summary: Cross targeted PPC64le gcc-c++ for developer use. Not intended for production. +Provides: cross-gcc-c++-ppc64le = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-ppc64le = %{version}-%{release} +BuildRequires: sysroot-ppc64le-el10-glibc >= 2.39 +BuildRequires: cross-binutils-ppc64le >= 2.41 +%endif +# ??? Otherwise this subpackage couldn't be installed, depends on libm.so +# and libgcc_s.so +AutoReqProv: no + +%description -n cross-gcc-c++-ppc64le +This package contains a version of g++ that can compile code for PPC64le +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-plugin-ppc64le +Summary: Plugin headers for cross targeted PPC64le gcc for developer use. Not intended for production. +Provides: cross-gcc-plugin-ppc64le = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-ppc64le = %{version}-%{release} +BuildRequires: sysroot-ppc64le-el10-glibc >= 2.39 +BuildRequires: cross-binutils-ppc64le >= 2.41 +%endif +AutoReqProv: no + +%description -n cross-gcc-plugin-ppc64le +This package contains header files and other support files for compiling GCC +plugins for use with the non-production PPC64le cross compiler. + +%package -n cross-gcc-s390x +Summary: Cross targeted S/390 gcc for developer use. Not intended for production. +Provides: cross-gcc-s390x = %{version}-%{release} +%if %{build_cross} +Requires: cross-binutils-s390x >= 2.41 +BuildRequires: sysroot-s390x-el10-glibc >= 2.39 +BuildRequires: cross-binutils-s390x >= 2.41 +%endif +# Don't provide e.g. liblto_plugin.so()(64bit). +AutoReqProv: no + +%description -n cross-gcc-s390x +This package contains a version of gcc that can compile code for S/390 +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-c++-s390x +Summary: Cross targeted S/390 gcc-c++ for developer use. Not intended for production. +Provides: cross-gcc-c++-s390x = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-s390x = %{version}-%{release} +BuildRequires: sysroot-s390x-el10-glibc >= 2.39 +BuildRequires: cross-binutils-s390x >= 2.41 +%endif +# ??? Otherwise this subpackage couldn't be installed, depends on libm.so +# and libgcc_s.so +AutoReqProv: no + +%description -n cross-gcc-c++-s390x +This package contains a version of g++ that can compile code for S/390 +(cross compiler). This cross compiler is intended for developers to use +during application development. This cross compiler is not intended for +production use, and output binary artifacts should not be used in +production. Generated binary artifacts contain binary annotations that +mark them as cross compiled. + +%package -n cross-gcc-plugin-s390x +Summary: Plugin headers for cross targeted S/390 gcc for developer use. Not intended for production. +Provides: cross-gcc-plugin-s390x = %{version}-%{release} +%if %{build_cross} +Requires: cross-gcc-s390x = %{version}-%{release} +BuildRequires: sysroot-s390x-el10-glibc >= 2.39 +BuildRequires: cross-binutils-s390x >= 2.41 +%endif +AutoReqProv: no + +%description -n cross-gcc-plugin-s390x +This package contains header files and other support files for compiling GCC +plugins for use with the non-production S/390 cross compiler. + +%package -n %{sysroot_package_arch}-libgcc +Summary: Sysroot package for libgcc, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libgcc +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libgcc +This package contains development files for the libgcc package +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-libgomp +Summary: Sysroot package for libgomp, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libgomp +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libgomp +This package contains development files for the libgomp package +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-libstdc++ +Summary: Sysroot package for libstdc++, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libstdc++ +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libstdc++ +This package contains development files for the libstdc++ package +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-libatomic +Summary: Sysroot package for libatomic, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libatomic +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libatomic +This package contains development files for the libatomic package +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-libitm +Summary: Sysroot package for libitm, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libitm +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libitm +This package contains development files for the libitm package +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-libsanitizer +Summary: Sysroot package for sanitizer libraries, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-libsanitizer +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-libsanitizer +This package contains development files for the sanitizer library packages +that can be installed across architectures. + +%package -n %{sysroot_package_arch}-test-support +Summary: GCC testsuite support files, %{_arch} architecture +BuildArch: noarch +Provides: sysroot-%{_arch}-test-support +# The files are not usable for execution, so do not provide nor +# require anything. +AutoReqProv: no + +%description -n %{sysroot_package_arch}-test-support +This package contains files from the GCC build to support running the GCC +testsuites that can be installed across architectures. + %prep %setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 -a 3 %patch -P0 -p0 -b .hack~ @@ -921,13 +1204,30 @@ touch -r isl-0.24/m4/ax_prog_cxx_for_build.m4 isl-0.24/m4/ax_prog_cc_for_build.m %patch -P1000 -p1 -b .libstdc++-prettyprinter-update-15 %patch -P1001 -p1 -b .libstdc++-prettyprinter-update-15-tests +%patch -P2000 -p1 -b .gcov-function-summaries + +%patch -P3000 -p1 -b .gcc14-tests-dg-regexp +%patch -P3001 -p1 -b .gcc14-tests-installed-site-exp +%patch -P3002 -p1 -b .gcc14-tests-installed-target +%patch -P3003 -p1 -b .gcc14-tests-installed-plugin +%patch -P3004 -p1 -b .gcc14-tests-ssp-native +%patch -P3005 -p1 -b .gcc14-tests-guality-native +%patch -P3006 -p1 -b .gcc14-tests-simulate-thread-native +%patch -P3007 -p1 -b .gcc14-tests-gcov-native +%patch -P3008 -p1 -b .gcc14-tests-misc-native +%patch -P3009 -p1 -b .gcc14-tests-tree-prof-native +%patch -P3010 -p1 -b .gcc14-tests-color +%patch -P3011 -p1 -b .gcc14-tests-env-native + %ifarch %{arm} rm -f gcc/testsuite/go.test/test/fixedbugs/issue19182.go %endif rm -f libphobos/testsuite/libphobos.gc/forkgc2.d #rm -rf libphobos/testsuite/libphobos.gc -echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE +echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE.native +echo 'Red Hat %{version}-%{gcc_release} cross from %{_arch}' > gcc/DEV-PHASE.cross +cp -p gcc/DEV-PHASE{.native,} cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h @@ -1119,10 +1419,40 @@ offloadtgts=nvptx-none %if %{build_offload_amdgcn} offloadtgts=${offloadtgts:+${offloadtgts},}amdgcn-amdhsa %endif -CONFIGURE_OPTS="\ +# CONFIGURE_OPTS_BASE are the configure options common to the native and cross +# builds. E.g., --prefix. This cannot include arch-specific configure options. +# CONFIGURE_OPTS_NATIVE are the configure options used for the native build +# (that is, the regular non-cross build) and libgccjit. This includes arch-specific +# configure options (default -march and such). +# CONFIGURE_OPTS = CONFIGURE_OPTS_BASE + CONFIGURE_OPTS_NATIVE +# CONFIGURE_OPTS_CROSS are the configure options common to all the cross +# builds. E.g., only build C/C++. This shall not be used for the native build. +# Each cross compiler's configure options will be: +# CONFIGURE_OPTS_BASE + CONFIGURE_OPTS_CROSS + --target= + --with-sysroot= + +# It it very important that the arch-specific configure options used in +# CONFIGURE_OPTS_NATIVE are in lockstep with the +# used in the cross builds. +CONFIGURE_OPTS_BASE="\ --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ --with-bugurl=http://bugzilla.redhat.com/bugzilla \ --enable-shared --enable-threads=posix --enable-checking=release \ + --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ + --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \ + --enable-plugin --enable-initfini-array \ + --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \ +%if %{build_isl} + --with-isl=`pwd`/isl-install \ +%else + --without-isl \ +%endif +%if 0%{?rhel:1} + --enable-host-pie --enable-host-bind-now \ +%endif + " + +# NB: When updating CONFIGURE_OPTS_NATIVE, make sure to update the cross +# compiler options as well (look for CONFIGURE_OPTS_FOR_ARCH). +CONFIGURE_OPTS_NATIVE="\ %ifarch ppc64le --enable-targets=powerpcle-linux \ %endif @@ -1139,17 +1469,8 @@ CONFIGURE_OPTS="\ %else --enable-multilib \ %endif - --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ - --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \ - --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \ %ifnarch %{mips} --with-linker-hash-style=gnu \ -%endif - --enable-plugin --enable-initfini-array \ -%if %{build_isl} - --with-isl=`pwd`/isl-install \ -%else - --without-isl \ %endif %if %{build_offload_nvptx} || %{build_offload_amdgcn} --enable-offload-targets=$offloadtgts --enable-offload-defaulted \ @@ -1282,9 +1603,13 @@ CONFIGURE_OPTS="\ --with-build-config=bootstrap-lto --enable-link-serialization=1 \ %endif %endif -%if 0%{?rhel:1} - --enable-host-pie --enable-host-bind-now \ -%endif + " +CONFIGURE_OPTS="$CONFIGURE_OPTS_BASE $CONFIGURE_OPTS_NATIVE" + +CONFIGURE_OPTS_CROSS="\ + --enable-languages=c,c++ --disable-bootstrap \ + --host=%{gcc_target_platform} --build=%{gcc_target_platform} \ + --disable-multilib --disable-libstdcxx-pch --disable-libcc1 \ " CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ @@ -1326,6 +1651,55 @@ make jit.sphinx.html make jit.sphinx.install-html jit_htmldir=`pwd`/../../rpm.doc/libgccjit-devel/html cd .. +# Build cross compilers here. +%if %{build_cross} +echo ==================== BUILD CROSS ========================= +# Get out of obj-%{gcc_target_platform}. +pushd .. +for crossarch in %{cross_targets}; do + mkdir obj-$crossarch + cd obj-$crossarch + + case $crossarch in + aarch64*) + CONFIGURE_OPTS_FOR_ARCH="" + ;; + s390x*) + CONFIGURE_OPTS_FOR_ARCH="--with-arch=z14 --with-tune=z16" + ;; + ppc64le*) + CONFIGURE_OPTS_FOR_ARCH="--with-cpu-32=power9 --with-tune-32=power10 --with-cpu-64=power9 --with-tune-64=power10" + ;; + *) + echo >&2 "ERROR: unknown cross arch $crossarch" + exit 1 + ;; + esac + + # Temporarily replace DEV-PHASE. + cp -p ../gcc/DEV-PHASE{.cross,} + + CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ + CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \ + | sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \ + XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ + ../configure $CONFIGURE_OPTS_BASE $CONFIGURE_OPTS_CROSS \ + --with-sysroot=/usr/$crossarch/sys-root/el10/ \ + --with-gxx-include-dir="/usr/$crossarch/sys-root/el10/%{_prefix}/include/c++/%{gcc_major}" \ + --target=$crossarch \ + $CONFIGURE_OPTS_FOR_ARCH + make %{?_smp_mflags} LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now + + # Restore DEV-PHASE. + cp -p ../gcc/DEV-PHASE{.native,} + # Out of obj-$crossarch. + cd .. +done +# Go back to obj-%{gcc_target_platform}. +popd +echo ==================== BUILD CROSS END ========================= +%endif + %if %{build_isl} cp -a isl-install/lib/libisl.so.23 gcc/ %endif @@ -1523,6 +1897,230 @@ make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ chmod 644 %{buildroot}%{_infodir}/gnat* %endif +%if %{build_cross} +echo ==================== INSTALL CROSS ========================= +# Out of obj-%{gcc_target_platform}. +pushd .. +for crossarch in %{cross_targets}; do + cd obj-$crossarch + + CROSS_LIBPATH=%{buildroot}%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/ + + # Temporarily replace DEV-PHASE. + cp -p ../gcc/DEV-PHASE{.cross,} + + # --with-gxx-include-dir= doesn't prefix its argument with $(DESTDIR) + # and you can't install things into /usr unless you're root. + mkdir scratch + scratchdir=`pwd`/scratch + pushd $crossarch/libstdc++-v3 + for i in `find . -name Makefile`; do + cp -a $i $i.save + sed -i -e 's?^gxx_include_dir = .*$?gxx_include_dir = '$scratchdir'?' $i + touch -r $i.save $i + done + popd + + # Use -j1, because build-many-glibcs says: + # Parallel "make install" for GCC has race conditions that can + # cause it to fail; see + # . Such + # problems are not known for binutils, but doing the + # installation in parallel within a particular toolchain build + # (as opposed to installation of one toolchain from + # build-many-glibcs.py running in parallel to the installation + # of other toolchains being built) is not known to be + # significantly beneficial, so it is simplest just to disable + # parallel install for cross tools here. + make -j1 prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ + infodir=%{buildroot}%{_infodir} install + + # Restore DEV-PHASE. + cp -p ../gcc/DEV-PHASE{.native,} + + # Restore Makefiles with the old gxx_include_dir. + pushd $crossarch/libstdc++-v3 + for i in `find . -name Makefile`; do + mv -f $i.save $i + done + popd + # We're not shipping C++ headers; nuke 'em. + rm -rf $scratchdir + + # We do not ship therse and GDB fails with: + # *** ERROR:: GDB exited with exit status 1 during index generation + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libssp.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libitm.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libgomp.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libatomic.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libstdc++.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libquadmath.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libasan.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libhwasan.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libtsan.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/liblsan.so.* + rm -rf %{buildroot}%{_prefix}/$crossarch/lib64/libubsan.so.* + + # Move libgomp.spec to where it belongs for %files. + mv $crossarch/libgomp/libgomp.spec $CROSS_LIBPATH + # Likewise for libitm.spec + %if %{build_libitm} + mv $crossarch/libitm/libitm.spec $CROSS_LIBPATH + %endif + # Likewise for libsanitizer.spec + mv $crossarch/libsanitizer/libsanitizer.spec $CROSS_LIBPATH + + cd .. + + # No longer present. + #pushd $CROSS_LIBPATH + #mv include-fixed/syslimits.h include/syslimits.h + #mv include-fixed/limits.h include/limits.h + #popd + + case $crossarch in + aarch64*) + OUTPUT_FORMAT_FOR_ARCH="elf64-littleaarch64" + ;; + s390x*) + OUTPUT_FORMAT_FOR_ARCH="elf64-s390" + ;; + ppc64le*) + OUTPUT_FORMAT_FOR_ARCH="elf64-powerpcle" + ;; + *) + echo >&2 "ERROR: unknown cross arch $crossarch" + exit 1 + ;; + esac + + # The sysroot package cretion should copy the same files as + # referenced in these linker scripts to the sysroot package + # location. + echo "/* GNU ld script + Use the shared library, but some functions are only in + the static library. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +GROUP ( =/lib64/libgcc_s.so.1 libgcc.a )" > $CROSS_LIBPATH/libgcc_s.so + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libgomp.so.1 )" > $CROSS_LIBPATH/libgomp.so + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =/%{_prefix}/lib64/libstdc++.so.6 )" > $CROSS_LIBPATH/libstdc++.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libstdc++.a )" > $CROSS_LIBPATH/libstdc++.a + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libstdc++fs.a )" > $CROSS_LIBPATH/libstdc++fs.a + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libstdc++exp.a )" > $CROSS_LIBPATH/libstdc++exp.a + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libsupc++.a )" > $CROSS_LIBPATH/libsupc++.a + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libatomic.so.1 )" > $CROSS_LIBPATH/libatomic.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libatomic.a )" > $CROSS_LIBPATH/libatomic.a + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libitm.so.1 )" > $CROSS_LIBPATH/libitm.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libitm.a )" > $CROSS_LIBPATH/libitm.a + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libasan.so.8 )" > $CROSS_LIBPATH/libasan.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libasan.a )" > $CROSS_LIBPATH/libasan.a + + echo "/* GNU ld script + Use the object from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libasan_preinit.o )" > $CROSS_LIBPATH/libasan_preinit.o + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libhwasan.so.0 )" > $CROSS_LIBPATH/libhwasan.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libhwasan.a )" > $CROSS_LIBPATH/libhwasan.a + + echo "/* GNU ld script + Use the object from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libhwasan_preinit.o )" > $CROSS_LIBPATH/libhwasan_preinit.o + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libtsan.so.2 )" > $CROSS_LIBPATH/libtsan.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libtsan.a )" > $CROSS_LIBPATH/libtsan.a + + echo "/* GNU ld script + Use the object from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libtsan_preinit.o )" > $CROSS_LIBPATH/libtsan_preinit.o + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/liblsan.so.0 )" > $CROSS_LIBPATH/liblsan.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/liblsan.a )" > $CROSS_LIBPATH/liblsan.a + + echo "/* GNU ld script + Use the object from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/liblsan_preinit.o )" > $CROSS_LIBPATH/liblsan_preinit.o + + echo "/* GNU ld script + Use the shared library from sysroot. */ +OUTPUT_FORMAT($OUTPUT_FORMAT_FOR_ARCH) +INPUT ( =%{_prefix}/lib64/libubsan.so.1 )" > $CROSS_LIBPATH/libubsan.so + + echo "/* GNU ld script + Use the static library from sysroot. */ +INPUT( =%{_prefix}/lib/gcc/$crossarch/%{gcc_major}/libubsan.a )" > $CROSS_LIBPATH/libubsan.a + + # Help plugins find out nvra. + echo gcc-%{version}-%{release}.%{_arch} > $CROSS_LIBPATH/rpmver + + # TODO + # Add symlink to lto plugin in the binutils plugin directory. + #%{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ + #ln -s ../../libexec/gcc/$crossarch/%{gcc_major}/liblto_plugin.so \ + # %{buildroot}%{_libdir}/$crossarch/bfd-plugins/ +done +# Back to obj-%{gcc_target_platform}. +popd +echo ==================== INSTALL CROSS END ========================= +%endif FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} @@ -2338,6 +2936,55 @@ ln -sf gcc-annobin.so.0.0.0 $FULLPATH/plugin/gcc-annobin.so.0 ln -sf gcc-annobin.so.0.0.0 $FULLPATH/plugin/gcc-annobin.so %endif +############################################################################### +# Sysroot package creation. +############################################################################### +mkdir -p %{buildroot}/%{sysroot_prefix} +pushd %{buildroot}/%{sysroot_prefix} +mkdir -p usr/lib usr/lib64 +ln -s usr/lib lib +ln -s usr/lib64 lib64 +# These match the files referenced in linker scripts generated for cross +# compilers. +hwasan_sysroot_libs= +%if %{build_libhwasan} +hwasan_sysroot_libs="%{_prefix}/lib64/libhwasan.so.0 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan_preinit.o" +%endif +for f in /lib64/libgcc_s.so.1 \ + %{_prefix}/lib64/libgomp.so.1 \ + %{_prefix}/lib64/libstdc++.so.6 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++exp.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsupc++.a \ + %{_prefix}/lib64/libatomic.so.1 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.a \ + %{_prefix}/lib64/libitm.so.1 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libitm.a \ + %{_prefix}/lib64/libasan.so.8 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan_preinit.o \ + $hwasan_sysroot_libs \ + %{_prefix}/lib64/libtsan.so.2 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan_preinit.o \ + %{_prefix}/lib64/liblsan.so.0 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan.a \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o \ + %{_prefix}/lib64/libubsan.so.1 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libubsan.a; do + mkdir -p %{buildroot}/%{sysroot_prefix}/$(dirname $f) + cp %{buildroot}$f %{buildroot}/%{sysroot_prefix}/$f +done +mkdir -p usr/include +cp -a %{buildroot}%{_prefix}/include/c++ usr/include/c++ +popd +# For cross testing. +mkdir %{buildroot}/%{sysroot_prefix}/test-support +cp obj-%{gcc_target_platform}/gcc/auto-host.h %{buildroot}/%{sysroot_prefix}/test-support/ + %check cd obj-%{gcc_target_platform} @@ -2387,7 +3034,7 @@ echo ====================TESTING========================= %endif echo ====================TESTING END===================== mkdir testlogs-%{_target_platform}-%{version}-%{release} -for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do +for i in `find . -name \*.log -o -name \*.sum | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do ln $i testlogs-%{_target_platform}-%{version}-%{release}/ || : done tar cf - testlogs-%{_target_platform}-%{version}-%{release} | xz -9e \ @@ -3628,7 +4275,354 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/gcc-annobin.so.0.0.0 %endif +%if %{build_cross} +%files -n cross-gcc-aarch64 +%{_prefix}/bin/aarch64-redhat-linux-cpp +%{_prefix}/bin/aarch64-redhat-linux-gcc +%{_prefix}/bin/aarch64-redhat-linux-gcc-%{gcc_major} +%{_prefix}/bin/aarch64-redhat-linux-gcc-ar +%{_prefix}/bin/aarch64-redhat-linux-gcc-nm +%{_prefix}/bin/aarch64-redhat-linux-gcc-ranlib +%{_prefix}/bin/aarch64-redhat-linux-gcov* +%{_prefix}/bin/aarch64-redhat-linux-lto-dump +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/cc1 +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/collect2 +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/lto1 +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/lto-wrapper +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/liblto_plugin.so +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/include +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/include/sanitizer +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/crt*.o +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgcc.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgcc_eh.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgcov.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/include/*.h +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/include/sanitizer/*.h +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/rpmver +# These are here for ld(1) purposes only. +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgcc_s.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgomp.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libgomp.spec +%if %{build_libatomic} +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libatomic.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libatomic.a +%endif +%if %{build_libitm} +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libitm.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libitm.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libitm.spec +%endif +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libasan.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libasan.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libhwasan.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libhwasan.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libhwasan_preinit.o +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libtsan.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libtsan.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libtsan_preinit.o +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/liblsan.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/liblsan.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/liblsan_preinit.o +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libubsan.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libubsan.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libsanitizer.spec + +%files -n cross-gcc-c++-aarch64 +%{_prefix}/bin/aarch64-redhat-linux-c++ +%{_prefix}/bin/aarch64-redhat-linux-g++ +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/cc1plus +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/g++-mapper-server +# For ld(1) purposes only. +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libstdc++.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libstdc++.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libstdc++fs.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libstdc++exp.a +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libsupc++.a + +%files -n cross-gcc-plugin-aarch64 +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/plugin +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/plugin/gtype.state +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/plugin/include +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/aarch64-redhat-linux +%dir %{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major} +%{_prefix}/libexec/gcc/aarch64-redhat-linux/%{gcc_major}/plugin + +%files -n cross-gcc-ppc64le +%{_prefix}/bin/ppc64le-redhat-linux-cpp +%{_prefix}/bin/ppc64le-redhat-linux-gcc +%{_prefix}/bin/ppc64le-redhat-linux-gcc-%{gcc_major} +%{_prefix}/bin/ppc64le-redhat-linux-gcc-ar +%{_prefix}/bin/ppc64le-redhat-linux-gcc-nm +%{_prefix}/bin/ppc64le-redhat-linux-gcc-ranlib +%{_prefix}/bin/ppc64le-redhat-linux-gcov* +%{_prefix}/bin/ppc64le-redhat-linux-lto-dump +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/cc1 +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/collect2 +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/lto1 +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/lto-wrapper +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/liblto_plugin.so +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/include +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/include/sanitizer +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/crt*.o +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgcc.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgcc_eh.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgcov.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/include/*.h +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/include/sanitizer/*.h +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/rpmver +# These are here for ld(1) purposes only. +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgcc_s.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgomp.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libgomp.spec +%if %{build_libatomic} +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libatomic.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libatomic.a +%endif +%if %{build_libitm} +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libitm.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libitm.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libitm.spec +%endif +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libasan.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libasan.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libtsan.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libtsan.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libtsan_preinit.o +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/liblsan.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/liblsan.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/liblsan_preinit.o +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libubsan.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libubsan.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libsanitizer.spec + +%files -n cross-gcc-c++-ppc64le +%{_prefix}/bin/ppc64le-redhat-linux-c++ +%{_prefix}/bin/ppc64le-redhat-linux-g++ +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/cc1plus +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/g++-mapper-server +# For ld(1) purposes only. +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libstdc++.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libstdc++.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libstdc++fs.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libstdc++exp.a +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libsupc++.a + +%files -n cross-gcc-plugin-ppc64le +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/plugin +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/plugin/gtype.state +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/plugin/include +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/ppc64le-redhat-linux +%dir %{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major} +%{_prefix}/libexec/gcc/ppc64le-redhat-linux/%{gcc_major}/plugin + +%files -n cross-gcc-s390x +%{_prefix}/bin/s390x-redhat-linux-cpp +%{_prefix}/bin/s390x-redhat-linux-gcc +%{_prefix}/bin/s390x-redhat-linux-gcc-%{gcc_major} +%{_prefix}/bin/s390x-redhat-linux-gcc-ar +%{_prefix}/bin/s390x-redhat-linux-gcc-nm +%{_prefix}/bin/s390x-redhat-linux-gcc-ranlib +%{_prefix}/bin/s390x-redhat-linux-gcov* +%{_prefix}/bin/s390x-redhat-linux-lto-dump +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/cc1 +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/collect2 +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/lto1 +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/lto-wrapper +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/liblto_plugin.so +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/s390x-redhat-linux +%dir %{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/include +%dir %{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/include/sanitizer +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/crt*.o +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgcc.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgcc_eh.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgcov.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/include/*.h +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/include/sanitizer/*.h +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/rpmver +# These are here for ld(1) purposes only. +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgcc_s.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgomp.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libgomp.spec +%if %{build_libatomic} +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libatomic.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libatomic.a +%endif +%if %{build_libitm} +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libitm.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libitm.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libitm.spec +%endif +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libasan.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libasan.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libtsan.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libtsan.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libtsan_preinit.o +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/liblsan.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/liblsan.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/liblsan_preinit.o +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libubsan.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libubsan.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libsanitizer.spec + +%files -n cross-gcc-c++-s390x +%{_prefix}/bin/s390x-redhat-linux-c++ +%{_prefix}/bin/s390x-redhat-linux-g++ +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/cc1plus +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/g++-mapper-server +# For ld(1) purposes only. +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libstdc++.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libstdc++.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libstdc++fs.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libstdc++exp.a +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libsupc++.a + +%files -n cross-gcc-plugin-s390x +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/s390x-redhat-linux +%dir %{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major} +%dir %{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/plugin +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/plugin/gtype.state +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/plugin/include +%dir %{_prefix}/libexec/gcc +%dir %{_prefix}/libexec/gcc/s390x-redhat-linux +%dir %{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major} +%{_prefix}/libexec/gcc/s390x-redhat-linux/%{gcc_major}/plugin + +%dnl build_cross +%endif + +%files -n %{sysroot_package_arch}-libgcc +# Package the symlinks into usr/ here. +%{sysroot_prefix}/lib +%{sysroot_prefix}/lib64 +%{sysroot_prefix}%{_prefix}/lib64/libgcc_s.so.1 + +%files -n %{sysroot_package_arch}-libgomp +%{sysroot_prefix}%{_prefix}/lib64/libgomp.so.1 + +%files -n %{sysroot_package_arch}-libstdc++ +%{sysroot_prefix}%{_prefix}/include/c++ +%{sysroot_prefix}%{_prefix}/lib64/libstdc++.so.6 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++exp.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsupc++.a + +%files -n %{sysroot_package_arch}-libatomic +%{sysroot_prefix}%{_prefix}/lib64/libatomic.so.1 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.a + +%files -n %{sysroot_package_arch}-libitm +%{sysroot_prefix}%{_prefix}/lib64/libitm.so.1 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libitm.a + +%files -n %{sysroot_package_arch}-libsanitizer +%{sysroot_prefix}%{_prefix}/lib64/libasan.so.8 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan_preinit.o +%if %{build_libhwasan} +%{sysroot_prefix}%{_prefix}/lib64/libhwasan.so.0 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan_preinit.o +%endif +%{sysroot_prefix}%{_prefix}/lib64/libtsan.so.2 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan_preinit.o +%{sysroot_prefix}%{_prefix}/lib64/liblsan.so.0 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan.a +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libubsan.a +%{sysroot_prefix}%{_prefix}/lib64/libubsan.so.1 + +%files -n %{sysroot_package_arch}-test-support +# Package the symlinks into usr/ here. +%{sysroot_prefix}/test-support +%{sysroot_prefix}/test-support/auto-host.h + %changelog +* Tue Feb 17 2026 Joseph Myers - 14.3.1-4.4 +- fixes for testing non-production cross compilers (RHEL-114521) + - include libsanitizer.spec and static sanitizer libraries in packages + - enable tests involving target environment variables in cross testing + - disable color for more sanitizer tests + +* Mon Jan 26 2026 Joseph Myers - 14.3.1-4.3 +- fixes for testing non-production cross compilers (RHEL-114521) + - enable guality tests in cross testing + - enable simulate-thread tests in cross testing + - enable gcov tests in cross testing + - enable some miscellaneous tests in cross testing + - fix some tree-prof tests for cross testing + +* Tue Jan 6 2026 Joseph Myers - 14.3.1-4.2 +- fixes for testing non-production cross compilers (RHEL-114521) + - enable stack-protector tests in cross testing + +* Mon Dec 15 2025 Joseph Myers - 14.3.1-4.1 +- fixes for testing non-production cross compilers (RHEL-114521) + - include libstdc++fs.a and libstdc++exp.a in sysroot packages + - add libsanitizer sysroot packages + - save testsuite .sum files in build logs + - add packages with files from build tree used in testsuite + - escape \r in dg-regexp test names to avoid truncation in build-tree testing + - fix iconv linking for installed testing + - enable compat testing for installed testing + - distinguish canonical and noncanonical target for installed testing + - add plugin headers packages for cross compilers + - install text-art/*.h plugin headers + - support plugin tests for installed testing + +* Tue Oct 28 2025 Siddhesh Poyarekar - 14.3.1-4 +- update from releases/gcc-14 branch + - PRs ada/107536, ada/113536, analyzer/118300, c/122188, c++/120620, + c++/120757, c++/121801, c++/121977, c++/121981, fortran/89092, + fortran/120784, fortran/121145, fortran/121263, go/104290, + libstdc++/110853, libstdc++/117276, libstdc++/120698, + libstdc++/121097, libstdc++/121374, libstdc++/121496, + libstdc++/121745, libstdc++/121827, libstdc++/122168, + libstdc++/122322, middle-end/121453, middle-end/121828, other/118919, + rtl-optimization/121253, target/49857, target/81540, target/118280, + target/120442, target/120476, target/120691, target/121118, + target/121208, target/121294, target/121414, target/121449, + target/121542, target/121599, target/121608, target/121749, + target/122177, target/122187, target/122210, target/122220, + target/122222, testsuite/118567, tree-optimization/117423, + tree-optimization/119085, tree-optimization/120357, + tree-optimization/120358, tree-optimization/120654, + tree-optimization/120817, tree-optimization/120944, + tree-optimization/121059, tree-optimization/121256, + tree-optimization/121370, tree-optimization/121772, + tree-optimization/121870, tree-optimization/122104 + +* Wed Oct 22 2025 Joseph Myers - 14.3.1-2.4 +- add sysroot packages for use by non-production cross compilers (RHEL-118680) + +* Thu Oct 16 2025 Marek Polacek 14.3.1-2.3 +- add cross compilers for aarch64, ppc64le and s390x for non-production uses + (RHEL-114519) + +* Mon Sep 22 2025 Siddhesh Poyarekar - 14.3.1-2.2 +- Add branch, conditions, and calls to gcov function summaries (RHEL-105464) + * Mon Jun 23 2025 Siddhesh Poyarekar - 14.3.1-2.1 - Update to latest pretty printers from GTS (RHEL-81976) diff --git a/gcc14-gcov-function-summaries.patch b/gcc14-gcov-function-summaries.patch new file mode 100644 index 0000000..9ecccdb --- /dev/null +++ b/gcc14-gcov-function-summaries.patch @@ -0,0 +1,142 @@ +From 580664d1b66a5d98e5e87d9ff728566b309e89b1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= +Date: Wed, 7 Aug 2024 17:33:31 +0200 +Subject: [PATCH] gcov: branch, conds, calls in function summaries + +The gcov function summaries only output the covered lines, not the +branches and calls. Since the function summaries is an opt-in it +probably makes sense to also include branch coverage, calls, and +condition coverage. + +$ gcc --coverage -fpath-coverage hello.c -o hello +$ ./hello + +Before: + $ gcov -f hello + Function 'main' + Lines executed:100.00% of 4 + + Function 'fn' + Lines executed:100.00% of 7 + + File 'hello.c' + Lines executed:100.00% of 11 + Creating 'hello.c.gcov' + +After: + $ gcov -f hello + Function 'main' + Lines executed:100.00% of 3 + No branches + Calls executed:100.00% of 1 + + Function 'fn' + Lines executed:100.00% of 7 + Branches executed:100.00% of 4 + Taken at least once:50.00% of 4 + No calls + + File 'hello.c' + Lines executed:100.00% of 10 + Creating 'hello.c.gcov' + + Lines executed:100.00% of 10 + +With conditions: + $ gcov -fg hello + Function 'main' + Lines executed:100.00% of 3 + No branches + Calls executed:100.00% of 1 + No conditions + + Function 'fn' + Lines executed:100.00% of 7 + Branches executed:100.00% of 4 + Taken at least once:50.00% of 4 + Condition outcomes covered:100.00% of 8 + No calls + + File 'hello.c' + Lines executed:100.00% of 10 + Creating 'hello.c.gcov' + + Lines executed:100.00% of 10 + +gcc/ChangeLog: + + * gcov.cc (generate_results): Count branches, conditions. + (function_summary): Output branch, calls, condition count. +--- + gcc/gcov.cc | 48 +++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 43 insertions(+), 5 deletions(-) + +diff --git a/gcc/gcov.cc b/gcc/gcov.cc +index 96fdc50f0e8..f9ab93b54d9 100644 +--- a/gcc/gcov.cc ++++ b/gcc/gcov.cc +@@ -1687,11 +1687,19 @@ generate_results (const char *file_name) + memset (&coverage, 0, sizeof (coverage)); + coverage.name = fn->get_name (); + add_line_counts (flag_function_summary ? &coverage : NULL, fn); +- if (flag_function_summary) +- { +- function_summary (&coverage); +- fnotice (stdout, "\n"); +- } ++ ++ if (!flag_function_summary) ++ continue; ++ ++ for (const block_info& block : fn->blocks) ++ for (arc_info *arc = block.succ; arc; arc = arc->succ_next) ++ add_branch_counts (&coverage, arc); ++ ++ for (const block_info& block : fn->blocks) ++ add_condition_counts (&coverage, &block); ++ ++ function_summary (&coverage); ++ fnotice (stdout, "\n"); + } + + name_map needle; +@@ -2764,6 +2772,36 @@ function_summary (const coverage_info *coverage) + { + fnotice (stdout, "%s '%s'\n", "Function", coverage->name); + executed_summary (coverage->lines, coverage->lines_executed); ++ ++ if (coverage->branches) ++ { ++ fnotice (stdout, "Branches executed:%s of %d\n", ++ format_gcov (coverage->branches_executed, coverage->branches, 2), ++ coverage->branches); ++ fnotice (stdout, "Taken at least once:%s of %d\n", ++ format_gcov (coverage->branches_taken, coverage->branches, 2), ++ coverage->branches); ++ } ++ else ++ fnotice (stdout, "No branches\n"); ++ ++ if (coverage->calls) ++ fnotice (stdout, "Calls executed:%s of %d\n", ++ format_gcov (coverage->calls_executed, coverage->calls, 2), ++ coverage->calls); ++ else ++ fnotice (stdout, "No calls\n"); ++ ++ if (flag_conditions) ++ { ++ if (coverage->conditions) ++ fnotice (stdout, "Condition outcomes covered:%s of %d\n", ++ format_gcov (coverage->conditions_covered, ++ coverage->conditions, 2), ++ coverage->conditions); ++ else ++ fnotice (stdout, "No conditions\n"); ++ } + } + + /* Output summary info for a file. */ +-- +2.51.0 + diff --git a/gcc14-tests-color.patch b/gcc14-tests-color.patch new file mode 100644 index 0000000..dc794e7 --- /dev/null +++ b/gcc14-tests-color.patch @@ -0,0 +1,107 @@ +commit a02744993035a301c27e753c3cb53ef82bc1bfc5 +Author: Joseph Myers +Date: Wed Feb 11 23:53:41 2026 +0000 + + testsuite: Use color=never for more sanitizer tests + + The sanitizer tests have logic to set ASAN_OPTIONS and UBSAN_OPTIONS + to color=never to avoid problems checking against output patterns, in + test configurations where the output is otherwise coloured by default. + + This does not however cover all sanitizer tests with issues in such + configurations. There is no corresponding logic to set TSAN_OPTIONS + for tsan tests, and environment variable settings in + dg-set-target-env-var override the globally set color=never. + + Add logic to set TSAN_OPTIONS similarly (following the UBSAN_OPTIONS + logic, that saves and restores any previous setting or lack thereof, + rather than the ASAN_OPTIONS logic, that just sets ASAN_OPTIONS in the + environment so that it remains set for all the rest of the possibly + unrelated tests included in the same runtest execution). Also add + color=never to dg-set-target-env-var in two such tests where I've seen + coloured output causing failures (but not for other tests where I + haven't seen the default producing such fallures). + + Tested for x86_64-pc-linux-gnu, and with a cross to aarch64-linux + (together with other testsuite fixes) in a configuration where I + previously saw failures related to colour output from sanitizer tests. + + * lib/tsan-dg.exp (orig_tsan_options_saved, orig_tsan_options): + New global variables. + (tsan_init): Save TSAN_OPTIONS and set it to color=never. + (tsan_finish): Restore TSAN_OPTIONS. + * c-c++-common/asan/pr64820.c: Include color=never in + ASAN_OPTIONS. + * c-c++-common/asan/use-after-return-1.c: Likewise. + +diff --git a/gcc/testsuite/c-c++-common/asan/pr64820.c b/gcc/testsuite/c-c++-common/asan/pr64820.c +index a00debf35883..b675ef21b275 100644 +--- a/gcc/testsuite/c-c++-common/asan/pr64820.c ++++ b/gcc/testsuite/c-c++-common/asan/pr64820.c +@@ -1,7 +1,7 @@ + /* { dg-do run } */ + /* { dg-require-effective-target fstack_protector } */ + /* { dg-options "-fstack-protector-strong" } */ +-/* { dg-set-target-env-var ASAN_OPTIONS "detect_stack_use_after_return=1" } */ ++/* { dg-set-target-env-var ASAN_OPTIONS "color=never detect_stack_use_after_return=1" } */ + /* { dg-shouldfail "asan" } */ + + __attribute__((noinline)) +diff --git a/gcc/testsuite/c-c++-common/asan/use-after-return-1.c b/gcc/testsuite/c-c++-common/asan/use-after-return-1.c +index e1bb18a57431..557a687e0e32 100644 +--- a/gcc/testsuite/c-c++-common/asan/use-after-return-1.c ++++ b/gcc/testsuite/c-c++-common/asan/use-after-return-1.c +@@ -1,5 +1,5 @@ + /* { dg-do run } */ +-/* { dg-set-target-env-var ASAN_OPTIONS "detect_stack_use_after_return=1" } */ ++/* { dg-set-target-env-var ASAN_OPTIONS "color=never detect_stack_use_after_return=1" } */ + /* { dg-shouldfail "asan" } */ + + #include +diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp +index 916c8737807e..6379d18e6b54 100644 +--- a/gcc/testsuite/lib/tsan-dg.exp ++++ b/gcc/testsuite/lib/tsan-dg.exp +@@ -81,6 +81,9 @@ proc tsan_link_flags { paths } { + return "$flags" + } + ++set orig_tsan_options_saved 0 ++set orig_tsan_options 0 ++ + # + # tsan_init -- called at the start of each subdir of tests + # +@@ -93,6 +96,17 @@ proc tsan_init { args } { + global tsan_saved_ALWAYS_CXXFLAGS + global dg-do-what-default + global tsan_saved_dg-do-what-default ++ global orig_tsan_options_saved ++ global orig_tsan_options ++ ++ if { $orig_tsan_options_saved == 0 } { ++ # Save the original environment. ++ if [info exists env(TSAN_OPTIONS)] { ++ set orig_tsan_options "$env(TSAN_OPTIONS)" ++ set orig_tsan_options_saved 1 ++ } ++ } ++ setenv TSAN_OPTIONS color=never + + set link_flags "" + if ![is_remote host] { +@@ -134,6 +148,14 @@ proc tsan_finish { args } { + global tsan_saved_dg-do-what-default + global tsan_saved_library_path + global ld_library_path ++ global orig_tsan_options_saved ++ global orig_tsan_options ++ ++ if { $orig_tsan_options_saved } { ++ setenv TSAN_OPTIONS "$orig_tsan_options" ++ } elseif [info exists env(TSAN_OPTIONS)] { ++ unsetenv TSAN_OPTIONS ++ } + + if [info exists tsan_saved_ALWAYS_CXXFLAGS ] { + set ALWAYS_CXXFLAGS $tsan_saved_ALWAYS_CXXFLAGS diff --git a/gcc14-tests-dg-regexp.patch b/gcc14-tests-dg-regexp.patch new file mode 100644 index 0000000..4679d05 --- /dev/null +++ b/gcc14-tests-dg-regexp.patch @@ -0,0 +1,40 @@ +commit 8641223df928a12246d23147d5ad8073769d5765 +Author: Joseph Myers +Date: Wed Dec 3 16:15:39 2025 +0000 + + testsuite: Escape \r in dg-regexp test names + + When the regular expression matched in a test using dg-regexp contains + a newline (written in the source as \n inside ""), there is logic in + the testsuite to escape this so the test name after PASS: or FAIL: in + the testsuite output has \n instead of that newline. + + When it contains a carriage return (from \r in the source), however, + there is no such escaping, and the test names in the .sum and .log + files thus contain a literal CR character in the middle of a test + name. The process of combining test results from parallel-run parts + of each testsuite then turns that CR into end-of-line, losing the rest + of the test name (whereas if you use runtest directly, e.g. via + contrib/test_installed, the full test name remains in the .sum file + because there is no such postprocessing). I suspect the handling of + newlines by Python (used for one of the scripts involved in combining + results) is responsible for test names getting truncated like this. + To avoid this truncation, escape CR like newlines are escaped. + + Bootstrapped with no regressions for x86_64-pc-linux-gnu. + + * lib/gcc-defs.exp (handle-dg-regexps): Also escape \r in output. + +diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp +index d66c833452cc..61bf5f8e0a9d 100644 +--- a/gcc/testsuite/lib/gcc-defs.exp ++++ b/gcc/testsuite/lib/gcc-defs.exp +@@ -553,7 +553,7 @@ proc handle-dg-regexps { text } { + + # Escape newlines in $rexp so that we can print them in + # pass/fail results. +- set escaped_regex [string map {"\n" "\\n"} $rexp] ++ set escaped_regex [string map {"\n" "\\n" "\r" "\\r"} $rexp] + verbose "escaped_regex: ${escaped_regex}" 4 + + set title "$testname_with_flags dg-regexp $linenum" diff --git a/gcc14-tests-env-native.patch b/gcc14-tests-env-native.patch new file mode 100644 index 0000000..2f1fc5f --- /dev/null +++ b/gcc14-tests-env-native.patch @@ -0,0 +1,26 @@ +diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp +index 6bd3c211611a..cc7f30f10135 100644 +--- a/gcc/testsuite/lib/asan-dg.exp ++++ b/gcc/testsuite/lib/asan-dg.exp +@@ -303,7 +303,6 @@ proc asan-gtest { args } { + + if { ![info exists asan_last_gtest_test_list] } { return } + if { [llength $asan_last_gtest_test_list] == 0 } { return } +- if { ![isnative] || [is_remote target] } { return } + + set gtest_test_list $asan_last_gtest_test_list + unset asan_last_gtest_test_list +diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp +index 228c21d12071..49c9f5a8796d 100644 +--- a/gcc/testsuite/lib/gcc-dg.exp ++++ b/gcc/testsuite/lib/gcc-dg.exp +@@ -459,9 +459,6 @@ if { [info procs ${tool}_load] != [list] \ + set saved_target_env_var [list] + if { [info exists set_target_env_var] \ + && [llength $set_target_env_var] != 0 } { +- if { [is_remote target] } { +- return [list "unsupported" ""] +- } + set-target-env-var + } + set result [eval [list saved_${tool}_load $program] $args] diff --git a/gcc14-tests-gcov-native.patch b/gcc14-tests-gcov-native.patch new file mode 100644 index 0000000..ce12e00 --- /dev/null +++ b/gcc14-tests-gcov-native.patch @@ -0,0 +1,922 @@ +commit 39a93faab07ff64a9e828f487f231b013b6cdbdc +Author: Joseph Myers +Date: Fri Jan 23 21:14:31 2026 +0000 + + testsuite: Enable cross testing for gcov tests + + Tests of gcov are generally restricted to { target native }. The + issue for these tests is the need to transfer .gcda files from the + target to the host before running gcov. Implement that support and + remove the { target native } restrictions for these tests. + + Note that by default code built to generate coverage data expects to + be able to write .gcda files to the same directory name in which the + compiler generated its output, so if that path cannot be created by + the tests on the target then they may still not work in a cross setup. + Other options involving -fprofile-dir are possible but involve their + own complications such as mangling of the .gcda file name (the + mangling logic would then need replicating in gcov.exp). Copying + files from the target using such absolute directory paths is what + already happens with gcc.dg/tree-prof tests using profopt.exp (and + those already work in a cross configuration except for a few using + dg-additional-sources), so this change is effectively making the gcov + tests work more like the tree-prof ones. + + Note also that [remote_file host absolute ...] may require appropriate + support in your host board file for the case of a remote host (this + isn't an operation DejaGnu knows about doing remotely by default). + The logic for determining .gcda paths does mean it's the absolute path + on host, not on build, that is relevant. + + Tested for x86_64-pc-linux-gnu to make sure native testing isn't + broken, and with cross to aarch64-linux. + + * g++.dg/gcov/gcov-1.C, g++.dg/gcov/gcov-10.C, + g++.dg/gcov/gcov-11.C, g++.dg/gcov/gcov-12.C, + g++.dg/gcov/gcov-13.C, g++.dg/gcov/gcov-14.C, + g++.dg/gcov/gcov-15.C, g++.dg/gcov/gcov-16.C, + g++.dg/gcov/gcov-17.C, g++.dg/gcov/gcov-18.C, + g++.dg/gcov/gcov-19.C, g++.dg/gcov/gcov-2.C, + g++.dg/gcov/gcov-20.C, g++.dg/gcov/gcov-21.C, + g++.dg/gcov/gcov-23.C, g++.dg/gcov/gcov-3.C, g++.dg/gcov/gcov-4.C, + g++.dg/gcov/gcov-5.C, g++.dg/gcov/gcov-7.C, g++.dg/gcov/gcov-8.C, + g++.dg/gcov/gcov-dump-1.C, g++.dg/gcov/gcov-dump-2.C, + g++.dg/gcov/gcov-threads-1.C, g++.dg/gcov/loop.C, + g++.dg/gcov/pr16855-priority.C, g++.dg/gcov/pr16855.C, + g++.dg/gcov/pr84548.C, g++.dg/gcov/pr86109.C, + g++.dg/gcov/pr88045.C, g++.dg/gcov/pr88263-2.C, + g++.dg/gcov/pr88263.C, g++.dg/gcov/pr97069.C, + g++.dg/gcov/pr98273.C, g++.dg/gcov/ternary.C, + gcc.misc-tests/gcov-1.c, gcc.misc-tests/gcov-10.c, + gcc.misc-tests/gcov-10b.c, gcc.misc-tests/gcov-11.c, + gcc.misc-tests/gcov-12.c, gcc.misc-tests/gcov-13.c, + gcc.misc-tests/gcov-14.c, gcc.misc-tests/gcov-15.c, + gcc.misc-tests/gcov-16.c, gcc.misc-tests/gcov-17.c, + gcc.misc-tests/gcov-18.c, gcc.misc-tests/gcov-19.c, + gcc.misc-tests/gcov-1a.c, gcc.misc-tests/gcov-2.c, + gcc.misc-tests/gcov-20.c, gcc.misc-tests/gcov-22.c, + gcc.misc-tests/gcov-24.c, gcc.misc-tests/gcov-25.c, + gcc.misc-tests/gcov-26.c, gcc.misc-tests/gcov-27.c, + gcc.misc-tests/gcov-28.c, gcc.misc-tests/gcov-29.c, + gcc.misc-tests/gcov-3.c, gcc.misc-tests/gcov-30.c, + gcc.misc-tests/gcov-33.c, gcc.misc-tests/gcov-34.c, + gcc.misc-tests/gcov-4.c, gcc.misc-tests/gcov-4b.c, + gcc.misc-tests/gcov-5b.c, gcc.misc-tests/gcov-6.c, + gcc.misc-tests/gcov-7.c, gcc.misc-tests/gcov-8.c, + gcc.misc-tests/gcov-9.c, gcc.misc-tests/gcov-pr83813.c, + gcc.misc-tests/gcov-pr84758.c, gcc.misc-tests/gcov-pr85217.c, + gcc.misc-tests/gcov-pr85332.c, gcc.misc-tests/gcov-pr85338.c, + gcc.misc-tests/gcov-pr85350.c, gcc.misc-tests/gcov-pr85372.c, + gcc.misc-tests/gcov-pr86536.c, gcc.misc-tests/gcov-pr90574-1.c, + gcc.misc-tests/gcov-pr90574-2.c, gdc.dg/gcov1.d, + gnat.dg/gcov/check.adb: Do not restrict to { target native }. + * lib/gcov.exp (transfer-gcda): New. + (clean-gcov-file): Delete .gcda file on target. + (run-gcov): Transfer .gcda files from target. + +(Note: GCC 14 version has adjusted diff context to avoid merge +conflicts and also changes fewer tests because of new tests added +upstream since GCC 14.) + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-1.C b/gcc/testsuite/g++.dg/gcov/gcov-1.C +index ee383b480a87..40fee7992a6d 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-1.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-1.C +@@ -2,7 +2,7 @@ + constructs are reported correctly by gcov. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + extern "C" void abort (void); + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-10.C b/gcc/testsuite/g++.dg/gcov/gcov-10.C +index 4c91be94ee46..d3942ceabd18 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-10.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-10.C +@@ -1,7 +1,7 @@ + /* Ensure PIC sequence used for comdat functions */ + + /* { dg-options "-fprofile-arcs -ftest-coverage -fpic" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target fpic } */ + + inline int __attribute__ ((noinline)) Foo () +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-11.C b/gcc/testsuite/g++.dg/gcov/gcov-11.C +index fa0890206f3a..243c112506ae 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-11.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-11.C +@@ -2,7 +2,7 @@ + distinct from unexecuted normal regions. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void Baz (int i) + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-12.C b/gcc/testsuite/g++.dg/gcov/gcov-12.C +index 9f2b29b4da50..da694bc7c91b 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-12.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-12.C +@@ -1,6 +1,6 @@ + /* PR 51113 */ + /* { dg-options "-fprofile-arcs -ftest-coverage -fpic -fno-implicit-constexpr" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-additional-sources "gcovpart-12b.C" } */ + + struct Foo { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-13.C b/gcc/testsuite/g++.dg/gcov/gcov-13.C +index c262a71f5364..45668f65cd3a 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-13.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-13.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void Baz (int i) + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-14.C b/gcc/testsuite/g++.dg/gcov/gcov-14.C +index b069d0e1881c..ff16f399a03b 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-14.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-14.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage -Ofast" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-15.C b/gcc/testsuite/g++.dg/gcov/gcov-15.C +index fcd16b00b1c4..53752449b73f 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-15.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-15.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/64634 + // { dg-options "-fprofile-arcs -ftest-coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + + void catchEx () // count(1) + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-16.C b/gcc/testsuite/g++.dg/gcov/gcov-16.C +index f09d4060cbdb..beea2e55e1ae 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-16.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-16.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/64634 + // { dg-options "-fprofile-arcs -ftest-coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + + int main() + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-17.C b/gcc/testsuite/g++.dg/gcov/gcov-17.C +index efe019599a59..19d0197ba776 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-17.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-17.C +@@ -1,5 +1,5 @@ + /* { dg-options "--coverage -std=c++11" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + template class Foo + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-18.C b/gcc/testsuite/g++.dg/gcov/gcov-18.C +index 620aef126995..ecc4716cbfa7 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-18.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-18.C +@@ -1,5 +1,5 @@ + /* { dg-options "--coverage -fcondition-coverage -std=c++11" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include + #include +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-2.C b/gcc/testsuite/g++.dg/gcov/gcov-2.C +index 05db15de7cc5..9fdcfa84fbdd 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-2.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-2.C +@@ -1,7 +1,7 @@ + /* Verify line coverage counts for simple member functions. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage -fno-implicit-constexpr" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + class C { + public: +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-3.C b/gcc/testsuite/g++.dg/gcov/gcov-3.C +index aff063a4b90f..c128757f281b 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-3.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-3.C +@@ -2,7 +2,7 @@ + within a header file. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include "gcov-3.h" + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-4.C b/gcc/testsuite/g++.dg/gcov/gcov-4.C +index 2f83ff1becc6..e148d5c95538 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-4.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-4.C +@@ -4,7 +4,7 @@ + #include + + /* { dg-options "-fprofile-arcs -ftest-coverage -fno-exceptions" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + class foo { + public: +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-5.C b/gcc/testsuite/g++.dg/gcov/gcov-5.C +index 9ada41802caa..fc70b3bee6f7 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-5.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-5.C +@@ -5,7 +5,7 @@ + #include + + /* { dg-options "-fprofile-arcs -ftest-coverage -fno-inline" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + class A { + int count; +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-7.C b/gcc/testsuite/g++.dg/gcov/gcov-7.C +index 334db1837c85..6240a8fb4278 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-7.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-7.C +@@ -3,7 +3,7 @@ + declaration. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + struct foo + { +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-8.C b/gcc/testsuite/g++.dg/gcov/gcov-8.C +index 1c97c35d8c1e..bbb075ccea6b 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-8.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-8.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + class C { + public: +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-dump-1.C b/gcc/testsuite/g++.dg/gcov/gcov-dump-1.C +index 774a7269ff2c..8aba2afadcd3 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-dump-1.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-dump-1.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-generate -ftest-coverage " } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int value; + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-dump-2.C b/gcc/testsuite/g++.dg/gcov/gcov-dump-2.C +index e748989d2c0b..f50451cf0769 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-dump-2.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-dump-2.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-generate -ftest-coverage " } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int value; + +diff --git a/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C b/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C +index 3ae00789439b..54fcdcab39c2 100644 +--- a/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C ++++ b/gcc/testsuite/g++.dg/gcov/gcov-threads-1.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage -pthread -fprofile-update=atomic" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target profile_update_atomic } */ + + #include +diff --git a/gcc/testsuite/g++.dg/gcov/loop.C b/gcc/testsuite/g++.dg/gcov/loop.C +index e63cb92e6e6d..6d5e4a8632a4 100644 +--- a/gcc/testsuite/g++.dg/gcov/loop.C ++++ b/gcc/testsuite/g++.dg/gcov/loop.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + unsigned + loop (unsigned n, int value) /* count(14.0k) */ +diff --git a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C +index c7a58397bb91..bd6acd2c3e84 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C ++++ b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target init_priority } */ + + #include +diff --git a/gcc/testsuite/g++.dg/gcov/pr16855.C b/gcc/testsuite/g++.dg/gcov/pr16855.C +index f9b86a40001f..5457f4fe3623 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr16855.C ++++ b/gcc/testsuite/g++.dg/gcov/pr16855.C +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + /* See PR91087 for information on Darwin xfails. */ + +diff --git a/gcc/testsuite/g++.dg/gcov/pr84548.C b/gcc/testsuite/g++.dg/gcov/pr84548.C +index 3b60b90e2a26..a83f4cc8b1af 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr84548.C ++++ b/gcc/testsuite/g++.dg/gcov/pr84548.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/84548 + // { dg-options "-fprofile-arcs -ftest-coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + // TODO: add support for groups to gcov.exp script + + struct A { static int foo () { return 1; }; static int bar () { +diff --git a/gcc/testsuite/g++.dg/gcov/pr86109.C b/gcc/testsuite/g++.dg/gcov/pr86109.C +index 9052d2e5a042..63549d68509c 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr86109.C ++++ b/gcc/testsuite/g++.dg/gcov/pr86109.C +@@ -1,6 +1,6 @@ + + /* { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main() + { +diff --git a/gcc/testsuite/g++.dg/gcov/pr88045.C b/gcc/testsuite/g++.dg/gcov/pr88045.C +index 1b077a5e61a2..9961e9d16a5e 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr88045.C ++++ b/gcc/testsuite/g++.dg/gcov/pr88045.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/88045 + // { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } +-// { dg-do run { target native } } ++// { dg-do run } + + #include + #include +diff --git a/gcc/testsuite/g++.dg/gcov/pr88263-2.C b/gcc/testsuite/g++.dg/gcov/pr88263-2.C +index f0cf15f5d0a3..a4ddf776a0d8 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr88263-2.C ++++ b/gcc/testsuite/g++.dg/gcov/pr88263-2.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/88263 + // { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } +-// { dg-do run { target native } } ++// { dg-do run } + + #include + +diff --git a/gcc/testsuite/g++.dg/gcov/pr88263.C b/gcc/testsuite/g++.dg/gcov/pr88263.C +index 854772f0594c..37943a3fe40f 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr88263.C ++++ b/gcc/testsuite/g++.dg/gcov/pr88263.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/88263 + // { dg-options "-fprofile-arcs -ftest-coverage -std=c++11" } +-// { dg-do run { target native } } ++// { dg-do run } + + #include + +diff --git a/gcc/testsuite/g++.dg/gcov/pr97069.C b/gcc/testsuite/g++.dg/gcov/pr97069.C +index 040e336662a9..9171399235e1 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr97069.C ++++ b/gcc/testsuite/g++.dg/gcov/pr97069.C +@@ -1,6 +1,6 @@ + // PR gcov-profile/97069 + // { dg-options "--coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + + # 0 "pr97069.C" + # 0 "" +diff --git a/gcc/testsuite/g++.dg/gcov/pr98273.C b/gcc/testsuite/g++.dg/gcov/pr98273.C +index bfa83cbe4d00..45cd476ed24d 100644 +--- a/gcc/testsuite/g++.dg/gcov/pr98273.C ++++ b/gcc/testsuite/g++.dg/gcov/pr98273.C +@@ -1,7 +1,7 @@ + /* PR gcov-profile/98273 */ + + /* { dg-options "--coverage -std=c++11" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int + main () +diff --git a/gcc/testsuite/g++.dg/gcov/ternary.C b/gcc/testsuite/g++.dg/gcov/ternary.C +index 9b8e34644b46..5ad2b2c6a4e1 100644 +--- a/gcc/testsuite/g++.dg/gcov/ternary.C ++++ b/gcc/testsuite/g++.dg/gcov/ternary.C +@@ -1,5 +1,5 @@ + // { dg-options "-fprofile-arcs -ftest-coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + + int b, c, d, e; + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-1.c b/gcc/testsuite/gcc.misc-tests/gcov-1.c +index 99a02790dee8..e6606f99ffae 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-1.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-1.c +@@ -1,7 +1,7 @@ + /* Test Gcov basics. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void noop () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-10.c b/gcc/testsuite/gcc.misc-tests/gcov-10.c +index bd1d418f378a..8a8370228b99 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-10.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-10.c +@@ -1,7 +1,7 @@ + /* Test gcov block mode. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-10b.c b/gcc/testsuite/gcc.misc-tests/gcov-10b.c +index 148d779fdb35..2a4f7a3b25ce 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-10b.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-10b.c +@@ -1,7 +1,7 @@ + /* Test gcov block mode. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-11.c b/gcc/testsuite/gcc.misc-tests/gcov-11.c +index a1037a552a94..153a8d2e3965 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-11.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-11.c +@@ -1,7 +1,7 @@ + /* Test gcov block mode. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int one = 1; /* subvert constant folder. */ + int zero = 0; +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-12.c b/gcc/testsuite/gcc.misc-tests/gcov-12.c +index f3d6924c9803..2428b8f990e8 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-12.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-12.c +@@ -1,6 +1,6 @@ + /* Test gcov weak ellision. */ + +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-weak "" } */ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-13.c b/gcc/testsuite/gcc.misc-tests/gcov-13.c +index b42b904ef3e2..b1f0d79ddff4 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-13.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-13.c +@@ -1,6 +1,6 @@ + /* Test gcov weak ellision. */ + +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ + /* { dg-require-weak "" } */ + /* { dg-additional-sources "gcovpart-13b.c" } */ +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c +index 61a9191c0687..847b09cc13bf 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-14.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c +@@ -1,6 +1,6 @@ + /* Test gcov extern inline. */ + +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */ + /* The following line arranges that Darwin has behavior like elf weak import. */ + /* { dg-additional-options "-Wl,-U,_Foo" { target *-*-darwin* } } */ +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-15.c b/gcc/testsuite/gcc.misc-tests/gcov-15.c +index 04273fcec425..d1a66b2ccc1f 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-15.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-15.c +@@ -1,7 +1,7 @@ + /* Test gcov multiple paths to file. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #if !RECURSIVE + #define RECURSIVE 1 +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-16.c b/gcc/testsuite/gcc.misc-tests/gcov-16.c +index 738113c92cb8..5a6a723364f6 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-16.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-16.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void + bar (void) +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-17.c b/gcc/testsuite/gcc.misc-tests/gcov-17.c +index e38860808445..c937facf1f2c 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-17.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-17.c +@@ -22,7 +22,7 @@ by both branches of the condition in . + */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + unsigned int + UuT (void) +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-18.c b/gcc/testsuite/gcc.misc-tests/gcov-18.c +index ae1017866db9..8c42e63a6f96 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-18.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-18.c +@@ -3,7 +3,7 @@ + just once. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int a = 0; + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-19.c b/gcc/testsuite/gcc.misc-tests/gcov-19.c +index 44e2f135e2ae..17d6dde87c68 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-19.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-19.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fcondition-coverage -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + /* Some side effect to stop branches from being pruned. */ + int x = 0; +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-1a.c b/gcc/testsuite/gcc.misc-tests/gcov-1a.c +index 2b9fabce66c9..9279b7855945 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-1a.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-1a.c +@@ -1,7 +1,7 @@ + /* Test Gcov basics. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage -fprofile-abs-path" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void noop () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-2.c b/gcc/testsuite/gcc.misc-tests/gcov-2.c +index aa3e4b74e902..dde8f8b7926a 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-2.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-2.c +@@ -1,7 +1,7 @@ + /* Test Gcov basics. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage -g" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void noop () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-20.c b/gcc/testsuite/gcc.misc-tests/gcov-20.c +index ca8c12aad2bc..b1357ca47f3f 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-20.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-20.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fcondition-coverage -ftest-coverage -fprofile-update=atomic" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target profile_update_atomic } */ + + /* Some side effect to stop branches from being pruned */ +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-22.c b/gcc/testsuite/gcc.misc-tests/gcov-22.c +index 7ca78467ca31..0c8aba6996da 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-22.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-22.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fcondition-coverage -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include + jmp_buf buf; +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-24.c b/gcc/testsuite/gcc.misc-tests/gcov-24.c +index 395099bd7ae3..335857da30cc 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-24.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-24.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main() + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-3.c b/gcc/testsuite/gcc.misc-tests/gcov-3.c +index 5b07dd74bd1b..5107f89d324a 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-3.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-3.c +@@ -1,4 +1,4 @@ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target label_values } */ + + /* Test Gcov with computed gotos. +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-4.c b/gcc/testsuite/gcc.misc-tests/gcov-4.c +index da7929ef7fcd..f792538e1f54 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-4.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-4.c +@@ -2,7 +2,7 @@ + correctly by gcov. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + extern void abort (void); + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-4b.c b/gcc/testsuite/gcc.misc-tests/gcov-4b.c +index da98749f719a..3a67b2f6bb5c 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-4b.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-4b.c +@@ -2,7 +2,7 @@ + correctly by gcov. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + extern void abort (void); + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-5b.c b/gcc/testsuite/gcc.misc-tests/gcov-5b.c +index cbd3958718cc..da53879bd33b 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-5b.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-5b.c +@@ -2,7 +2,7 @@ + that are large enough to hold the count. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #define LIMIT1 7000 + #define LIMIT2 7000 +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-6.c b/gcc/testsuite/gcc.misc-tests/gcov-6.c +index aefab3ed33a7..9b46d64214a7 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-6.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-6.c +@@ -4,7 +4,7 @@ + for call return percentages was added. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + extern void exit (int); + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-7.c b/gcc/testsuite/gcc.misc-tests/gcov-7.c +index 2e0f6e8b03c1..a5a20a0a3cd2 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-7.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-7.c +@@ -2,7 +2,7 @@ + * and call return percentages for functions that call longjmp. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-8.c b/gcc/testsuite/gcc.misc-tests/gcov-8.c +index 7223bde8374c..6e0eb918d5e4 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-8.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-8.c +@@ -6,7 +6,7 @@ + */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int proxy (int i) + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-9.c b/gcc/testsuite/gcc.misc-tests/gcov-9.c +index 6e1b4a85c0c5..ed8d57aa9342 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-9.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-9.c +@@ -1,7 +1,7 @@ + /* Test gcov block mode. */ + + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main () + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr83813.c b/gcc/testsuite/gcc.misc-tests/gcov-pr83813.c +index ac935b969f84..8604f1f72f06 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr83813.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr83813.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + union U + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr84758.c b/gcc/testsuite/gcc.misc-tests/gcov-pr84758.c +index 2ae6900375fa..a9530a14e24b 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr84758.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr84758.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int x, y; + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr85217.c b/gcc/testsuite/gcc.misc-tests/gcov-pr85217.c +index 86a3c4b5a129..cdc2b6fb91ef 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr85217.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr85217.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int a=0; + +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr85332.c b/gcc/testsuite/gcc.misc-tests/gcov-pr85332.c +index 73e50b19fc70..081afdcb0f90 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr85332.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr85332.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int doit(int sel, int n, void *p) + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr85338.c b/gcc/testsuite/gcc.misc-tests/gcov-pr85338.c +index d1e16d29c7a8..8416f478348b 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr85338.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr85338.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + void Test(long long Val, int Amt) + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr85350.c b/gcc/testsuite/gcc.misc-tests/gcov-pr85350.c +index 0383b81fdfb6..7bb8b0a359ca 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr85350.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr85350.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main (void) + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr85372.c b/gcc/testsuite/gcc.misc-tests/gcov-pr85372.c +index 7c90e68b0dce..10409bd490c4 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr85372.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr85372.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-require-effective-target indirect_jumps } */ + + void *buf[5]; +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c b/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c +index 481777359995..febfacd92431 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr86536.c +@@ -1,6 +1,6 @@ + // PR gcov-profile/86536 + // { dg-options "-fprofile-arcs -ftest-coverage" } +-// { dg-do run { target native } } ++// { dg-do run } + // { dg-require-fork "" } + + #include +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr90574-1.c b/gcc/testsuite/gcc.misc-tests/gcov-pr90574-1.c +index 41ac9bb3eccb..8a6fb09b831d 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr90574-1.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr90574-1.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main(int argc, char **argv) + { +diff --git a/gcc/testsuite/gcc.misc-tests/gcov-pr90574-2.c b/gcc/testsuite/gcc.misc-tests/gcov-pr90574-2.c +index 2db70c96f715..1b6f4517b3eb 100644 +--- a/gcc/testsuite/gcc.misc-tests/gcov-pr90574-2.c ++++ b/gcc/testsuite/gcc.misc-tests/gcov-pr90574-2.c +@@ -1,5 +1,5 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + int main(int argc, char **argv) + { +diff --git a/gcc/testsuite/gdc.dg/gcov1.d b/gcc/testsuite/gdc.dg/gcov1.d +index 10ffa4a0e308..048001663d5f 100644 +--- a/gcc/testsuite/gdc.dg/gcov1.d ++++ b/gcc/testsuite/gdc.dg/gcov1.d +@@ -1,5 +1,5 @@ + /* { dg-options "-fcondition-coverage -ftest-coverage" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + /* Some side effect to stop branches from being pruned. */ + int x = 0; +diff --git a/gcc/testsuite/gnat.dg/gcov/check.adb b/gcc/testsuite/gnat.dg/gcov/check.adb +index b3cb8e36b92d..737272b01c31 100644 +--- a/gcc/testsuite/gnat.dg/gcov/check.adb ++++ b/gcc/testsuite/gnat.dg/gcov/check.adb +@@ -1,5 +1,5 @@ + -- { dg-options "-fprofile-arcs -ftest-coverage" } +--- { dg-do run { target native } } */ ++-- { dg-do run } */ + + procedure Check is + +diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp +index dd47d66d1b2e..eed104569be5 100644 +--- a/gcc/testsuite/lib/gcov.exp ++++ b/gcc/testsuite/lib/gcov.exp +@@ -31,6 +31,23 @@ proc clean-gcov-file { testcase suffix } { + set basename [file tail $testcase] + set base [file rootname $basename] + remote_file host delete $base.$suffix ++ # The absolute path to the output when building on the host is ++ # used by the compiled program on the target to determine where ++ # the .gcda file goes there. ++ remote_file target delete [remote_file host absolute $base.$suffix] ++} ++ ++# Transfer the .gcda file for a test from the target to the host. ++ ++proc transfer-gcda { testcase } { ++ set basename [file tail $testcase] ++ set base [file rootname $basename] ++ # The absolute path to the output when building on the host is ++ # used by the compiled program on the target to determine where ++ # the .gcda file goes there. ++ set gcda [remote_file host absolute "$base.gcda"] ++ set gcda [remote_upload target $gcda] ++ remote_download host $gcda + } + + # +@@ -606,6 +623,14 @@ proc run-gcov { args } { + if { $gcov_remove_gcda } { + verbose "Removing $testcase.gcda" + clean-gcov-file $testcase "gcda" ++ } else { ++ transfer-gcda $testcase ++ global additional_sources_used ++ if [info exists additional_sources_used] { ++ foreach srcfile $additional_sources_used { ++ transfer-gcda $srcfile ++ } ++ } + } + + verbose "Running $GCOV $testcase" 2 diff --git a/gcc14-tests-guality-native.patch b/gcc14-tests-guality-native.patch new file mode 100644 index 0000000..af803bf --- /dev/null +++ b/gcc14-tests-guality-native.patch @@ -0,0 +1,232 @@ +commit 620c85fb709d27ab9c523f90dc027d05961fa3bd +Author: Joseph Myers +Date: Wed Jan 14 17:09:40 2026 +0000 + + testsuite: Fix issues with cross testing in guality tests + + The guality tests expect to run (native) GDB on the target. If this + is available, there is some support for cross testing, but with + various defects and limitations, some of them fixed here. + + * GUALITY_GDB_NAME doesn't get passed through to the target for remote + testing (a general limitation of the DejaGnu interface: it doesn't + support setting environment variables on the target). Not fixed + here. + + * Using in-tree GDB is only appropriate when host = target, since + in-tree GDB runs on the host and the testsuite runs GDB on the + target. Fixed here. (Note that [isnative] isn't used because that + refers to build = target, and we need host = target here.) + + * [transform gdb] is not appropriate because that's a cross-GDB and + the tests run GDB on the target, so need a native GDB. Fixed here. + + * gdb-test (used by some guality tests) exits early in cross and + remote cases (whereas the tests running GDB directly from the test + itself via popen can already do so on the target without needing + further patches). Fixed here. There are various other fixes done + in gdb-test as well; it needs to transfer files to the target then + delete them afterwards. + + * report_gdb expects to run GDB on the host when the tests run it on + the target. Fixed here. + + Note: some similar fixes will also be needed for simulate-thread tests + to get them working for cross testing, but I haven't done those yet. + + Tested for x86_64-pc-linux-gnu to make sure native testing isn't + broken, and with cross to aarch64-linux. + + * lib/gcc-gdb-test.exp (gdb-test): Do not return early for + non-native and remote. Download executable and GDB command file + to target before running GDB there, and delete when closing + target. + (report_gdb): Use target when testing GDB availability and + version. + * g++.dg/guality/guality.exp: Only use in-tree GDB when host = + target. Do not use [transform gdb]. + * gcc.dg/guality/guality.exp: Likewise. + * gfortran.dg/guality/guality.exp: Likewise. + +diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp +index 6de5e8091a50..695ed02b89bb 100644 +--- a/gcc/testsuite/g++.dg/guality/guality.exp ++++ b/gcc/testsuite/g++.dg/guality/guality.exp +@@ -40,14 +40,17 @@ dg-init + torture-init + + global GDB ++global host_triplet target_triplet + if ![info exists ::env(GUALITY_GDB_NAME)] { + if [info exists GDB] { + set guality_gdb_name "$GDB" +- } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { ++ } elseif { [string equal $host_triplet $target_triplet] ++ && [info exists rootme] ++ && [file exists $rootme/../gdb/gdb] } { + # If we're doing a combined build, and gdb is available, use it. + set guality_gdb_name "$rootme/../gdb/gdb" + } else { +- set guality_gdb_name "[transform gdb]" ++ set guality_gdb_name "gdb" + } + setenv GUALITY_GDB_NAME "$guality_gdb_name" + } +diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp +index 0dc8f10762d7..4d342aa51658 100644 +--- a/gcc/testsuite/gcc.dg/guality/guality.exp ++++ b/gcc/testsuite/gcc.dg/guality/guality.exp +@@ -40,14 +40,17 @@ dg-init + torture-init + + global GDB ++global host_triplet target_triplet + if ![info exists ::env(GUALITY_GDB_NAME)] { + if [info exists GDB] { + set guality_gdb_name "$GDB" +- } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { ++ } elseif { [string equal $host_triplet $target_triplet] ++ && [info exists rootme] ++ && [file exists $rootme/../gdb/gdb] } { + # If we're doing a combined build, and gdb is available, use it. + set guality_gdb_name "$rootme/../gdb/gdb" + } else { +- set guality_gdb_name "[transform gdb]" ++ set guality_gdb_name "gdb" + } + setenv GUALITY_GDB_NAME "$guality_gdb_name" + } +diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp +index 105e08a70d88..3ee157abf7b3 100644 +--- a/gcc/testsuite/gfortran.dg/guality/guality.exp ++++ b/gcc/testsuite/gfortran.dg/guality/guality.exp +@@ -21,14 +21,17 @@ dg-init + torture-init + + global GDB ++global host_triplet target_triplet + if ![info exists ::env(GUALITY_GDB_NAME)] { + if [info exists GDB] { + set guality_gdb_name "$GDB" +- } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { ++ } elseif { [string equal $host_triplet $target_triplet] ++ && [info exists rootme] ++ && [file exists $rootme/../gdb/gdb] } { + # If we're doing a combined build, and gdb is available, use it. + set guality_gdb_name "$rootme/../gdb/gdb" + } else { +- set guality_gdb_name "[transform gdb]" ++ set guality_gdb_name "gdb" + } + setenv GUALITY_GDB_NAME "$guality_gdb_name" + } +diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp +index 942853f183e6..f7c1da8fae25 100644 +--- a/gcc/testsuite/lib/gcc-gdb-test.exp ++++ b/gcc/testsuite/lib/gcc-gdb-test.exp +@@ -27,8 +27,6 @@ + # the literal string with extra whitespace removed. + # Argument 3 handles expected failures and the like + proc gdb-test { useline args } { +- if { ![isnative] || [is_remote target] } { return } +- + if { [llength $args] >= 4 } { + switch [dg-process-target [lindex $args 3]] { + "S" { } +@@ -80,11 +78,17 @@ proc gdb-test { useline args } { + puts $fd "quit" + close $fd + +- send_log "Spawning: $gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file\n" +- set res [remote_spawn target "$gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file"] ++ set cmd_file_remote [remote_download target $cmd_file] ++ set output_file_remote [remote_download target $output_file] ++ send_log "Spawning: $gdb_name -nx -nw -quiet -batch -x $cmd_file_remote $output_file_remote\n" ++ set res [remote_spawn target "$gdb_name -nx -nw -quiet -batch -x $cmd_file_remote $output_file_remote"] + if { $res < 0 || $res == "" } { + unsupported "$testname" + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + +@@ -94,6 +98,10 @@ proc gdb-test { useline args } { + unsupported "$testname" + remote_close target + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + # print var; print expected +@@ -110,6 +118,10 @@ proc gdb-test { useline args } { + } + remote_close target + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + # ptype var; +@@ -131,12 +143,20 @@ proc gdb-test { useline args } { + } + remote_close target + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + timeout { + unsupported "$testname" + remote_close target + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + } +@@ -144,6 +164,10 @@ proc gdb-test { useline args } { + unsupported "$testname" + remote_close target + file delete $cmd_file ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $output_file_remote ++ } + return + } + +@@ -152,15 +176,18 @@ proc gdb-test { useline args } { + # Argument 1 is the location where gdb is used + # + proc report_gdb { gdb loc } { +- if { [catch { exec which $gdb } msg] } { +- send_log "gdb not found in $loc: $msg\n" ++ set status [remote_exec target "which" "$gdb"] ++ set gdb [string trim [lindex $status 1]] ++ if { [lindex $status 0] != 0 } { ++ send_log "gdb not found in $loc: $gdb\n" + return + } +- set gdb [exec which $gdb] + send_log "gdb used in $loc: $gdb\n" + + send_log "gdb used in $loc: " +- if { [catch { exec $gdb -v } gdb_version] } { ++ set status [remote_exec target "$gdb" "-v"] ++ set gdb_version [lindex $status 1] ++ if { [lindex $status 0] != 0 } { + send_log "getting version failed:\n" + } else { + send_log "version:\n" diff --git a/gcc14-tests-installed-plugin.patch b/gcc14-tests-installed-plugin.patch new file mode 100644 index 0000000..35ee193 --- /dev/null +++ b/gcc14-tests-installed-plugin.patch @@ -0,0 +1,229 @@ +commit edf5b880b876938f9c66aa5859ea089911cde0ba +Author: Joseph Myers +Date: Mon Dec 15 17:58:20 2025 +0000 + + testsuite: Support plugin testing for installed compiler + + Plugin tests are currently only enabled for build-tree testing. + Enable them for installed testing as well, using + -print-file-name=plugin/include to locate the installed headers in + that case. + + Support is also added to contrib/test_installed for the associated + site.exp settings. Installed testing also shows up that some plugin + tests are using text-art/*.h headers that aren't currently installed, + so add those to PLUGIN_HEADERS. + + Bootstrapped with no regressions for x86_64-pc-linux-gnu, and also ran + plugin tests for an installed compiler with contrib/test_installed. + + contrib/ + * test_installed (--enable-plugin, --with-plugincc=) + (--with-plugincflags=, --with-gmpinc=): New options. + + gcc/ + * Makefile.in (PLUGIN_HEADERS): Add $(srcdir)/text-art/*.h. + (install-plugin): Preserve directory structure for text-art + headers. + + gcc/testsuite/ + * lib/plugin-support.exp (plugin-test-execute): Support installed + testing. + * g++.dg/plugin/plugin.exp, gcc.dg/plugin/plugin.exp, + obj-c++.dg/plugin/plugin.exp, objc.dg/plugin/plugin.exp: Do not + disable for installed testing. + +(Note: merge conflicts in gcc/Makefile.in in backporting to GCC 14.) + +diff --git a/contrib/test_installed b/contrib/test_installed +index 530d21ed74ec..9567ace54b3d 100755 +--- a/contrib/test_installed ++++ b/contrib/test_installed +@@ -49,6 +49,7 @@ while true; do + --srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --target=*) target=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --enable-plugin) ENABLE_PLUGIN=1; shift;; + --with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; +@@ -56,6 +57,9 @@ while true; do + --with-alt-cxx=*) ALT_CXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-compat-options=*) COMPAT_OPTIONS=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-libiconv=*) libiconv=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-plugincc=*) PLUGINCC=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-plugincflags=*) PLUGINCFLAGS=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-gmpinc=*) GMPINC=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --without-gcc) GCC_UNDER_TEST=no; shift;; + --without-g++) GXX_UNDER_TEST=no; shift;; + --without-gfortran) GFORTRAN_UNDER_TEST=no; shift;; +@@ -80,6 +84,7 @@ Supported arguments: + tested if different than the host. + + --prefix=/some/dir use gcc, g++ and gfortran from /some/dir/bin [PATH] ++--enable-plugin run GCC plugin tests + --with-gcc=/some/dir/bin/gcc use specified gcc program [gcc] + --with-g++=/some/dir/bin/g++ use specified g++ program [g++] + --with-gfortran=/some/dir/bin/gfortran use specified gfortran program [gfortran] +@@ -87,6 +92,9 @@ Supported arguments: + --with-alt-cxx=/some/compiler use specified alternative compiler in compat tests + --with-compat-options=opts use specified COMPAT_OPTIONS in compat tests + --with-libiconv=linker-args use given arguments to link with iconv [-liconv] ++--with-plugincc=/some/c++ use given host compiler to build plugins [g++] ++--with-plugincflags=args use given options to build plugins [-g -O2] ++--with-gmpinc=args use given options to find GMP for host [] + --without-gcc do not run gcc testsuite + --without-g++ do not run g++ testsuite + --without-gfortran do not run gfortran testsuite +@@ -146,6 +154,12 @@ fi + if test x"$COMPAT_OPTIONS" != x; then + echo "set COMPAT_OPTIONS \"${COMPAT_OPTIONS}\"" >> site.exp + fi ++if test x"$ENABLE_PLUGIN" != x; then ++ echo "set ENABLE_PLUGIN \"${ENABLE_PLUGIN}\"" >> site.exp ++ echo "set PLUGINCC \"${PLUGINCC-g++}\"" >> site.exp ++ echo "set PLUGINCFLAGS \"${PLUGINCFLAGS--g -O2}\"" >> site.exp ++ echo "set GMPINC \"${GMPINC}\"" >> site.exp ++fi + + test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"} + test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"} +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index d475bf1c32ec..2022544cf830 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3858,7 +3858,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + hash-set.h dominance.h cfg.h cfgrtl.h cfganal.h cfgbuild.h cfgcleanup.h \ + lcm.h cfgloopmanip.h file-prefix-map.h builtins.def $(INSN_ATTR_H) \ + pass-instances.def params.list $(srcdir)/../include/gomp-constants.h \ +- $(EXPR_H) $(srcdir)/analyzer/*.h ++ $(EXPR_H) $(srcdir)/analyzer/*.h $(srcdir)/text-art/*.h + + # generate the 'build fragment' b-header-vars + s-header-vars: Makefile +@@ -3896,6 +3896,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype + fi; \ + case $$path in \ + "$(srcdir)"/analyzer/* \ ++ | "$(srcdir)"/text-art/* \ + | "$(srcdir)"/config/* | "$(srcdir)"/common/config/* \ + | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \ + base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \ +diff --git a/gcc/testsuite/g++.dg/plugin/plugin.exp b/gcc/testsuite/g++.dg/plugin/plugin.exp +index 9410fea6d7d9..2615f31158cb 100644 +--- a/gcc/testsuite/g++.dg/plugin/plugin.exp ++++ b/gcc/testsuite/g++.dg/plugin/plugin.exp +@@ -19,12 +19,10 @@ + load_lib target-supports.exp + load_lib g++-dg.exp + +-global TESTING_IN_BUILD_TREE + global ENABLE_PLUGIN + +-# The plugin testcases currently only work when the build tree is available. +-# Also check whether the host supports plugins. +-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { ++# Check whether the host supports plugins. ++if { ![info exists ENABLE_PLUGIN] } { + return + } + +diff --git a/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc/testsuite/gcc.dg/plugin/plugin.exp +index 83ef1b2dd939..9894b4a46157 100644 +--- a/gcc/testsuite/gcc.dg/plugin/plugin.exp ++++ b/gcc/testsuite/gcc.dg/plugin/plugin.exp +@@ -19,12 +19,10 @@ + load_lib target-supports.exp + load_lib gcc-dg.exp + +-global TESTING_IN_BUILD_TREE + global ENABLE_PLUGIN + +-# The plugin testcases currently only work when the build tree is available. +-# Also check whether the host supports plugins. +-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { ++# Check whether the host supports plugins. ++if { ![info exists ENABLE_PLUGIN] } { + return + } + +diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp +index 9188adbdf2f7..b2e76a799314 100644 +--- a/gcc/testsuite/lib/plugin-support.exp ++++ b/gcc/testsuite/lib/plugin-support.exp +@@ -62,9 +62,11 @@ proc plugin-get-options { src } { + proc plugin-test-execute { plugin_src plugin_tests } { + global srcdir objdir + global verbose ++ global tool + global GMPINC + global PLUGINCC + global PLUGINCFLAGS ++ global TESTING_IN_BUILD_TREE + + set basename [file tail $plugin_src] + set base [file rootname $basename] +@@ -76,16 +78,17 @@ proc plugin-test-execute { plugin_src plugin_tests } { + # Build the plugin itself + set extra_flags [plugin-get-options $plugin_src] + +- # Note that the plugin test support currently only works when the GCC +- # build tree is available. (We make sure that is the case in plugin.exp.) +- # Once we have figured out how/where to package/install GCC header files +- # for general plugin support, we should modify the following include paths +- # accordingly. +- set gcc_srcdir "$srcdir/../.." +- set gcc_objdir "$objdir/../../.." +- set includes "-I. -I${srcdir} -I${gcc_srcdir}/gcc -I${gcc_objdir}/gcc \ ++ if { [info exists TESTING_IN_BUILD_TREE] } { ++ set gcc_srcdir "$srcdir/../.." ++ set gcc_objdir "$objdir/../../.." ++ set includes "-I. -I${srcdir} -I${gcc_srcdir}/gcc -I${gcc_objdir}/gcc \ + -I${gcc_srcdir}/include -I${gcc_srcdir}/libcpp/include \ + $GMPINC -I${gcc_objdir}/gettext/intl" ++ } else { ++ set options [list "additional_flags=-print-file-name=plugin/include"] ++ set plugin_inc [lindex [${tool}_target_compile "" "" "none" $options] 0] ++ set includes "-I. -I${srcdir} -I${plugin_inc} $GMPINC" ++ } + + if { [ ishost *-*-darwin* ] } { + # -mdynamic-no-pic is incompatible with -fPIC. +diff --git a/gcc/testsuite/obj-c++.dg/plugin/plugin.exp b/gcc/testsuite/obj-c++.dg/plugin/plugin.exp +index ad2ca18bf20b..1de7df886c02 100644 +--- a/gcc/testsuite/obj-c++.dg/plugin/plugin.exp ++++ b/gcc/testsuite/obj-c++.dg/plugin/plugin.exp +@@ -19,12 +19,10 @@ + load_lib target-supports.exp + load_lib obj-c++-dg.exp + +-global TESTING_IN_BUILD_TREE + global ENABLE_PLUGIN + +-# The plugin testcases currently only work when the build tree is available. +-# Also check whether the host supports plugins. +-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { ++# Check whether the host supports plugins. ++if { ![info exists ENABLE_PLUGIN] } { + return + } + +diff --git a/gcc/testsuite/objc.dg/plugin/plugin.exp b/gcc/testsuite/objc.dg/plugin/plugin.exp +index d03ec729aa7e..a508a433fcf2 100644 +--- a/gcc/testsuite/objc.dg/plugin/plugin.exp ++++ b/gcc/testsuite/objc.dg/plugin/plugin.exp +@@ -19,12 +19,10 @@ + load_lib target-supports.exp + load_lib objc-dg.exp + +-global TESTING_IN_BUILD_TREE + global ENABLE_PLUGIN + +-# The plugin testcases currently only work when the build tree is available. +-# Also check whether the host supports plugins. +-if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } { ++# Check whether the host supports plugins. ++if { ![info exists ENABLE_PLUGIN] } { + return + } + diff --git a/gcc14-tests-installed-site-exp.patch b/gcc14-tests-installed-site-exp.patch new file mode 100644 index 0000000..49558a0 --- /dev/null +++ b/gcc14-tests-installed-site-exp.patch @@ -0,0 +1,92 @@ +commit a7b8c5faa6ff3d9bcc15457113e611ec377c6f5f +Author: Joseph Myers +Date: Mon Dec 8 17:02:22 2025 +0000 + + contrib: Set more site.exp variables in test_installed + + Add support in contrib/test_installed for more variables (via + associated command-line options to the script) that gcc/Makefile.in + can set: + + * ALT_CC_UNDER_TEST, ALT_CXX_UNDER_TEST and COMPAT_OPTIONS are used in + compat testing (against the same or a different compiler). + + * The libiconv variable is used for testing iconv support for + particular character sets, and defaults to -liconv if not set in + site.exp, which is wrong on systems with iconv in libc; keep the + default, but add an option to override this. + + Note that the dg-require-iconv testing is currently bogus in a cross + environment, and this patch does nothing to address that. The tests + using dg-require-iconv actually care about character set support on + the *host*, for character conversions carried out in the compiler, + and the libiconv setting put in site.exp by gcc/Makefile.in is a + *host* library setting. But dg-require-iconv / + check_iconv_available tests availability when compiling, linking and + executing for the *target*. If the host and target have close + enough to the same OS, this may work by accident, but otherwise it + will incorrectly enable / disable these tests based on target + information (but using a libiconv setting designed for the host) + when it should be based on host information. + + * test_installed (--with-alt-cc=, --with-alt-cxx=) + (--with-compat-options=, --with-libiconv=): New options. + +diff --git a/contrib/test_installed b/contrib/test_installed +index 77492cabe171..42c3f12b7d78 100755 +--- a/contrib/test_installed ++++ b/contrib/test_installed +@@ -42,6 +42,7 @@ if test -f site.exp; then + exit 1 + fi + ++libiconv=-liconv + while true; do + case "$1" in + --with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;; +@@ -51,6 +52,10 @@ while true; do + --with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-alt-cc=*) ALT_CC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-alt-cxx=*) ALT_CXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-compat-options=*) COMPAT_OPTIONS=`echo "$1" | sed 's/[^=]*=//'`; shift;; ++ --with-libiconv=*) libiconv=`echo "$1" | sed 's/[^=]*=//'`; shift;; + --without-gcc) GCC_UNDER_TEST=no; shift;; + --without-g++) GXX_UNDER_TEST=no; shift;; + --without-gfortran) GFORTRAN_UNDER_TEST=no; shift;; +@@ -78,6 +83,10 @@ Supported arguments: + --with-gcc=/some/dir/bin/gcc use specified gcc program [gcc] + --with-g++=/some/dir/bin/g++ use specified g++ program [g++] + --with-gfortran=/some/dir/bin/gfortran use specified gfortran program [gfortran] ++--with-alt-cc=/some/compiler use specified alternative compiler in compat tests ++--with-alt-cxx=/some/compiler use specified alternative compiler in compat tests ++--with-compat-options=opts use specified COMPAT_OPTIONS in compat tests ++--with-libiconv=linker-args use given arguments to link with iconv [-liconv] + --without-gcc do not run gcc testsuite + --without-g++ do not run g++ testsuite + --without-gfortran do not run gfortran testsuite +@@ -108,6 +117,7 @@ cat >site.exp <> site.exp + echo "set target_alias $target" >> site.exp + fi ++if test x"$ALT_CC_UNDER_TEST" != x; then ++ echo "set ALT_CC_UNDER_TEST \"${ALT_CC_UNDER_TEST}\"" >> site.exp ++fi ++if test x"$ALT_CXX_UNDER_TEST" != x; then ++ echo "set ALT_CXX_UNDER_TEST \"${ALT_CXX_UNDER_TEST}\"" >> site.exp ++fi ++if test x"$COMPAT_OPTIONS" != x; then ++ echo "set COMPAT_OPTIONS \"${COMPAT_OPTIONS}\"" >> site.exp ++fi + + test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"} + test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"} diff --git a/gcc14-tests-installed-target.patch b/gcc14-tests-installed-target.patch new file mode 100644 index 0000000..12a2fac --- /dev/null +++ b/gcc14-tests-installed-target.patch @@ -0,0 +1,54 @@ +commit 311d2829db18a24c2e46d0434f463ebc1df00a56 +Author: Joseph Myers +Date: Thu Dec 11 23:20:54 2025 +0000 + + contrib: Use config.sub in test_installed + + Correctly running GCC testsuites with an installed compiler requires + both the canonical and noncanonical versions of the target triplet: + the canonical one for where the testsuite matches on target triplets, + and the noncanonical one for various "transform" calls used to find + binutils programs. Make test_installed use config.sub to determine + the canonical target from any value passed with --target= (and thus + make logic to locate the toplevel source directory from its own + location unconditional, as it's now used to locate config.sub). + + * test_installed: Use config.sub to determine canonical target. + +diff --git a/contrib/test_installed b/contrib/test_installed +index 42c3f12b7d78..530d21ed74ec 100755 +--- a/contrib/test_installed ++++ b/contrib/test_installed +@@ -104,13 +104,16 @@ EOF + *) break;; + esac + done +- ++ ++# Determine the source directory to find config.sub, whether or not ++# that is also used to locate the testsuite sources. ++file=$0 ++while [ -h $file ]; do ++ file=`ls -l $file | sed s/'.* -> '//` ++done ++top_srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}` + if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then +- file=$0 +- while [ -h $file ]; do +- file=`ls -l $file | sed s/'.* -> '//` +- done +- srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}` ++ srcdir=$top_srcdir + fi + + cat >site.exp <> site.exp ++ target_canonical=`$top_srcdir/config.sub $target` ++ echo "set target_triplet $target_canonical" >> site.exp + echo "set target_alias $target" >> site.exp + fi + if test x"$ALT_CC_UNDER_TEST" != x; then diff --git a/gcc14-tests-misc-native.patch b/gcc14-tests-misc-native.patch new file mode 100644 index 0000000..9508046 --- /dev/null +++ b/gcc14-tests-misc-native.patch @@ -0,0 +1,69 @@ +commit 5bebe71d30b9c7d1479a9b8c0de342bf3ada4b8b +Author: Joseph Myers +Date: Mon Jan 19 21:16:46 2026 +0000 + + testsuite: Do not restrict five tests to { target native } + + Five miscellaneous tests use { target native }, while not doing + anything that actually needs some kind of special handling for cross + testing. Remove the { target native } restriction from those tests. + + Tested for x86_64-pc-linux-gnu, and with cross to aarch64-linux. + + * g++.old-deja/g++.mike/eh30.C, g++.old-deja/g++.mike/p4750.C, + g++.old-deja/g++.robertl/eb106.C, g++.old-deja/g++.robertl/eb83.C, + gcc.dg/20020201-1.c: Do not use { target native }. + +diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C +index 848809245c14..31c2c856f0c2 100644 +--- a/gcc/testsuite/g++.old-deja/g++.mike/eh30.C ++++ b/gcc/testsuite/g++.old-deja/g++.mike/eh30.C +@@ -1,4 +1,4 @@ +-// { dg-do assemble { target native } } ++// { dg-do assemble } + // { dg-options "-fexceptions -fPIC -S" } + + int +diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p4750.C b/gcc/testsuite/g++.old-deja/g++.mike/p4750.C +index ccf462be00d4..f9353e529fab 100644 +--- a/gcc/testsuite/g++.old-deja/g++.mike/p4750.C ++++ b/gcc/testsuite/g++.old-deja/g++.mike/p4750.C +@@ -1,4 +1,4 @@ +-// { dg-do assemble { target native } } ++// { dg-do assemble } + // { dg-options "-fpic -pedantic-errors -S" } + // prms-id: 4750 + +diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C +index b341cff55023..3f4dce099fe8 100644 +--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C ++++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb106.C +@@ -1,4 +1,4 @@ +-// { dg-do assemble { target native } } ++// { dg-do assemble } + // { dg-options "-O2 -fPIC " } + struct T + { +diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C +index 47cf5b88f041..41e8ff629979 100644 +--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C ++++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C +@@ -1,4 +1,4 @@ +-// { dg-do run { target native } } ++// { dg-do run } + // { dg-options "-fprofile-arcs -ftest-coverage" } + void + test_swap(int& x, int& y) throw() +diff --git a/gcc/testsuite/gcc.dg/20020201-1.c b/gcc/testsuite/gcc.dg/20020201-1.c +index 1cb2a8788044..fb48a230e962 100644 +--- a/gcc/testsuite/gcc.dg/20020201-1.c ++++ b/gcc/testsuite/gcc.dg/20020201-1.c +@@ -5,7 +5,7 @@ + call-clobbered global pointer. */ + + /* { dg-options "-fprofile-arcs" } */ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + + #include + diff --git a/gcc14-tests-simulate-thread-native.patch b/gcc14-tests-simulate-thread-native.patch new file mode 100644 index 0000000..a72c510 --- /dev/null +++ b/gcc14-tests-simulate-thread-native.patch @@ -0,0 +1,115 @@ +commit 3119cfc9118eb8545dac9bf765c93f762ad8794a +Author: Joseph Myers +Date: Wed Jan 14 17:10:33 2026 +0000 + + testsuite: Enable cross testing for simulate-thread tests + + The simulate-thread tests exit early in cross and remote cases. Apply + fixes similar to (but affecting separate code) those recently posted + for the guality tests: do not use [transform gdb] since that's a cross + GDB and the tests expect to run GDB on the target, test existence on + the target not the build system, and copy required files to the target + (deleting them later). + + Tested for x86_64-pc-linux-gnu to make sure native testing isn't + broken, and with cross to aarch64-linux. + + * lib/gcc-dg.exp (gdb-exists): Do not use [transform gdb]. Run + selected GDB with -v on target rather than testing for existence + on build system. + * lib/gcc-simulate-thread.exp (simulate-thread): Do not return + early for non-native and remote. Download executable and GDB + command file to target before running GDB there, and delete when + closing target. + +diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp +index 87dddb8cd8ac..f2e5228fff58 100644 +--- a/gcc/testsuite/lib/gcc-dg.exp ++++ b/gcc/testsuite/lib/gcc-dg.exp +@@ -1374,11 +1374,12 @@ proc gdb-exists { args } { + if [info exists GDB] { + setenv GDB_FOR_GCC_TESTING "$GDB" + } else { +- setenv GDB_FOR_GCC_TESTING "[transform gdb]" ++ setenv GDB_FOR_GCC_TESTING "gdb" + } + } + } +- if { [which $::env(GDB_FOR_GCC_TESTING)] != 0 } { ++ if { [lindex [remote_exec target "$::env(GDB_FOR_GCC_TESTING)" "-v"] 0] ++ == 0 } { + return 1; + } + return 0; +diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp b/gcc/testsuite/lib/gcc-simulate-thread.exp +index 115b636e603d..dcbcd3dc08ef 100644 +--- a/gcc/testsuite/lib/gcc-simulate-thread.exp ++++ b/gcc/testsuite/lib/gcc-simulate-thread.exp +@@ -24,8 +24,6 @@ load_lib timeout.exp + # Call 'fail' if a given test printed "FAIL:", otherwise call 'pass'. + + proc simulate-thread { args } { +- if { ![isnative] || [is_remote target] } { return } +- + if { [llength $args] == 1 } { + switch [dg-process-target [lindex $args 0]] { + "F" { setup_xfail "*-*-*" } +@@ -49,10 +47,16 @@ proc simulate-thread { args } { + + set message "thread simulation test" + +- send_log "Spawning: $gdb_name -nx -nw -batch -x $cmd_file ./$exec_file\n" +- set res [remote_spawn target "$gdb_name -nx -nw -batch -x $cmd_file ./$exec_file"] ++ set cmd_file_remote [remote_download target $cmd_file] ++ set exec_file_remote [remote_download target $exec_file] ++ send_log "Spawning: $gdb_name -nx -nw -batch -x $cmd_file_remote $exec_file_remote\n" ++ set res [remote_spawn target "$gdb_name -nx -nw -batch -x $cmd_file_remote $exec_file_remote"] + if { $res < 0 || $res == "" } { + unsupported "$testcase $message" ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $exec_file_remote ++ } + return + } + +@@ -62,11 +66,19 @@ proc simulate-thread { args } { + # Too old GDB + -re "Unhandled dwarf expression|Error in sourced command file" { + unsupported "$testcase $message" ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $exec_file_remote ++ } + remote_close target + return + } + -re "FAIL:" { + fail "$testcase $message" ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $exec_file_remote ++ } + remote_close target + return + } +@@ -79,11 +91,19 @@ proc simulate-thread { args } { + } + timeout { + fail "$testcase $message" ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $exec_file_remote ++ } + remote_close target + return + } + } + ++ if { [is_remote target] } { ++ remote_file target delete $cmd_file_remote ++ remote_file target delete $exec_file_remote ++ } + remote_close target + if {$gdb_worked} { + pass "$testcase $message" diff --git a/gcc14-tests-ssp-native.patch b/gcc14-tests-ssp-native.patch new file mode 100644 index 0000000..0083c8b --- /dev/null +++ b/gcc14-tests-ssp-native.patch @@ -0,0 +1,55 @@ +commit 531150b1ac41a6aebfa39dec28730c9f3b10a930 +Author: Joseph Myers +Date: Tue Jan 6 22:11:20 2026 +0000 + + testsuite: Do not restrict stack protector tests to native testing + + Three stack protector tests in gcc.dg use + + /* { dg-do run { target native } } */ + + for no apparent reason, since there is nothing in those tests that + should care about the difference between native and cross testing. + They also have + + /* { dg-require-effective-target fstack_protector } */ + + which is the actually relevant condition for such tests. Remove the + { target native } restriction. + + Tested natively for x86_64-pc-linux-gnu, and with cross to + aarch64-linux. + + * gcc.dg/ssp-1.c, gcc.dg/ssp-2.c, gcc.dg/stackprotectexplicit1.c: + Do not restrict to { target native }. + +diff --git a/gcc/testsuite/gcc.dg/ssp-1.c b/gcc/testsuite/gcc.dg/ssp-1.c +index db693327f701..74cdb96049c9 100644 +--- a/gcc/testsuite/gcc.dg/ssp-1.c ++++ b/gcc/testsuite/gcc.dg/ssp-1.c +@@ -1,4 +1,4 @@ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-options "-fstack-protector" } */ + /* { dg-require-effective-target fstack_protector } */ + +diff --git a/gcc/testsuite/gcc.dg/ssp-2.c b/gcc/testsuite/gcc.dg/ssp-2.c +index 608ca3000323..22f31d994081 100644 +--- a/gcc/testsuite/gcc.dg/ssp-2.c ++++ b/gcc/testsuite/gcc.dg/ssp-2.c +@@ -1,4 +1,4 @@ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-options "-fstack-protector" } */ + /* { dg-options "-fstack-protector -Wl,-multiply_defined,suppress" { target *-*-darwin* } } */ + /* { dg-prune-output "-multiply_defined is obsolete" } */ +diff --git a/gcc/testsuite/gcc.dg/stackprotectexplicit1.c b/gcc/testsuite/gcc.dg/stackprotectexplicit1.c +index 658c297d9f58..bb59b7fadd1f 100644 +--- a/gcc/testsuite/gcc.dg/stackprotectexplicit1.c ++++ b/gcc/testsuite/gcc.dg/stackprotectexplicit1.c +@@ -1,4 +1,4 @@ +-/* { dg-do run { target native } } */ ++/* { dg-do run } */ + /* { dg-options "-fstack-protector-explicit" } */ + /* { dg-require-effective-target fstack_protector } */ + diff --git a/gcc14-tests-tree-prof-native.patch b/gcc14-tests-tree-prof-native.patch new file mode 100644 index 0000000..2e47c08 --- /dev/null +++ b/gcc14-tests-tree-prof-native.patch @@ -0,0 +1,63 @@ +commit e373a57b07de9290e8e3f6913f4179404f0b886e +Author: Joseph Myers +Date: Mon Jan 26 16:49:29 2026 +0000 + + testsuite: Make profopt-execute also copy profile data for dg-additional-sources + + Most gcc.dg/tree-prof tests work correctly in environments where .gcda + files from the first run need to be copied from the target, because + there is existing code in profopt-execute to do so. A few tests using + dg-additional-sources fail because that code only copies the .gcda + file for the main test source file. Add similar code to copy it for + any sources listed in dg-additional-sources as well. + + The use of additional_sources_used is consistent with what + profopt-target-cleanup does. It turns out to require the added call + to cleanup-after-saved-dg-test to avoid additional_sources_used + leaking from one test into the next. + + Tested for x86_64-pc-linux-gnu to make sure native testing isn't + broken, and with cross to aarch64-linux. + + * lib/profopt.exp (profopt-execute): Also copy profile data from + target for additional sources. Call cleanup-after-saved-dg-test + before normal return. + +diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp +index 3188ba8a5348..c9f5ae53d499 100644 +--- a/gcc/testsuite/lib/profopt.exp ++++ b/gcc/testsuite/lib/profopt.exp +@@ -312,6 +312,7 @@ proc profopt-execute { src } { + global generate_final_code use_final_code + global verbose + global testname_with_flags ++ global additional_sources_used + + if ![info exists profile_option] { + error "No profile option specified for first compile." +@@ -474,6 +475,19 @@ proc profopt-execute { src } { + set missing_file 1 + fail "$testcase execution: file $bprefix$base.$ext does not exist, $option $profile_option" + } ++ if [info exists additional_sources_used] { ++ foreach srcfile $additional_sources_used { ++ set add_basename [file tail $srcfile] ++ set add_base [file rootname $add_basename] ++ remote_upload target $tmpdir/$bprefix$add_base.$ext ++ set files [glob -nocomplain $bprefix$add_base.$ext] ++ if { $files == "" } { ++ set status "fail" ++ set missing_file 1 ++ fail "$testcase execution: file $bprefix$add_base.$ext does not exist, $option $profile_option" ++ } ++ } ++ } + } + } + if { $missing_file == 0 } { +@@ -606,4 +620,5 @@ proc profopt-execute { src } { + } + } + unset testname_with_flags ++ cleanup-after-saved-dg-test + } diff --git a/sources b/sources index edadb95..bd2da1b 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (gcc-14.3.1-20250617.tar.xz) = 5b5f35f56e6e3ddcb94a72756af316b6520bd4c3d740553c88f99d91101bd99a6e4d50b7cd677159327b08bc91903939e97f1004f2dfaabd2085501e63dc061e +SHA512 (gcc-14.3.1-20251022.tar.xz) = fcd1c6dc02bf8edbac229f582fc6c3550554dba4c00d0521b7c5d9411a2488f4163e598e4c564e445b2b2538d6e2f4436c054852e1b46018e2e74dbae930174e SHA512 (isl-0.24.tar.bz2) = aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c38231af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95 SHA512 (newlib-cygwin-d45261f62a15f8abd94a1031020b9a9f455e4eed.tar.xz) = 31bfc19429797236e268e22b752c5abeabb9c0f39b1058634af8dab329b4f028fc72a35888193c9575f6cee5cf2c069669d79fcb4d4e3a4318f57413452f707d SHA512 (nvptx-tools-87ce9dc5999e5fca2e1d3478a30888d9864c9804.tar.xz) = 941e763af8601b89f0e4ec48a2d68ae0a8e70ee1e6ba6859394b021ad7bd7d143cc529f3c35c08d7f84e5554980ddcc97cf05b6c4755c2bc36c91161b79e8cea