On Fri, Oct 30, 2020 at 04:00:30PM -0400, Michael Meissner wrote: > 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.
That isn't quite the same issue: hopefully all distros have backported all hwcap names (it is always safe to do so), but they will not backport all other features. But, time will fix all problems here. So, okay for trunk. Thanks! Segher