Skip to content

Commit

Permalink
avr: pass the correct -mmcu flag to the linker
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aykevl authored and deadprogram committed Mar 17, 2020
1 parent 5bace97 commit 66afcb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions targets/atmega328p.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"cflags": [
"-mmcu=atmega328p"
],
"ldflags": [
"-mmcu=avr5"
],
"linkerscript": "src/device/avr/atmega328p.ld",
"extra-files": [
"targets/avr.S",
Expand Down
1 change: 1 addition & 0 deletions targets/digispark.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"-mmcu=attiny85"
],
"ldflags": [
"-mmcu=avr25",
"-Wl,--defsym=_bootloader_size=2180",
"-Wl,--defsym=_stack_size=128"
],
Expand Down

0 comments on commit 66afcb3

Please sign in to comment.