]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
i386: Fix build by GCC 5.0
authorAndrew Senkevich <andrew.senkevich@intel.com>
Tue, 30 Dec 2014 19:34:53 +0000 (11:34 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 30 Dec 2014 19:37:41 +0000 (11:37 -0800)
Fixed 3 "make check" failures on glibc 32bit built by gcc 5.0 due to EBX
was enabled for allocation:

https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00892.html

Tests elf/tst-tls3, elf/tst-execstack-needed, elf/tst-execstack-prog
were failed because EBX was used as PIC register.

* sysdeps/i386/tls-macros.h: Include <features.h>.
(TLS_LE): Use non-PIC version for GCC >= 5.0.
(TLS_IE): Likewise.
(TLS_LD): Likewise.
(TLS_GD): Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Don't
define for GCC >= 5.0.

ChangeLog
sysdeps/i386/tls-macros.h
sysdeps/unix/sysv/linux/i386/sysdep.h

index d6c2d287f66667dec6cb0b4c81e3bd2ab84b2f1c..59379758f345855b98fb47c115cf4d99bdecc171 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-12-30  Andrew Senkevich  <andrew.senkevich@intel.com>
+
+       * sysdeps/i386/tls-macros.h: Include <features.h>.
+       (TLS_LE): Use non-PIC version for GCC >= 5.0.
+       (TLS_IE): Likewise.
+       (TLS_LD): Likewise.
+       (TLS_GD): Likewise.
+       * sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Don't
+       define for GCC >= 5.0.
+
 2014-12-30  Chris Metcalf  <cmetcalf@ezchip.com>
 
        * math/test-fenv.c (test_single_exception, set_single_exc,
index 0b857383c98f658b4a39b9743f53c3925fd04694..053cba05d1694fb7ba87ddbb8c2e822ad92edfae 100644 (file)
@@ -1,3 +1,5 @@
+#include <features.h> /* For __GNUC_PREREQ.  */
+
 #define TLS_LE(x) \
   ({ int *__l;                                                               \
      asm ("movl %%gs:0,%0\n\t"                                               \
@@ -5,7 +7,7 @@
          : "=r" (__l));                                                      \
      __l; })
 
-#ifdef PIC
+#if defined PIC && !__GNUC_PREREQ (5,0)
 # define TLS_IE(x) \
   ({ int *__l;                                                               \
      asm ("movl %%gs:0,%0\n\t"                                               \
@@ -27,7 +29,7 @@
      __l; })
 #endif
 
-#ifdef PIC
+#if defined PIC && !__GNUC_PREREQ (5,0)
 # define TLS_LD(x) \
   ({ int *__l, __c, __d;                                                     \
      asm ("leal " #x "@tlsldm(%%ebx),%%eax\n\t"                                      \
@@ -51,7 +53,7 @@
      __l; })
 #endif
 
-#ifdef PIC
+#if defined PIC && !__GNUC_PREREQ (5,0)
 # define TLS_GD(x) \
   ({ int *__l, __c, __d;                                                     \
      asm ("leal " #x "@tlsgd(%%ebx),%%eax\n\t"                               \
index d751c58e3e57d21306ab5d300b562f46d72319aa..b574418601ce520acecc74130ebcb2c35022168c 100644 (file)
@@ -502,7 +502,7 @@ asm (".L__X'%ebx = 1\n\t"
 #endif
 
 /* Consistency check for position-independent code.  */
-#ifdef __PIC__
+#if defined __PIC__ && !__GNUC_PREREQ (5,0)
 # define check_consistency()                                                 \
   ({ int __res;                                                                      \
      __asm__ __volatile__                                                    \