public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-9284] PowerPC: Backport fix for libgcc long double support.
@ 2021-01-21  1:37 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2021-01-21  1:37 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3531f987b2b9c62919c4da7c0913f6a440290704

commit r10-9284-g3531f987b2b9c62919c4da7c0913f6a440290704
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Jan 20 20:30:22 2021 -0500

    PowerPC: Backport fix for libgcc long double support.
    
    libgcc/
    2021-01-20  Michael Meissner  <meissner@linux.ibm.com>
    
            * config/rs6000/t-linux (IBM128_STATIC_OBJS): Back port from
            master (12/3/2020).  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.

Diff:
---
 libgcc/config/rs6000/t-linux | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
index 4f6d4c4a4d2..72e9c2770a6 100644
--- a/libgcc/config/rs6000/t-linux
+++ b/libgcc/config/rs6000/t-linux
@@ -1,3 +1,30 @@
 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
 
-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
+HOST_LIBGCC2_CFLAGS += -mlong-double-128
+
+# This is a way of selecting -mcmodel=small for ppc64, which gives
+# smaller and faster libgcc code.  Directly specifying -mcmodel=small
+# would need to take into account targets for which -mcmodel is invalid.
+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
+
+# On the modules that deal with IBM 128-bit values, make sure that TFmode uses
+# the IBM extended double format.  Also turn off gnu attributes on the static
+# modules.
+IBM128_STATIC_OBJS	= ibm-ldouble$(objext) _powitf2$(objext) \
+			  ppc64-fp$(objext) _divtc3$(object) _multc3$(object) \
+			  _fixtfdi$(object) _fixunstfdi$(object) \
+	                  _floatditf$(objext) _floatunsditf$(objext)
+IBM128_SHARED_OBJS	= $(IBM128_STATIC_OBJS:$(objext):_s$(objext))
+IBM128_OBJS		= $(IBM128_STATIC_OBJS) $(IBM128_SHARED_OBJS)
+
+IBM128_CFLAGS		= -Wno-psabi -mabi=ibmlongdouble -mno-gnu-attribute
+
+$(IBM128_OBJS) : INTERNAL_CFLAGS += $(IBM128_CFLAGS)
+
+# Turn off gnu attributes for long double size on all of the shared library
+# modules, but leave it on for the static modules, except for the functions
+# that explicitly process IBM 128-bit floating point.  Shared libraries only
+# have one gnu attribute for the whole library, and it can lead to warnings if
+# somebody changes the long double format.  We leave it on for the static
+# modules to catch mis-compilation errors.
+gcc_s_compile += -mno-gnu-attribute


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-21  1:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  1:37 [gcc r10-9284] PowerPC: Backport fix for libgcc long double support Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).