https://sourceware.org/bugzilla/show_bug.cgi?id=33197

            Bug ID: 33197
           Summary: [AVR] Incorrect syntax in generated ldscript
           Product: binutils
           Version: 2.45
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: yuriy at occipital dot com
  Target Milestone: ---

Commit c4388377 (AVR: ld/32968 - Assert that .progmem data resides in the lower
64 KiB) added ASSERT to script template avr.sc:199 
-------
    ASSERT (__progmem_start == __progmem_end || __progmem_end <= 0x10000,
            \".progmem section exceeds 0x10000\");
-------

Notice \ before ".

This part makes its way unchanged to generated linker script, e.g.
avr/lib/ldscripts/avrxmega3.xn:99-100. Slashes before " are preserved too,
leading to compilation errors at cmake compiler test stage of my project:

-------
: && /opt/avr-gcc/bin/avr-g++ -mmcu=attiny814 -g3 -ggdb --stack-usage -Oz -flto
-freorder-blocks-algorithm=stc -Wall -Wextra -Werror -Wundef -std=c++17 
CMakeFiles/cmTC_ab193.dir/testCXXCompiler.cxx.obj -o cmTC_ab193   && :
   
/opt/avr-gcc/lib/gcc/avr/16.0.0/../../../../avr/bin/ld:ldscripts/avrxmega3.xn:100:
syntax error
    collect2: error: ld returned 1 exit status
-------

Removing slashes manually from generated avrxmega3.xn fixes this compilation
error, confirming that slashes are the root cause.
Not sure which part (template, script generation or parsing) is the one to fix.

Env details in case they are relevant:
MacBook M1 Pro, latest MacOS (15.5) and Xcode (16.4)
avr-gcc built from latest master.
binutils configure flags:
--prefix=/opt/avr-gcc --target=avr --enable-languages=c,c++ --disable-nls 
--disable-werror --with-gmp="/opt/homebrew/"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to