This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] i686: Fix test suite fails on build by gcc 5.0
- From: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 30 Oct 2014 20:06:37 +0400
- Subject: Re: [PATCH] i686: Fix test suite fails on build by gcc 5.0
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3twodSWMDZi-vKvZEb9i9ixWRf7m9f2oycLY1hvY5ufAg at mail dot gmail dot com>
2014-10-29 20:57 GMT+03:00 Andrew Senkevich <andrew.n.senkevich@gmail.com>:
> Hi,
>
> this patch fixes 3 make check fails 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
> failed because EBX was used as PIC register.
Here is the patch corrected accordingly comments in
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg03203.html
ChangeLog:
2014-10-30 Andrew Senkevich <andrew.n.senkevich@gmail.com>
* sysdeps/i386/tls-macros.h (TLS_IE, TLS_LD, TLS_GD): Keep
define in PIC mode only if gcc version < 5.0
* sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency):
Keep define only if gcc version < 5.0
index 0b85738..053cba0 100644
--- a/sysdeps/i386/tls-macros.h
+++ b/sysdeps/i386/tls-macros.h
@@ -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" \
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h
b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 57d5ea0..bce5697 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -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__ \
--
WBR,
Andrew