From: Georg-Johann Lay Date: Wed, 20 Aug 2025 08:53:37 +0000 (+0200) Subject: AVR: target/121608 - Don't add --relax when linking with -r. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f8c8edf88d98c22a74019b79fbc26d15207789f7;p=thirdparty%2Fgcc.git AVR: target/121608 - Don't add --relax when linking with -r. The linker rejects --relax in relocatable links (-r), hence only add --relax when -r is not specified. gcc/ PR target/121608 * config/avr/specs.h (LINK_RELAX_SPEC): Wrap in %{!r...}. (cherry picked from commit 0f15ff7b511493e9197e6153b794081c1557ba02) --- diff --git a/gcc/config/avr/specs.h b/gcc/config/avr/specs.h index ff269bf43bd..c95c75856cb 100644 --- a/gcc/config/avr/specs.h +++ b/gcc/config/avr/specs.h @@ -57,7 +57,7 @@ along with GCC; see the file COPYING3. If not see "%(asm_errata_skip) " #define LINK_RELAX_SPEC \ - "%{mrelax:--relax} " + "%{!r:%{mrelax:--relax}} " #undef LINK_SPEC #define LINK_SPEC \