Skip to content

Commit 66afcb3

Browse files
aykevldeadprogram
authored andcommitted
avr: pass the correct -mmcu flag to the linker
It does not appear to be necessary for these devices but might result in more appropriate libraries to be linked in. It is best to _not_ specify the exact MCU because otherwise a few other settings (such as startfiles and some linker script configs) also get set, which we do manually anyway and should not be interfered with. I discovered this while working on support for the atmega1284.
1 parent 5bace97 commit 66afcb3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

targets/atmega328p.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"cflags": [
77
"-mmcu=atmega328p"
88
],
9+
"ldflags": [
10+
"-mmcu=avr5"
11+
],
912
"linkerscript": "src/device/avr/atmega328p.ld",
1013
"extra-files": [
1114
"targets/avr.S",

targets/digispark.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"-mmcu=attiny85"
88
],
99
"ldflags": [
10+
"-mmcu=avr25",
1011
"-Wl,--defsym=_bootloader_size=2180",
1112
"-Wl,--defsym=_stack_size=128"
1213
],

0 commit comments

Comments
 (0)