Cryptjar / avr-progmem-rs

Progmem utility for the AVR architecture
Apache License 2.0
28 stars 8 forks source link

Fix incompatibility with avr-binutils >= 2.30 #2

Closed Rahix closed 3 years ago

Rahix commented 3 years ago

Due to a change in the linker scripts supplied with avr-binutils in version 2.30 (2018-01-27), the bare .progmem section name is no longer recognized - one now has to use a section name matching the .progmem.* glob:

--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -128,7 +128,7 @@ SECTIONS
     ${RELOCATING+ *libprintf_flt.a:*(.progmem.data)}
     ${RELOCATING+ *libc.a:*(.progmem.data)}

-    ${RELOCATING+ *(.progmem*)}
+    ${RELOCATING+ *(.progmem.*)}

     ${RELOCATING+. = ALIGN(2);}

The relevant commit can be found here: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f726cc1cb69ab0e0303209d08effb10b99007080

I also added two more commits in the pull-request: One to fix a compiler warning about dead code when the lpm-asm-loop feature is active and one which adds a cargo config + runner script for Arduino Uno. This allows running the example with just:

cargo run --example uno-serial

If you don't want those additional commits, please let me know, I can remove them again.

Cryptjar commented 3 years ago

Thank you very much for finding and patching this. Your additional commits look also great.