On Fri, Oct 30, 2020 at 01:52:13PM -0500, Segher Boessenkool wrote: > On Fri, Oct 30, 2020 at 01:21:34PM -0400, Michael Meissner wrote: > > David reminded me that not all targets support GLIBC. This patch should > > fix my > > previous committed patch not to use TARGET_GLIBC_MAJOR or TARGET_GLIBC_MINOR > > unless they are defined. > > > + This support is only in little endian GLIBC 2.32 or newer. */ > > +static bool > > +glibc_supports_ieee_128bit (void) > > +{ > > +#if defined (OPTION_GLIBC) \ > > + && defined (TARGET_GLIBC_MAJOR) \ > > + && defined (TARGET_GLIBC_MINOR) > > + > > + if (OPTION_GLIBC > > + && !BYTES_BIG_ENDIAN > > + && DEFAULT_ABI == ABI_ELFv2 > > + && ((TARGET_GLIBC_MAJOR * 1000) + TARGET_GLIBC_MINOR) >= 2032) > > + return true; > > +#endif /* GLIBC provided. */ > > + > > + return false; > > +} > > + > > So this makes the compiler behave differently based on what the libc > used at build time was (including its version). Can't we do better? :-(
Not really. We have exactly the same issue with __builtin_cpu_supports. At the end of the day, you have to configure GCC with an appropriate GLIBC. -- 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