This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, avr] Propagate -mrelax gcc driver flag to assembler


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]