From patchwork Tue Dec 30 19:38:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 4463 Received: (qmail 25953 invoked by alias); 30 Dec 2014 19:38:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 25943 invoked by uid 89); 30 Dec 2014 19:38:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f41.google.com MIME-Version: 1.0 X-Received: by 10.202.209.147 with SMTP id i141mr30858438oig.108.1419968300210; Tue, 30 Dec 2014 11:38:20 -0800 (PST) In-Reply-To: References: Date: Tue, 30 Dec 2014 11:38:20 -0800 Message-ID: Subject: Re: [PING] [PATCH] i686: Fix test suite fails on build by gcc 5.0 From: "H.J. Lu" To: "Senkevich, Andrew" Cc: libc-alpha , Andrew Senkevich On Tue, Dec 30, 2014 at 10:31 AM, H.J. Lu wrote: > On Mon, Dec 29, 2014 at 5:45 AM, Senkevich, Andrew > wrote: >> 2014-11-27 20:23 GMT+03:00 H.J. Lu : >>> We should also undef SETUP_PIC_REG_STR and LOAD_PIC_REG_STR in >>> sysdeps/i386/sysdep.h for GCC 5, which are defined for C sources and >>> will be wrong for GCC 5. >> >> Attached patch formatted for git am. >> >> ChangeLog: >> >> 2014-12-29 Andrew Senkevich >> >> * sysdeps/i386/tls-macros.h (TLS_IE, TLS_LD, TLS_GD): Keep define in >> PIC mode only if gcc version < 5.0 >> * sysdeps/i386/sysdep.h (SETUP_PIC_REG_STR, LOAD_PIC_REG_STR): Keep >> define only if gcc version < 5.0 > > Do we really need to change SETUP_PIC_REG_STR and > LOAD_PIC_REG_STR? SETUP_PIC_REG_STR is only used > in LOAD_PIC_REG_STR and LOAD_PIC_REG_STR is only used > in check_consistency. I think check_consistency change is > sufficient. > >> * sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Likewise. >> >> Is it Ok? >> This is the patch I checked in. Thanks. From f3a36d9328f5c32945cbda64375df237a359dcd9 Mon Sep 17 00:00:00 2001 From: Andrew Senkevich Date: Tue, 30 Dec 2014 11:34:53 -0800 Subject: [PATCH] i386: Fix build by GCC 5.0 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 . (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 | 10 ++++++++++ sysdeps/i386/tls-macros.h | 8 +++++--- sysdeps/unix/sysv/linux/i386/sysdep.h | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5780c3a..ac8bbf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-12-30 Andrew Senkevich + + * sysdeps/i386/tls-macros.h: Include . + (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 Joseph Myers [BZ #17723] diff --git a/sysdeps/i386/tls-macros.h b/sysdeps/i386/tls-macros.h index 0b85738..053cba0 100644 --- a/sysdeps/i386/tls-macros.h +++ b/sysdeps/i386/tls-macros.h @@ -1,3 +1,5 @@ +#include /* 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 d751c58..b574418 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__ \ -- 1.9.3