From patchwork Mon Apr 23 21:36:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Hope X-Patchwork-Id: 154544 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]) by ozlabs.org (Postfix) with SMTP id 3FDCEB6FC8 for ; Tue, 24 Apr 2012 07:37:59 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335821879; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=l3Qmb6FVzHMM1jYFsOTQ npE0u48=; b=KSUni/53KutbYMR8GdPTQnkMVM488ze9ZNmk7QbpIKeiT3oRUJwX NhmZ1UwtiAsv+fAtQXsVOm2j6ebpia5Z+AyAhs1teGV9F4lGWOjnkQOjCV3l8wRT UKykdi3eQzdQuJiHebjazxo66vLY9TAA+if3vlEprUlcaLMGIkB7sG8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oJwNCrsBoNbaLPRjnvZGg0QuGzjBimh+mnMSC/MLWnkj1KdDBgNrIuqznap5LJ Zj+xMO0DmlDWZRXzNjQMMFaGIYeKeO3X+LWpDi7wFmqoRj+U1lX5upxMahjlDBxl W7l1jOlk8iK8SJhXQCq+fhan3NhVFAgknXkmcwWJjfFxw=; Received: (qmail 32038 invoked by alias); 23 Apr 2012 21:37:54 -0000 Received: (qmail 32017 invoked by uid 22791); 23 Apr 2012 21:37:52 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Apr 2012 21:37:38 +0000 Received: by wgbds1 with SMTP id ds1so3347838wgb.2 for ; Mon, 23 Apr 2012 14:37:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=2ZCVkm4Xcz/bMF5G3n7tVl6m2KX1KniqPvX+Eidck5c=; b=pcTavHdXsOXI9OQk7BnONCmDLTM7mwb5U2QaVMGaGgHd44nNOJdopMbcX61yDnzQi9 048hKFpBVH/fk6qoLfK6JCWq880PU4Ag3+2tkVFuISqTxS9kHKgUZVSF2d0XRBMjitJU qBurFVcja3/LzCWH52zdha4smxBghnC2zoSPe6R0/kUW3kTvOoDjBW6z7x7BHODDwWqi aW/4E1ZODemE6XMgHUG2T2Yjq4mNsKhVzg2jhTOfNveKt5oVrTYKXi1JRfVyUq0E6UqH BbquQbLwKHSaa0EayZBeuGrT7Z3Z/Wmp1l+jbkqqicWMur0Pm+cElTv6/4HswkR0c+pa Ad2g== Received: by 10.180.92.71 with SMTP id ck7mr1595783wib.21.1335217057201; Mon, 23 Apr 2012 14:37:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.48.135 with HTTP; Mon, 23 Apr 2012 14:36:41 -0700 (PDT) In-Reply-To: <4F9576DE.9070608@arm.com> References: <4F9576DE.9070608@arm.com> From: Michael Hope Date: Tue, 24 Apr 2012 09:36:41 +1200 Message-ID: Subject: Re: [PATCH v2] ARM: Use different linker path for hardfloat ABI To: Richard Earnshaw Cc: GCC Patches , "cross-distro@lists.linaro.org" , "libc-ports@sourceware.org" X-Gm-Message-State: ALoCoQntugkBkqNp86CNUFH0GMNeFGxZEecPjpWwmEEl1PoprRJ9jjknjLebh/eK9MdJQvy75FD4 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 24 April 2012 03:35, Richard Earnshaw wrote: > On 22/04/12 23:20, Michael Hope wrote: >> Change the dynamic linker path for ARM hard float executables. >> Matches the path discussed and agreed on last week[1].  Carlos will >> follow up with the matching patch to GLIBC[2].  I'm happy to if he's >> busy. >> >> OK for trunk? >> >> -- Michael >> [1] http://sourceware.org/ml/libc-ports/2012-04/msg00060.html >> [2] http://sourceware.org/ml/libc-ports/2012-04/msg00064.html >> >> 2012-04-23  Michael Hope   >> >>       * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define. >>       (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT): Define. >>       (GLIBC_DYNAMIC_LINKER): Redefine to use the hard float path. >> >> diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h >> index 80bd825..3ddf812 100644 >> --- a/gcc/config/arm/linux-eabi.h >> +++ b/gcc/config/arm/linux-eabi.h >> @@ -62,7 +62,11 @@ >>  /* Use ld-linux.so.3 so that it will be possible to run "classic" >>     GNU/Linux binaries on an EABI system.  */ >>  #undef  GLIBC_DYNAMIC_LINKER >> -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" >> +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" >> +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" >> +#define GLIBC_DYNAMIC_LINKER \ >> +   "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ >> +    %{!mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "}" >> >>  /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to >>     use the GNU/Linux version, not the generic BPABI version.  */ >> > > > I think this should handle having the hard-float variant as the default > more gracefully, so something like: > > > -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" > +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" > +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" > +#if TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_HARD > +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_HARD_FLOAT > +#else > +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT > +#endif > +#define GLIBC_DYNAMIC_LINKER \ > +   "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ > +    %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ > +    %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" > > But I haven't tested any of that. It tests just fine when setting the float ABI at configure time or explicitly. Updated patch is below. I prefer the original, shorter version but the new one is easier for someone else to understand. OK for trunk? -- Michael 2012-04-24 Michael Hope Richard Earnshaw * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT): Define. (GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define. (GLIBC_DYNAMIC_LINKER_DEFAULT): Define. (GLIBC_DYNAMIC_LINKER): Redefine to use the hard float path. diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 80bd825..2ace6f0 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -62,7 +62,17 @@ /* Use ld-linux.so.3 so that it will be possible to run "classic" GNU/Linux binaries on an EABI system. */ #undef GLIBC_DYNAMIC_LINKER -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" +#if TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_HARD +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_HARD_FLOAT +#else +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT +#endif +#define GLIBC_DYNAMIC_LINKER \ + "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */