diff --git a/gcc.spec b/gcc.spec index e6e2398..8b026ab 100644 --- a/gcc.spec +++ b/gcc.spec @@ -166,7 +166,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}%{?dist} +Release: %{gcc_release}.1%{?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 @@ -340,6 +340,12 @@ 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 + # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. %ifnarch %{arm} @@ -955,6 +961,20 @@ 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} @@ -994,6 +1014,20 @@ 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} @@ -1033,6 +1067,20 @@ 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 @@ -1093,6 +1141,30 @@ AutoReqProv: no 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~ @@ -1126,6 +1198,11 @@ touch -r isl-0.24/m4/ax_prog_cxx_for_build.m4 isl-0.24/m4/ax_prog_cc_for_build.m %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 + %ifarch %{arm} rm -f gcc/testsuite/go.test/test/fixedbugs/issue19182.go %endif @@ -1514,7 +1591,7 @@ CONFIGURE_OPTS_NATIVE="\ CONFIGURE_OPTS="$CONFIGURE_OPTS_BASE $CONFIGURE_OPTS_NATIVE" CONFIGURE_OPTS_CROSS="\ - --enable-languages=c,c++ --disable-bootstrap --disable-libsanitizer \ + --enable-languages=c,c++ --disable-bootstrap \ --host=%{gcc_target_platform} --build=%{gcc_target_platform} \ --disable-multilib --disable-libstdcxx-pch --disable-libcc1 \ " @@ -1862,6 +1939,11 @@ for crossarch in %{cross_targets}; do 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 @@ -1869,6 +1951,8 @@ for crossarch in %{cross_targets}; do %if %{build_libitm} mv $crossarch/libitm/libitm.spec $CROSS_LIBPATH %endif + # Likewise for libsanitizer.spec + mv $crossarch/libsanitizer/libsanitizer.spec $CROSS_LIBPATH cd .. @@ -1917,6 +2001,14 @@ INPUT ( =/%{_prefix}/lib64/libstdc++.so.6 )" > $CROSS_LIBPATH/libstdc++.so 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 @@ -1939,6 +2031,47 @@ INPUT ( =%{_prefix}/lib64/libitm.so.1 )" > $CROSS_LIBPATH/libitm.so 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 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 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 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 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 + # Help plugins find out nvra. echo gcc-%{version}-%{release}.%{_arch} > $CROSS_LIBPATH/rpmver @@ -2777,21 +2910,39 @@ 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_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; do + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libitm.a \ + %{_prefix}/lib64/libasan.so.8 \ + %{_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_preinit.o \ + %{_prefix}/lib64/liblsan.so.0 \ + %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o \ + %{_prefix}/lib64/libubsan.so.1; 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} @@ -2842,7 +2993,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 \ @@ -4102,11 +4253,13 @@ end %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 @@ -4121,6 +4274,15 @@ end %{_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.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_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.so +%{_prefix}/lib/gcc/aarch64-redhat-linux/%{gcc_major}/libtsan_preinit.o +%{_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.so %files -n cross-gcc-c++-aarch64 %{_prefix}/bin/aarch64-redhat-linux-c++ @@ -4130,8 +4292,22 @@ end # 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 @@ -4150,11 +4326,13 @@ end %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 @@ -4169,6 +4347,13 @@ end %{_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.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_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.so +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/liblsan_preinit.o +%{_prefix}/lib/gcc/ppc64le-redhat-linux/%{gcc_major}/libubsan.so %files -n cross-gcc-c++-ppc64le %{_prefix}/bin/ppc64le-redhat-linux-c++ @@ -4178,8 +4363,22 @@ end # 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 @@ -4198,11 +4397,13 @@ end %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 @@ -4217,6 +4418,13 @@ end %{_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.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libasan_preinit.o +%{_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.so +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/liblsan_preinit.o +%{_prefix}/lib/gcc/s390x-redhat-linux/%{gcc_major}/libubsan.so %files -n cross-gcc-c++-s390x %{_prefix}/bin/s390x-redhat-linux-c++ @@ -4226,8 +4434,22 @@ end # 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 @@ -4244,6 +4466,8 @@ end %{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 @@ -4254,7 +4478,39 @@ end %{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_preinit.o +%if %{build_libhwasan} +%{sysroot_prefix}%{_prefix}/lib64/libhwasan.so.0 +%{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_preinit.o +%{sysroot_prefix}%{_prefix}/lib64/liblsan.so.0 +%{sysroot_prefix}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o +%{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 +* 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, 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-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