From patchwork Tue Apr 3 03:29:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Hope X-Patchwork-Id: 150318 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 3991AB6FDB for ; Tue, 3 Apr 2012 13:29:45 +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=1334028586; 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:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=dkFmU3EcutrA5lwfmL6iF9rdnBk=; b=KQywCb93/nyK+Nr kzLlTuT3BiH1MGtpSajjy0Xl2zkagIj5LQu7HqE64Psa9UFOTmSBLMGCknF7Nt7S PN+3JrcsVkCGbhrpq2QkmOo+gkXlYR3GS57ygWLtLlHtZy0tyzQWL0A7+zGRgCTw BPk25QCtne5ZJTDW7RrCzKys37dg= 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:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wo9ePaC6SeYUFbnJ5HwTqVOzvhsyfxiOWjGjjkgNwyRunMkUPVqz8urMzDn7me tmuyjVn1QLQBTtv3j92PEbbDDYrdppy1JqOE1NxZw48yzgK7f2XP0klVqW/cEUIR pAgNhwFdrlBALWcOpRja0fGIqjFOBKpLnLagi5b3hqHNk=; Received: (qmail 32267 invoked by alias); 3 Apr 2012 03:29:42 -0000 Received: (qmail 32231 invoked by uid 22791); 3 Apr 2012 03:29:41 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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-f51.google.com (HELO mail-wg0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Apr 2012 03:29:27 +0000 Received: by wgbed3 with SMTP id ed3so2765728wgb.8 for ; Mon, 02 Apr 2012 20:29:26 -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:x-gm-message-state; bh=h+FSsddU/12fv3Vwy8h2wGZYXUA7K9E18mE7jVH9xVw=; b=UufHRHFuA8LMedUlVBPwqarRmrKDvap/lsN6Q963LXbpUAzLhXIsfEp1pID5ByeQVJ 4pjlUS63pjq8LMORGALNVTXD7s+iOuuX6fYS+G7nwnTLNZ1+iYtMhF8jLMsoZH6CsiZB FG3e+/QR7jpqb+bLmYMhAtCYOtRi3sTyJRDwdnzJELrtJsmPKa9+5IxyA6HC2gI3wMP4 ykQwSWgg2s/V0k8BbugdMTJTJMgIDVJ11JLbUSFhAtBmo9bEXmyznjrAkN0kc7/dfwot Ruj+dvzvg2hBXzJhhGLSpTJkfCHeCvHYPKAN11rWL4xCTEnK4Udc6FHl/9lxSvC2joMo NZCw== Received: by 10.180.94.33 with SMTP id cz1mr31688441wib.13.1333423766565; Mon, 02 Apr 2012 20:29:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.7.206 with HTTP; Mon, 2 Apr 2012 20:29:06 -0700 (PDT) In-Reply-To: <20120402210653.GC28152@dannf.org> References: <20120329193401.GA14860@dannf.org> <4F75F2E2.3030909@arm.com> <20120402210653.GC28152@dannf.org> From: Michael Hope Date: Tue, 3 Apr 2012 15:29:06 +1200 Message-ID: Subject: Re: [PATCH] ARM: Use different linker path for hardfloat ABI To: dann frazier Cc: Richard Earnshaw , "cross-distro@lists.linaro.org" , "gcc-patches@gcc.gnu.org" X-Gm-Message-State: ALoCoQmfuwUxMw5a9TOOHlY4Di8Q+t5VX73v2AzYlO3vbL94IMPNu714NFSzvGPrl/DCzOhUdR8u 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 3 April 2012 09:06, dann frazier wrote: > On Fri, Mar 30, 2012 at 06:52:34PM +0100, Richard Earnshaw wrote: >> On 29/03/12 20:34, dann frazier wrote: >> > This is an updated version of a patch Debian and Ubuntu are using to >> > use an alternate linker path for hardfloat binaries. The difference >> > with this one is that it covers the case where no float flag >> > was passed in, defaulting to the softfloat path. Hi Dann. The change should be in the EABI specific linux-eabi.h instead of the shared/OABI linux-elf.h. It breaks support for uClibc and Bionic by always using the GLIBC loader in hard float mode. The final line in the spec is missing a '=hard' and always adds /lib/ld-linux.so.3. How about: 2012-04-03 Michael Hope * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define. (GLIBC_DYNAMIC_LINKER): Redefine to use the hard float loader. use the GNU/Linux version, not the generic BPABI version. */ which works for the following test cases: gcc -mhard-float foo.c => /lib/arm-linux-gnueabihf/ld-linux.so.3 gcc -mfloat-abi=hard foo.c => /lib/arm-linux-gnueabihf/ld-linux.so.3 gcc -msoft-float foo.c => /lib/ld-linux.so.3 gcc -mfloat-abi=softfp foo.c => /lib/ld-linux.so.3 gcc -mbionic => /system/bin/linker gcc -mbionic -mhard-float => /system/bin/linker gcc -muclibc => /lib/ld-uClibc.so.0 gcc -muclibc -mhard-float => /lib/ld-uClibc.so.0 -- Michael diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 80bd825..8498472 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -62,7 +62,12 @@ /* 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/arm-linux-gnueabihf/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER \ + "%{mhard-float:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ + %{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ + %{!mfloat-abi=hard:%{!mhard-float:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "}}" /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to