Index: configure.ac =================================================================== --- configure.ac (revision 221318) +++ configure.ac (working copy) @@ -3623,6 +3623,18 @@ [ .set nomacro [Define if your assembler supports the lituse_jsrdirect relocation.])]) ;; + avr-*-*) + gcc_GAS_CHECK_FEATURE([--mlink-relax option], gcc_cv_as_avr_mlink_relax,, + [--mlink-relax], [.text],, + [AC_DEFINE(HAVE_AS_AVR_MLINK_RELAX_OPTION, 1, + [Define if your assembler supports --mlink-relax option.])]) + + gcc_GAS_CHECK_FEATURE([-mrmw option], gcc_cv_as_avr_mrmw,, + [-mrmw], [.text],, + [AC_DEFINE(HAVE_AS_AVR_MRMW_OPTION, 1, + [Define if your assembler supports -mrmw option.])]) + ;; + cris-*-*) gcc_GAS_CHECK_FEATURE([-no-mul-bug-abort option], gcc_cv_as_cris_no_mul_bug,[2,15,91], Index: configure =================================================================== --- configure (revision 221318) +++ configure (working copy) @@ -24185,6 +24185,70 @@ $as_echo "#define HAVE_AS_JSRDIRECT_RELO 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_mlink_relax+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_avr_mlink_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_mlink_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_mlink_relax" >&5 +$as_echo "$gcc_cv_as_avr_mlink_relax" >&6; } +if test $gcc_cv_as_avr_mlink_relax = yes; then + +$as_echo "#define HAVE_AS_AVR_MLINK_RELAX_OPTION 1" >>confdefs.h + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for -mrmw option" >&5 +$as_echo_n "checking assembler for -mrmw option... " >&6; } +if test "${gcc_cv_as_avr_mrmw+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_avr_mrmw=no + if test x$gcc_cv_as != x; then + $as_echo '.text' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mrmw -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_mrmw=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_mrmw" >&5 +$as_echo "$gcc_cv_as_avr_mrmw" >&6; } +if test $gcc_cv_as_avr_mrmw = yes; then + +$as_echo "#define HAVE_AS_AVR_MRMW_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; } Index: config.in =================================================================== --- config.in (revision 221321) +++ config.in (working copy) @@ -247,6 +247,18 @@ that are supported for each access macro #endif +/* Define if your assembler supports --mlink-relax option. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_AVR_MLINK_RELAX_OPTION +#endif + + +/* Define if your assembler supports -mrmw option. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_AVR_MRMW_OPTION +#endif + + /* Define if your assembler supports cmpb. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_CMPB Index: config/avr/gen-avr-mmcu-specs.c =================================================================== --- config/avr/gen-avr-mmcu-specs.c (revision 221316) +++ config/avr/gen-avr-mmcu-specs.c (working copy) @@ -21,6 +21,8 @@ #include #include +#include "config.h" + #define IN_GEN_AVR_MMCU_TEXI #include "avr-devices.c" @@ -155,11 +157,15 @@ bool is_arch = NULL == mcu->macro; fprintf (f, "*asm_arch:\n\t-mmcu=%s\n\n", arch->name); +#ifdef HAVE_AS_AVR_MLINK_RELAX_OPTION \ fprintf (f, "*asm_relax:\n\t%s\n\n", ASM_RELAX_SPEC); +#endif // have as --mlink-relax +#ifdef HAVE_AS_AVR_MRMW_OPTION fprintf (f, "*asm_rmw:\n%s\n\n", rmw ? "\t%{!mno-rmw: -mrmw}" : "\t%{mrmw}"); +#endif // have as -mrmw fprintf (f, "*asm_errata_skip:\n%s\n\n", errata_skip ? "\t%{mno-skip-bug}"