From patchwork Thu May 15 07:55:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 349085 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 E465A140083 for ; Thu, 15 May 2014 17:57:31 +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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=RJZ0hFnhcTazf4Pta hWWO/ryw6wpl+j5K+QJjw2tHKqu1YPrCRGE3j1AnDIv+zbLELkKITmHN64OieI7w AshCeChDdA14VHOAwuu9tLIZOzEEfBAm/HYelxudIiCJz9SinhjAXtaYIiGyw1KT 8fYJFE5mdrYzcg1eamtQJ5wEmE= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=oG4g6QeXPGu1zQ/bvfkJlnc +9LU=; b=rTYPrOXXqVJQ4f61X0ZvdB8pVHttU2hznmjOfLoa9UFeR1dItUKXJTZ MoimxgXtae0Ge1DDkZf+v/gxyACKmdZLoUVAhNdjbjIKKw7yxQ48MqDa2IMOYA75 16lG8T9Yvi9x4ridtUT8co9ZZ53tPq1HHMeYzl0YE2GgxidUFIvU= Received: (qmail 7705 invoked by alias); 15 May 2014 07:57:22 -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 7635 invoked by uid 89); 15 May 2014 07:57:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: DVREDG02.corp.atmel.com Received: from nasmtp01.atmel.com (HELO DVREDG02.corp.atmel.com) (192.199.1.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 15 May 2014 07:57:19 +0000 Received: from apsmtp01.atmel.com (10.168.254.31) by DVREDG02.corp.atmel.com (10.42.103.31) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 15 May 2014 01:57:04 -0600 Received: from PENCHT02.corp.atmel.com (10.168.5.162) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 15 May 2014 15:55:50 +0800 Received: from atmel.com (10.168.5.13) by cas-ap.atmel.com (10.168.5.162) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 15 May 2014 15:55:04 +0800 Date: Thu, 15 May 2014 13:25:03 +0530 From: Senthil Kumar Selvaraj To: Rainer Orth CC: Georg-Johann Lay , Denis Chertykov , GCC Patches Subject: Re: [Patch, avr] Propagate -mrelax gcc driver flag to assembler Message-ID: <20140515075503.GA30458@atmel.com> References: <20140411151008.GA861@atmel.com> <53496B71.8040808@gjlay.de> <20140418095246.GA28398@atmel.com> <5370AE49.3030008@gjlay.de> <20140513124852.GA15273@atmel.com> <53734A8C.9010401@gjlay.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Wed, May 14, 2014 at 12:56:54PM +0200, Rainer Orth wrote: > Georg-Johann Lay writes: > > > Or what about simply that, which works for me: > > > > > > 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\ > > Better yet something like > > #ifdef HAVE_AS_AVR_LINK_RELAX_OPTION > #define LINK_RELAX_SPEC "%{mrelax:-mlink-relax} " > #else > #define LINK_RELAX_SPEC "" > #endif > > #define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) " LINK_RELAX_SPEC > Does this look ok? I don't have commit access, so could someone commit this please? Regards Senthil 2014-05-15 Senthil Kumar Selvaraj * config/avr/avr.h: Pass on mlink-relax to assembler. * configure.ac: Test for mlink-relax assembler support. * config.in: Regenerate. * configure: Likewise. diff --git gcc/config.in gcc/config.in index c0ba36e..1738301 100644 --- gcc/config.in +++ gcc/config.in @@ -575,6 +575,12 @@ #endif +/* Define if your assembler supports -mlink-relax option. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AVR_AS_LINK_RELAX_OPTION +#endif + + /* Define to 1 if you have the `clearerr_unlocked' function. */ #ifndef USED_FOR_TARGET #undef HAVE_CLEARERR_UNLOCKED diff --git gcc/config/avr/avr.h gcc/config/avr/avr.h index 9d34983..c59c54d 100644 --- gcc/config/avr/avr.h +++ gcc/config/avr/avr.h @@ -512,8 +512,14 @@ 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_AVR_AS_LINK_RELAX_OPTION +#define ASM_RELAX_SPEC "%{mrelax:-mlink-relax}" +#else +#define ASM_RELAX_SPEC "" +#endif + +#define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) " ASM_RELAX_SPEC + #define LINK_SPEC "\ %{mrelax:--relax\ %{mpmem-wrap-around:%{mmcu=at90usb8*:--pmem-wrap-around=8k}\ diff --git gcc/configure gcc/configure index f4db0a0..2812cdb 100755 --- gcc/configure +++ gcc/configure @@ -24014,6 +24014,39 @@ $as_echo "#define HAVE_AS_JSRDIRECT_RELOCS 1" >>confdefs.h fi ;; + avr-*-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -mlink-relax option" >&5 +$as_echo_n "checking assembler for -mlink-relax option... " >&6; } +if test "${gcc_cv_as_avr_relax+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_avr_relax=no + if test x$gcc_cv_as != x; then + $as_echo '.text' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mlink-relax -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_avr_relax=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_avr_relax" >&5 +$as_echo "$gcc_cv_as_avr_relax" >&6; } +if test $gcc_cv_as_avr_relax = yes; then + +$as_echo "#define HAVE_AVR_AS_LINK_RELAX_OPTION 1" >>confdefs.h + +fi + ;; + cris-*-*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -no-mul-bug-abort option" >&5 $as_echo_n "checking assembler for -no-mul-bug-abort option... " >&6; } diff --git gcc/configure.ac gcc/configure.ac index 8f17dfb..49a1f3d 100644 --- gcc/configure.ac +++ gcc/configure.ac @@ -3510,6 +3510,13 @@ case "$target" in [Define if your assembler supports the lituse_jsrdirect relocation.])]) ;; + avr-*-*) + gcc_GAS_CHECK_FEATURE([-mlink-relax option], gcc_cv_as_avr_relax,, + [-mlink-relax], [.text],, + [AC_DEFINE(HAVE_AVR_AS_LINK_RELAX_OPTION, 1, + [Define if your assembler supports -mlink-relax option.])]) + ;; + cris-*-*) gcc_GAS_CHECK_FEATURE([-no-mul-bug-abort option], gcc_cv_as_cris_no_mul_bug,[2,15,91],