Skip to content

Commit

Permalink
[Core] Use -mcall-prologues the save code size
Browse files Browse the repository at this point in the history
From GCC Manual:

Functions prologues/epilogues are expanded as calls
to appropriate subroutines. Code size is smaller.

Small programs with few functions can increase in size,
but QMK benefits from this as it is rather large.

See: https://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_optflags
  • Loading branch information
KarlK90 committed Feb 7, 2022
1 parent 73c128c commit 32dfd75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions platforms/avr/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ COMPILEFLAGS += -ffunction-sections
COMPILEFLAGS += -fdata-sections
COMPILEFLAGS += -fpack-struct
COMPILEFLAGS += -fshort-enums
COMPILEFLAGS += -mcall-prologues

# Linker relaxation is only possible if
# link time optimizations are not enabled.
Expand Down

0 comments on commit 32dfd75

Please sign in to comment.