From patchwork Thu Nov 27 19:11:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Senkevich X-Patchwork-Id: 415607 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CFEC1401B5 for ; Fri, 28 Nov 2014 06:11:54 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=Jgww 3xIUPc5yTUE+Ex2Zi8ML9fmopPFabS19+5uylbeykyapgB/wfx3+6Jr1qYsLlGdc 2hcxIapU4KIDDXY3b5KECwJgIs0YXJPTPenQgVkFWGI0UCH/14VZZ+Wh2iY91iZr HFhNGH3PA3L50wZV+H8xBo5iy3heTlmPZHc+BYc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; s=default; bh=3F46Ibj+7W ECBFQ+9vkgSErl1to=; b=ZAodYYWaylOe4hBS2KgJQzB8fh/wuPUoCU39D6b7lD lpsHv0VPD014Z+LM/ZSlEeBHbNGHLplltZkpW7w6KjvYv2I3v1XwVYxC5HxRHr7Q aG0T5vOm4xhr833BWnZuMjtKS22Ua/O0O02Rk4DnFQH3cEWxt7CzBmHV5/Vi7zuX 8= Received: (qmail 6473 invoked by alias); 27 Nov 2014 19:11:46 -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 6455 invoked by uid 89); 27 Nov 2014 19:11:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f180.google.com X-Received: by 10.112.156.42 with SMTP id wb10mr17641667lbb.17.1417115501202; Thu, 27 Nov 2014 11:11:41 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Andrew Senkevich Date: Thu, 27 Nov 2014 22:11:10 +0300 Message-ID: Subject: Re: [PING] [PATCH] i686: Fix test suite fails on build by gcc 5.0 To: "H.J. Lu" Cc: libc-alpha 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. Fixed. ChangeLog 2014-11-27 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 * sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Likewise. --- WBR, Andrew diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h index 217e746..5bebc13 100644 --- a/sysdeps/i386/sysdep.h +++ b/sysdeps/i386/sysdep.h @@ -146,22 +146,24 @@ GET_PC_THUNK(reg): \ #else /* __ASSEMBLER__ */ -# define SETUP_PIC_REG_STR(reg) \ - ".ifndef " GET_PC_THUNK_STR (reg) "\n" \ - ".section .gnu.linkonce.t." GET_PC_THUNK_STR (reg) ",\"ax\",@progbits\n" \ - ".globl " GET_PC_THUNK_STR (reg) "\n" \ - ".hidden " GET_PC_THUNK_STR (reg) "\n" \ - ".p2align 4\n" \ - ".type " GET_PC_THUNK_STR (reg) ",@function\n" \ +# if !__GNUC_PREREQ (5, 0) +# define SETUP_PIC_REG_STR(reg) \ + ".ifndef " GET_PC_THUNK_STR (reg) "\n" \ + ".section .gnu.linkonce.t." GET_PC_THUNK_STR (reg) ",\"ax\",@progbits\n" \ + ".globl " GET_PC_THUNK_STR (reg) "\n" \ + ".hidden " GET_PC_THUNK_STR (reg) "\n" \ + ".p2align 4\n" \ + ".type " GET_PC_THUNK_STR (reg) ",@function\n" \ GET_PC_THUNK_STR (reg) ":" \ - "movl (%%esp), %%e" #reg "\n" \ - "ret\n" \ - ".size " GET_PC_THUNK_STR (reg) ", . - " GET_PC_THUNK_STR (reg) "\n" \ - ".previous\n" \ - ".endif\n" \ - "call " GET_PC_THUNK_STR (reg) - -# define LOAD_PIC_REG_STR(reg) \ - SETUP_PIC_REG_STR (reg) "\naddl $_GLOBAL_OFFSET_TABLE_, %%e" #reg + "movl (%%esp), %%e" #reg "\n" \ + "ret\n" \ + ".size " GET_PC_THUNK_STR (reg) ", . - " GET_PC_THUNK_STR (reg) "\n" \ + ".previous\n" \ + ".endif\n" \ + "call " GET_PC_THUNK_STR (reg) + +# define LOAD_PIC_REG_STR(reg) \ + SETUP_PIC_REG_STR (reg) "\naddl $_GLOBAL_OFFSET_TABLE_, %%e" #reg +# endif #endif /* __ASSEMBLER__ */ 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__ \