Skip to content

Commit

Permalink
i386: Fix build by GCC 5.0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andrew Senkevich authored and H.J. Lu committed Dec 30, 2014
1 parent 1ff950a commit 07256e1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 5 additions & 3 deletions sysdeps/i386/tls-macros.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include <features.h> /* For __GNUC_PREREQ. */

#define TLS_LE(x) \
({ int *__l; \
asm ("movl %%gs:0,%0\n\t" \
"subl $" #x "@tpoff,%0" \
: "=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" \
Expand All @@ -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" \
Expand All @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/unix/sysv/linux/i386/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ \
Expand Down

0 comments on commit 07256e1

Please sign in to comment.