When we started down the road of transitioning long double to IEEE 128-bit, we
thought the only way to do it was to add multi-lib support.  Since then with
work underway in both GLIBC and libstdc++ we no longer feel that we need to use
multilibs.

The code as it is now for GCC 8.x and trunk will automatically build multilibs
on little endian PowerPC Linux by default unless you configure the compiler
with --disable-multilib.  However, things will fail unless the target GLIBC
directory is set up for multlibs.

This code disables the automatic multilib creation unless you use the
--with-advance-toolchain=<xxx> option and the Advance Toolchain directoy has
been modified to have the lib64/ieee128 and/or lib64/ibm128 directories for
multilib support.  This allows the multilib to still be created, but it is not
enabled by default.

Alternatively, I have a patch that disables the IEEE/IBM long double multilib
support completely.

This patch has been tested on a little endian power8 system.  Can I install
this patch on the trunk, and back port it to GCC 8.x?

[gcc]
2018-06-20  Michael Meissner  <meiss...@linux.ibm.com>

        * config.gcc (powerpc64le*-*-*): Only enable IEEE/IBM long double
        multilibs if we are building against an Advance Toolchain compiler
        that has multilib support.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc      (revision 261755)
+++ gcc/config.gcc      (working copy)
@@ -4560,17 +4560,30 @@ case "${target}" in
                fi
 
                # Set up the default long double format if the user changed it.
+               ld_alt=""
                if test x$with_long_double_format = xieee; then
                    tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=1"
+                   ld_alt="ibm128"
 
                elif test x$with_long_double_format = xibm; then
                    tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=0"
+                   ld_alt="ieee128"
                fi
 
+               # If we are building against a special advance toolchain
+               # directory that has multilib support, enable IEEE/IBM long
+               # double multilibs in the compiler.
+
                case "${target}:${enable_multilib}:${with_long_double_format}" 
in
                    powerpc64le*:yes:ieee | powerpc64le*:yes:ibm)
-                       tm_defines="${tm_defines} TARGET_IEEEQUAD_MULTILIB=1"
-                       tmake_file="${tmake_file} 
rs6000/t-ldouble-linux64le-${with_long_double_format}"
+                       if test "x$with_advance_toolchain" != x -a \
+                           "x$ld_alt" != x -a \
+                           -d "/opt/$with_advance_toolchain/lib64/." -a \
+                           -d "/opt/$with_advance_toolchain/lib64/$ld_alt/."; 
then
+
+                           tm_defines="${tm_defines} 
TARGET_IEEEQUAD_MULTILIB=1"
+                           tmake_file="${tmake_file} 
rs6000/t-ldouble-linux64le-${with_long_double_format}"
+                       fi
                        ;;
                    *)
                        :

Reply via email to