Skip to content

Commit

Permalink
Merge pull request #44 from zsa/enable_lto_option
Browse files Browse the repository at this point in the history
Add option to enable LTO easily  (qmk#5674)
  • Loading branch information
fdidron committed May 6, 2019
2 parents 3c5dd58 + c7d9b48 commit 43aae47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
04-22-2019 - Add Split RGB support
04-24-2019 - fix LIB_SRC and QUANTUM_LIB_SRC for ARM
04-24-2019 - Add RGB Split fixes and RGB Names
05-05-2019 - Fix issue with Space Cadet
05-05-2019 - Add `LINK_TIME_OPTIMIZATION_ENABLE` to enable LTO and disable problematic features that cause LTO to fail
05-05-2019 - Fix issue with Space Cadet
3 changes: 2 additions & 1 deletion show_options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ OTHER_OPTION_NAMES = \
RGB_MATRIX_KEYPRESSES \
LED_MIRRORED \
RGBLIGHT_FULL_POWER \
Link_Time_Optimization
Link_Time_Optimization \
LINK_TIME_OPTIMIZATION_ENABLE

define NAME_ECHO
@echo " $1 = $($1) # $(origin $1)"
Expand Down
7 changes: 7 additions & 0 deletions tmk_core/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif


ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
EXTRAFLAGS += -flto
TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE
TMK_COMMON_DEFS += -DNO_ACTION_MACRO
TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION
endif
# Bootloader address
ifdef STM32_BOOTLOADER_ADDRESS
TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
Expand Down

0 comments on commit 43aae47

Please sign in to comment.