PowerPC: Backport fix for libgcc long double support.

This patch takes the fix that was applied to the trunk on December 3rd, and it
applies it to the GCC 10 branch.

I have verified it by building compilers configured for both normal 128-bit IBM
long double and 64-bit long double with/without the patch.  I did make check
and the results were the expected results comparing 128-bit long double to
64-bit long double.

With the patch installed, the test case provided will build and run cleanly
with compilers configured for either 128-bit IBM long double or 64-bit long
double without error.

Without the patch installed, the linker complains about mixing long double
types.

Here is the test case.

        #include <stdio.h>
        #include <stdint.h>
        int
        main()
        {
          long double a = 2.0;
          __int128 b = 8;
          printf("sizeof(long double) = %ld\n", sizeof(long double));
          printf("a * b = %Lf\n", a * (long double) b);
          return 0;
        }

Can I apply this patch to the gcc-10-branch and close out PR 97543?

libgcc/
2021-01-20  Michael Meissner  <meiss...@linux.ibm.com>

        PR libgcc/97543, PR libgcc/97643
        Backport from trunk.

        2020-12-03  Michael Meissner  <meiss...@linux.ibm.com>

        * config/rs6000/t-linux (IBM128_STATIC_OBJS): New make variable.
        (IBM128_SHARED_OBJS): New make variable.
        (IBM128_OBJS): New make variable.  Set all objects to use the
        explicit IBM format, and disable gnu attributes.
        (IBM128_CFLAGS): New make variable.
        (gcc_s_compile): Add -mno-gnu-attribute to all shared library
        modules.

-- 
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

Reply via email to