From patchwork Fri May 11 18:26:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Shen X-Patchwork-Id: 158564 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 8716FB700B for ; Sat, 12 May 2012 04:27:18 +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=1337365639; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Reply-To:Message-ID:Date:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=ZQ3YuMG GH9QqHx3m/38hl8LFPas=; b=xHSQSg5hbTk8c7zkohrdGdaxSjzlBZPAHJgklmh 6CtrIbc52MAMr6+ZXIFkRPSX7ciHub306WdpXupbfseD7QzQZSA+TW/XXWgL0G6i 1huN7g3I/j8ZG/8qMihxOhkS90BEi/ZEhoZ6r4r7Z3mVVtUn9sc3A/Mnmr++37+O AEw8= 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:Reply-To:X-Google-Appengine-App-Id:Message-ID:Date:Subject:From: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=yqA0A6+Y9v3kDJUPbdmQW4MPuK2y95Ect5r++XdeT7RJ+hJP+11LunOTL+vx7d F/l4zho1t/6KQEWZM8AM5dn4axScZCjScL8HA8pVMf9/RW2nILVtfOJfFqImolE5 7ojz7X33ehiZpmXDmYTfgQzIEjzL330YCLeZRX0mmazFg=; Received: (qmail 20600 invoked by alias); 11 May 2012 18:27:03 -0000 Received: (qmail 20521 invoked by uid 22791); 11 May 2012 18:26:59 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_DF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f69.google.com (HELO mail-qa0-f69.google.com) (209.85.216.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 May 2012 18:26:41 +0000 Received: by qafi29 with SMTP id i29so3324830qaf.8 for ; Fri, 11 May 2012 11:26:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:reply-to:x-google-appengine-app-id:message-id:date :subject:from:to:cc:content-type:x-gm-message-state; bh=qjD9gimkh2H/fofp2cV8cN/cqFj7GVg+/hVu1ANAoH0=; b=b1JiwLpmpZWnmG4/yLB56tRsogZqmYVOQYrnYIn+jB4XPkgf3W/zTz809PvdxUufUg sOWA0skRErV0hZfeRBtVHZ695Q+BbMHGF5+0hUW89EExMeo6Jr08RfassBqkZI9mk0vM VaRViFjri4XyuE+mflFHk8SUf9QGgWxJ/mSLzTN8vMgJhM/HSEDlkmweksKNH7lmPMr+ 0Urljm4FjczAoIMEoHC0oeCVC2WCpk3HeNRmEe6Z5UmWd58cJGN4vkvMdfQw/jSXdVDv FyXG0SQc71ZRE/68gKU3TSHlyUHHateUP4g0AvH0MqF5yiIOl4lZciWABzyUEVVQYR4t TnPA== Received: by 10.236.187.39 with SMTP id x27mr13963251yhm.4.1336760800672; Fri, 11 May 2012 11:26:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.187.39 with SMTP id x27mr13963243yhm.4.1336760800566; Fri, 11 May 2012 11:26:40 -0700 (PDT) Reply-To: shenhan@google.com, carrot@google.com, xur@google.com, gcc-patches@gcc.gnu.org, asharif@google.com, reply@codereview-hr.appspotmail.com X-Google-Appengine-App-Id: s~codereview-hr Message-ID: <20cf305e236faae5d304bfc6e0fe@google.com> Date: Fri, 11 May 2012 18:26:40 +0000 Subject: [google/gcc-4_6] Port arm hardfp patch from Linaro (issue 6206055) From: shenhan@google.com To: carrot@google.com, xur@google.com Cc: gcc-patches@gcc.gnu.org, asharif@google.com, reply@codereview-hr.appspotmail.com X-Gm-Message-State: ALoCoQmoN/I9l51lAVdmCxF77CyHHnneAhEtuaacONDzvpeT419vxqFH31ejQNnaWlgRdcYAvlCPLgsuMrdtnmt8w8qWQYfX73SQnvQ6+jwnkPOPAfhn4rR9dWJhcsyiRiWPCH3XNrzAbUNP7IhhJyz0QG6UoePBjQ== 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 Reviewers: carrot, xur, Message: Hi Rong and Carrot, could you take a look at this patch, thanks! The modification is in upstream (with a minor modification). Background - There is the need to agree on the runtime linker path for the various ARM hard-float ports that distros are working on right now. Without doing this, we'll break binary compatibility between the distros. The conclusion was made. And here is the detailed information - https://wiki.linaro.org/OfficeofCTO/HardFloat/LinkerPathCallApr2012 ===== Patch starts diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 3a32188..58d06c2 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -32,7 +32,8 @@ while (false) /* We default to a soft-float ABI so that binaries can run on all - target hardware. */ + target hardware. If you override this to use the hard-float ABI then + change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ #undef TARGET_DEFAULT_FLOAT_ABI #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT @@ -59,10 +60,26 @@ #undef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION -/* Use ld-linux.so.3 so that it will be possible to run "classic" - GNU/Linux binaries on an EABI system. */ +/* GNU/Linux on ARM currently supports three dynamic linkers: + - ld-linux.so.2 - for the legacy ABI + - ld-linux.so.3 - for the EABI-derived soft-float ABI + - ld-linux-armhf.so.3 - for the EABI-derived hard-float ABI. + All the dynamic linkers live in /lib. + We default to soft-float, but this can be overridden by changing both + GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ + #undef GLIBC_DYNAMIC_LINKER -#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux-armhf.so.3" +#define GLIBC_DYNAMIC_LINKER_DEFAULT \ + RUNTIME_ROOT_PREFIX GLIBC_DYNAMIC_LINKER_SOFT_FLOAT + +#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. */ Description: Hi Rong and Carrot, could you take a look at this patch, thanks! The modification is in upstream (with a minor modification). Background - There is the need to agree on the runtime linker path for the various ARM hard-float ports that distros are working on right now. Without doing this, we'll break binary compatibility between the distros. The conclusion was made. And here is the detailed information - https://wiki.linaro.org/OfficeofCTO/HardFloat/LinkerPathCallApr2012 ===== Patch starts diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 3a32188..58d06c2 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -32,7 +32,8 @@ while (false) /* We default to a soft-float ABI so that binaries can run on all - target hardware. */ + target hardware. If you override this to use the hard-float ABI then + change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ #undef TARGET_DEFAULT_FLOAT_ABI #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT @@ -59,10 +60,26 @@ #undef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION -/* Use ld-linux.so.3 so that it will be possible to run "classic" - GNU/Linux binaries on an EABI system. */ +/* GNU/Linux on ARM currently supports three dynamic linkers: + - ld-linux.so.2 - for the legacy ABI + - ld-linux.so.3 - for the EABI-derived soft-float ABI + - ld-linux-armhf.so.3 - for the EABI-derived hard-float ABI. + All the dynamic linkers live in /lib. + We default to soft-float, but this can be overridden by changing both + GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ + #undef GLIBC_DYNAMIC_LINKER -#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux-armhf.so.3" +#define GLIBC_DYNAMIC_LINKER_DEFAULT \ + RUNTIME_ROOT_PREFIX GLIBC_DYNAMIC_LINKER_SOFT_FLOAT + +#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. */ Please review this at http://codereview.appspot.com/6206055/ Affected files: M gcc/config/arm/linux-eabi.h Index: gcc/config/arm/linux-eabi.h diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 3a32188..58d06c2 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -32,7 +32,8 @@ while (false) /* We default to a soft-float ABI so that binaries can run on all - target hardware. */ + target hardware. If you override this to use the hard-float ABI then + change the setting of GLIBC_DYNAMIC_LINKER_DEFAULT as well. */ #undef TARGET_DEFAULT_FLOAT_ABI #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT @@ -59,10 +60,26 @@ #undef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION -/* Use ld-linux.so.3 so that it will be possible to run "classic" - GNU/Linux binaries on an EABI system. */ +/* GNU/Linux on ARM currently supports three dynamic linkers: + - ld-linux.so.2 - for the legacy ABI + - ld-linux.so.3 - for the EABI-derived soft-float ABI + - ld-linux-armhf.so.3 - for the EABI-derived hard-float ABI. + All the dynamic linkers live in /lib. + We default to soft-float, but this can be overridden by changing both + GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */ + #undef GLIBC_DYNAMIC_LINKER -#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT \ + RUNTIME_ROOT_PREFIX "/lib/ld-linux-armhf.so.3" +#define GLIBC_DYNAMIC_LINKER_DEFAULT \ + RUNTIME_ROOT_PREFIX GLIBC_DYNAMIC_LINKER_SOFT_FLOAT + +#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. */