This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, avr] Propagate -mrelax gcc driver flag to assembler
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>, Denis Chertykov <chertykov at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 14 May 2014 12:56:54 +0200
- Subject: Re: [Patch, avr] Propagate -mrelax gcc driver flag to assembler
- Authentication-results: sourceware.org; auth=none
- References: <20140411151008 dot GA861 at atmel dot com> <53496B71 dot 8040808 at gjlay dot de> <20140418095246 dot GA28398 at atmel dot com> <5370AE49 dot 3030008 at gjlay dot de> <20140513124852 dot GA15273 at atmel dot com> <53734A8C dot 9010401 at gjlay dot de>
Georg-Johann Lay <avr@gjlay.de> 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
to avoid unnecessary duplication.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University