https://gcc.gnu.org/g:d15bb53c43ceeafea8cc2f0b8f944eb29324a5d9

commit r13-9847-gd15bb53c43ceeafea8cc2f0b8f944eb29324a5d9
Author: Georg-Johann Lay <a...@gjlay.de>
Date:   Wed Aug 20 10:53:37 2025 +0200

    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:
---
 gcc/config/avr/specs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/avr/specs.h b/gcc/config/avr/specs.h
index b4a5ee6e5fc8..8b1dd9520942 100644
--- a/gcc/config/avr/specs.h
+++ b/gcc/config/avr/specs.h
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3.  If not see
   "%{mmcu=*:-m%*} "
 
 #define LINK_RELAX_SPEC                         \
-  "%{mrelax:--relax} "
+  "%{!r:%{mrelax:--relax}} "
 
 #undef  LINK_SPEC
 #define LINK_SPEC                               \

Reply via email to