From patchwork Mon Apr 27 14:49:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 465052 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 E8B23140318 for ; Tue, 28 Apr 2015 00:50:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=coA00mwy; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=YrAs1zx/or2fdq0mR 4/i/HHHBCZ9PcP3wVsl227mtOD1svV8A5gBAcIOt8XCIf2zg4k0+CQv/+O2W4jRk fg35Fba7gynmnjFv6AugNoV+Y1ZDrs+SS5Cl5tiICEvwmtZSO4nxty3oG8/Vosj8 MfY87mkOc1ztMmfu//7AhmLKGU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=b2uYW8nGdelZyMgArZQsCkL FnR0=; b=coA00mwyncsTRPApa/9Hw5W8s86bwg1wbbwkwehj6GODugDNY/C6cOn L6E8KXWSBWpi5zi30fsE6a7PWyt6DvBuvpI+zSVENfMK4v+oNy9XtInBzvNxBcSx bNMbeh99mBHMKUiJQiv8r/AiINlk6DJsUxAS3o5qRm8pxYGM+0bE= Received: (qmail 90023 invoked by alias); 27 Apr 2015 14:50:02 -0000 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 Received: (qmail 89997 invoked by uid 89); 27 Apr 2015 14:50:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Apr 2015 14:50:00 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-11.uk.mimecast.lan; Mon, 27 Apr 2015 15:49:52 +0100 Received: from [10.2.206.56] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Apr 2015 15:49:52 +0100 Message-ID: <553E4C90.2040305@arm.com> Date: Mon, 27 Apr 2015 15:49:52 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Oleg Endo CC: "gcc-patches@gcc.gnu.org" , Gregor Richards , Rich Felker , Szabolcs Nagy Subject: Re: [PATCH 8/13] sh musl support References: <55354A4A.4060702@arm.com> <55354BDD.4030606@arm.com> <1429561782.14782.21.camel@yam-132-YW-E178-FTW> In-Reply-To: <1429561782.14782.21.camel@yam-132-YW-E178-FTW> X-MC-Unique: FmCiX8OFTNCquIdWKW5Zpw-1 X-IsSubscribed: yes On 20/04/15 21:29, Oleg Endo wrote: > On Mon, 2015-04-20 at 19:56 +0100, Szabolcs Nagy wrote: >> Set up dynamic linker name for sh. >> > > The SH parts are OK for trunk. > Patch v2 It turns out we have to distinguish between hard float and nofpu ABI. I simply listed the options that turn on nofpu and hardfloat code generation (the single precision modes are not relevant to musl, currently musl only supports sh4 and up because it assumes either gusa or llsc atomics is available and requires an mmu, but I listed all the options for the nofpu check for completeness). gcc/Changelog: 2015-04-27 Gregor Richards Szabolcs Nagy * config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define. (MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define. diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h index 0f5d614..4c167c6 100644 --- a/gcc/config/sh/linux.h +++ b/gcc/config/sh/linux.h @@ -43,6 +43,28 @@ along with GCC; see the file COPYING3. If not see #define TARGET_ASM_FILE_END file_end_indicate_exec_stack +#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN +#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}" +#endif + +#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 ) +/* "-nofpu" if any nofpu option is specified */ +#define MUSL_DYNAMIC_LINKER_FP \ + "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \ + "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \ + "m5-compact-nofpu:-nofpu}" +#else +/* "-nofpu" if none of the hard fpu options are specified */ +#define MUSL_DYNAMIC_LINKER_FP \ + "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}" +#endif + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" #undef SUBTARGET_LINK_EMUL_SUFFIX