From patchwork Wed May 14 10:50:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 348740 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 55D9014009C for ; Wed, 14 May 2014 20:49:45 +1000 (EST) 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:content-transfer-encoding; q=dns; s= default; b=qOEMt26/LO0Mf5w40YmCoik20+6eRFiAfrbtCVHYM0mKuogLrULL2 G1wLjtGiE0gUhCZLd4Xx4gEi8qir+XLTFFQI02YiSqqNv2LIQmWLBvR7vt48Pjyf RCBYK6Z0ylMsO32u8ZnQWQ8lJ42G9ceFKeJGAlt4LnyTOQa8VPEo3g= 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:content-transfer-encoding; s=default; bh=bJsN8nXGi4g67kVMvofLkuhjUro=; b=t0wHh40yaTl8AZv/+yJ8p7S4hx9a xUx3LIjQzrx06GhVM7KQY+6r8OaYUaHu94L9TTaIWVYCzwZki8xUOLflBOnojrx1 sTsbFojoDuqofiho++xKaPzTq5vVAV6b0kfl0L0nMwkvCmdM+FrbMaBST6REz+PR V42sS47e5K8jO3c= Received: (qmail 30153 invoked by alias); 14 May 2014 10:49:38 -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 30140 invoked by uid 89); 14 May 2014 10:49:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 14 May 2014 10:49:35 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPbBBR62PQ25nZqaVhI= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (91-67-174-249-dynip.superkabel.de [91.67.174.249]) by smtp.strato.de (RZmta 33.3 DYNA|AUTH) with ESMTPSA id y030c5q4EAnWp0I (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate); Wed, 14 May 2014 12:49:32 +0200 (CEST) Message-ID: <53734A8C.9010401@gjlay.de> Date: Wed, 14 May 2014 12:50:52 +0200 From: Georg-Johann Lay User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130911 Thunderbird/17.0.9 MIME-Version: 1.0 To: Senthil Kumar Selvaraj CC: Denis Chertykov , GCC Patches Subject: Re: [Patch, avr] Propagate -mrelax gcc driver flag to assembler References: <20140411151008.GA861@atmel.com> <53496B71.8040808@gjlay.de> <20140418095246.GA28398@atmel.com> <5370AE49.3030008@gjlay.de> <20140513124852.GA15273@atmel.com> In-Reply-To: <20140513124852.GA15273@atmel.com> X-IsSubscribed: yes Am 05/13/2014 02:48 PM, schrieb Senthil Kumar Selvaraj: > On Mon, May 12, 2014 at 01:19:37PM +0200, Georg-Johann Lay wrote: >> Am 04/18/2014 11:52 AM, schrieb Senthil Kumar Selvaraj: >>> >>> On Sat, Apr 12, 2014 at 06:36:01PM +0200, Georg-Johann Lay wrote: >>>> Senthil Kumar Selvaraj schrieb: [...] >>> 2014-04-18 Senthil Kumar Selvaraj >>> >>> * config/avr/avr.h: Pass on mlink-relax to assembler. >>> * configure.ac: Test for mlink-relax support in assembler. >>> * configure: Regenerate. >>> >>> diff --git gcc/config/avr/avr.h gcc/config/avr/avr.h >>> index 78434ec..b4e3eb1 100644 >>> --- gcc/config/avr/avr.h >>> +++ gcc/config/avr/avr.h >>> @@ -512,7 +512,28 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv); >>> %{!fenforce-eh-specs:-fno-enforce-eh-specs} \ >>> %{!fexceptions:-fno-exceptions}" >>> >>> -#define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) " >>> +#ifdef HAVE_AS_RELAX_OPTION >>> +#define ASM_RELAX_SPEC "%{mrelax:-mlink-relax}" >>> +#else >>> +#define ASM_RELAX_SPEC "" >>> +#endif >>> + >>> +#define ASM_SPEC "%:device_to_as(%{mmcu=*:%*})\ >>> +%(asm_relax)" >>> + >>> +/* This macro defines names of additional specifications to put in the specs >>> + that can be used in various specifications like CC1_SPEC. Its definition >>> + is an initializer with a subgrouping for each command option. >>> + >>> + Each subgrouping contains a string constant, that defines the >>> + specification name, and a string constant that used by the GCC driver >>> + program. >>> + >>> + Do not define this macro if it does not need to do anything. */ >>> + >>> +#define EXTRA_SPECS \ >>> + { "asm_relax", ASM_RELAX_SPEC } >>> + >> >> Hi, wouldn't it be easier to add just a line to driver-avr.c:avr_device_to_as ? > > Well, I couldn't figure out how to do it without passing in the nested spec and > then do argument checking inside avr_device_to_as. Something like > > #define ASM_SPEC "%:device_to_as(%{mmcu=*:%*} %{mrelax:-mlink-relax})" > > and then handle argc==0, 1 and 2 cases by strcmp'ing against > -mlink-relax if HAVE_AVR_AS_LINK_RELAX_OPTION. > Did I miss something? Or what about simply that, which works for me: Johann Index: config/avr/avr.h =================================================================== --- config/avr/avr.h (revision 210276) +++ config/avr/avr.h (working copy) @@ -512,7 +512,11 @@ extern const char *avr_device_to_sp8 (in %{!fenforce-eh-specs:-fno-enforce-eh-specs} \ %{!fexceptions:-fno-exceptions}" +#ifdef HAVE_AS_AVR_LINK_RELAX_OPTION +#define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) %{mrelax:-mlink-relax} " +#else #define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) " +#endif #define LINK_SPEC "\ %{mrelax:--relax\