diff options
author | Michael Meissner <meissner@linux.ibm.com> | 2020-10-30 18:36:25 -0400 |
---|---|---|
committer | Michael Meissner <meissner@linux.ibm.com> | 2020-10-30 18:36:25 -0400 |
commit | f03851e1a6dac72127e97629e259ad01a2b1e7b6 (patch) | |
tree | a80cb265b29e1aa0e3fac8829443601ac1be6b7f /gcc | |
parent | a1343e5c74093124d7fbce6052d838f47a8eeb20 (diff) | |
download | gcc-f03851e1a6dac72127e97629e259ad01a2b1e7b6.zip gcc-f03851e1a6dac72127e97629e259ad01a2b1e7b6.tar.gz gcc-f03851e1a6dac72127e97629e259ad01a2b1e7b6.tar.bz2 |
PowerPC: Don't assume all targets have GLIBC.
gcc/
2020-10-30 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (glibc_supports_ieee_128bit): New helper
function.
(rs6000_option_override_internal): Call it.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bcd4c4a..1e506b8 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3539,6 +3539,20 @@ rs6000_linux64_override_options () } #endif +/* Return true if we are using GLIBC, and it supports IEEE 128-bit long double. + This support is only in little endian GLIBC 2.32 or newer. */ +static bool +glibc_supports_ieee_128bit (void) +{ +#ifdef OPTION_GLIBC + if (OPTION_GLIBC && !BYTES_BIG_ENDIAN + && ((TARGET_GLIBC_MAJOR * 1000) + TARGET_GLIBC_MINOR) >= 2032) + return true; +#endif /* OPTION_GLIBC. */ + + return false; +} + /* Override command line options. Combine build-specific configuration information with options @@ -4164,9 +4178,8 @@ rs6000_option_override_internal (bool global_init_p) static bool warned_change_long_double; if (!warned_change_long_double - && (!OPTION_GLIBC - || (!lang_GNU_C () && !lang_GNU_CXX ()) - || ((TARGET_GLIBC_MAJOR * 1000) + TARGET_GLIBC_MINOR) < 2032)) + && (!glibc_supports_ieee_128bit () + || (!lang_GNU_C () && !lang_GNU_CXX ()))) { warned_change_long_double = true; if (TARGET_IEEEQUAD) |