Message ID | 20201119234302.GA30873@ibm-toto.the-meissners.org |
---|---|
State | New |
Headers | show |
Series | PowerPC: PR libgcc/97543, fix 64-bit long double issues | expand |
Hi! On Thu, Nov 19, 2020 at 06:43:02PM -0500, Michael Meissner wrote: > One feature of the current GNU attribute implementation is if you have a shared > library (such as libgcc_s.so), the GNU attributes for the shared library is an > inclusive OR of all of the modules within the library. This means if any > module uses the -mlong-double-128 option and uses long double, the GNU > attributes for the library will indicate that it uses 128-bit IBM long > doubles. If you have a static library, you will get the warning only if you > actually reference a module with the attribute set. (You use "module" a lot, here and in the patch; just "object file" would be clearer I think. "Module" has a specific (and different)( meaning in many contexts.) > 2) I turned off GNU attributes for building the shared library or for > building the IBM 128-bit long double support. It's not clear to me what error disabling setting it for the static library avoids? Not that it *hurts* of course. Do you have an example for this? Anyway, okay for trunk (and backports later). Thanks! Segher
diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux index ed821947b66..72e9c2770a6 100644 --- a/libgcc/config/rs6000/t-linux +++ b/libgcc/config/rs6000/t-linux @@ -6,3 +6,25 @@ HOST_LIBGCC2_CFLAGS += -mlong-double-128 # 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