]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: target/121608 - Don't add --relax when linking with -r.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 20 Aug 2025 08:53:37 +0000 (10:53 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Wed, 20 Aug 2025 09:19:51 +0000 (11:19 +0200)
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)

gcc/config/avr/specs.h

index ff269bf43bdf1d6e1f238f9b6fceb8a485dbd8af..c95c75856cb03dd273c2c6046316a40f0e008266 100644 (file)
@@ -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                               \