summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-20 14:31:57 +0000
committerbergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-20 14:31:57 +0000
commit2bcf7f73db33a8a1c48a422b4bfbdfdbbb04f2c4 (patch)
treeeca9e991a2ef0d959a48e21df7498099e922be84 /libgcc
parent99bb1f46e1c7eea5698a731bc0db9fd772b2bf85 (diff)
libgcc/
Backport from mainline 2017-07-07 Peter Bergner <bergner@vnet.ibm.com> * config/rs6000/float128-ifunc.c: Don't include auxv.h. (have_ieee_hw_p): Delete function. (SW_OR_HW) Use __builtin_cpu_supports(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250391 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog9
-rw-r--r--libgcc/config/rs6000/float128-ifunc.c42
2 files changed, 10 insertions, 41 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index a569a98f4789..4368171d22bc 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-20 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2017-07-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/float128-ifunc.c: Don't include auxv.h.
+ (have_ieee_hw_p): Delete function.
+ (SW_OR_HW) Use __builtin_cpu_supports().
+
2017-07-19 John Marino <gnugcc@marino.st>
* config/i386/dragonfly-unwind.h: Handle sigtramp relocation.
diff --git a/libgcc/config/rs6000/float128-ifunc.c b/libgcc/config/rs6000/float128-ifunc.c
index e456ab13ce85..882c56ef21e4 100644
--- a/libgcc/config/rs6000/float128-ifunc.c
+++ b/libgcc/config/rs6000/float128-ifunc.c
@@ -45,47 +45,7 @@
#error "This module must not be compiled with IEEE 128-bit hardware support"
#endif
-#include <sys/auxv.h>
-
-/* Use the namespace clean version of getauxval. However, not all versions of
- sys/auxv.h declare it, so declare it here. This code is intended to be
- temporary until a suitable version of __builtin_cpu_supports is added that
- allows us to tell quickly if the machine supports IEEE 128-bit hardware. */
-extern unsigned long __getauxval (unsigned long);
-
-static int
-have_ieee_hw_p (void)
-{
- static int ieee_hw_p = -1;
-
- if (ieee_hw_p < 0)
- {
- char *p = (char *) __getauxval (AT_PLATFORM);
-
- ieee_hw_p = 0;
-
- /* Don't use atoi/strtol/strncmp/etc. These may require the normal
- environment to be setup to set errno to 0, and the ifunc resolvers run
- before the whole glibc environment is initialized. */
- if (p && p[0] == 'p' && p[1] == 'o' && p[2] == 'w' && p[3] == 'e'
- && p[4] == 'r')
- {
- long n = 0;
- char ch;
-
- p += 5;
- while ((ch = *p++) >= '0' && (ch <= '9'))
- n = (n * 10) + (ch - '0');
-
- if (n >= 9)
- ieee_hw_p = 1;
- }
- }
-
- return ieee_hw_p;
-}
-
-#define SW_OR_HW(SW, HW) (have_ieee_hw_p () ? HW : SW)
+#define SW_OR_HW(SW, HW) (__builtin_cpu_supports ("ieee128") ? HW : SW)
/* Resolvers. */