https://gcc.gnu.org/g:18b148bccc683473e2545c9098ebab7d8eb96ca7
commit 18b148bccc683473e2545c9098ebab7d8eb96ca7 Author: Michael Meissner <meiss...@linux.ibm.com> Date: Sat Jun 15 02:57:27 2024 -0400 Do not build libgcc if GCC is not configured for at least power8 2024-06-15 Michael Meissner <meiss...@linux.ibm.com> libgcc/ * config.host (powerpc*-linux*): Do not build the IEEE 128-bit support libraries unless GCC is configured for at least power8 by default. * configure.ac (powerpc*-linux*): Likewise. * configure: Regenerate. Diff: --- libgcc/config.host | 14 ++++++++------ libgcc/configure | 9 ++++++++- libgcc/configure.ac | 9 ++++++++- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/libgcc/config.host b/libgcc/config.host index 9fae51d4ce7d..9e3b21e98fdd 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1290,16 +1290,18 @@ powerpc*-*-linux*) ;; esac + # If the compiler is not configured for IEEE 128-bit, do not include the + # power9 and power10 hardware support libraries if test $libgcc_cv_powerpc_float128 = yes; then tmake_file="${tmake_file} rs6000/t-float128" - fi - if test $libgcc_cv_powerpc_float128_hw = yes; then - tmake_file="${tmake_file} rs6000/t-float128-hw" - fi + if test $libgcc_cv_powerpc_float128_hw = yes; then + tmake_file="${tmake_file} rs6000/t-float128-hw" - if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then - tmake_file="${tmake_file} rs6000/t-float128-p10-hw" + if test $libgcc_cv_powerpc_3_1_float128_hw = yes; then + tmake_file="${tmake_file} rs6000/t-float128-p10-hw" + fi + fi fi extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o" diff --git a/libgcc/configure b/libgcc/configure index a69d314374a3..f61c9c9b3937 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -5184,9 +5184,16 @@ case ${host} in # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if # a new glibc is being used so that __builtin_cpu_supports can be used. +# +# Originally we added -mabi=altivec -mvsx to the tests to see if we could +# support IEEE 128-bit. This would mean that even if the compiler was +# configured for power5, it would build the IEEE 128-bit libraries by adding +# -mvsx. Instead if you want IEEE 128-bit support, you have to configure the +# compiler to build ISA 2.06 (power8) by default. We do add -mfloat128 to +# cater to systems where IEEE 128-bit might not be enabled by default. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" + CFLAGS="$CFLAGS -mfloat128" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5 $as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; } if ${libgcc_cv_powerpc_float128+:} false; then : diff --git a/libgcc/configure.ac b/libgcc/configure.ac index c2749fe09584..d9941c0b1a6a 100644 --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -407,9 +407,16 @@ case ${host} in # check if we have VSX (ISA 2.06) support to build the software libraries, and # whether the assembler can handle xsaddqp for hardware support. Also check if # a new glibc is being used so that __builtin_cpu_supports can be used. +# +# Originally we added -mabi=altivec -mvsx to the tests to see if we could +# support IEEE 128-bit. This would mean that even if the compiler was +# configured for power5, it would build the IEEE 128-bit libraries by adding +# -mvsx. Instead if you want IEEE 128-bit support, you have to configure the +# compiler to build ISA 2.06 (power8) by default. We do add -mfloat128 to +# cater to systems where IEEE 128-bit might not be enabled by default. powerpc*-*-linux*) saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128" + CFLAGS="$CFLAGS -mfloat128" AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries], [libgcc_cv_powerpc_float128], [AC_COMPILE_IFELSE(