Better handle LTO_ENABLE (#9832)

* Better handle LTO_ENABLE

Especially when calling from command line

* Replace LINK_TIME_OPTIMIZATION_ENABLE with LTO_ENABLE

* Remove long for LTO from show_options.mk
This commit is contained in:
Drashna Jaelre
2020-08-22 01:21:06 -07:00
committed by Drashna Jael're
parent 2d4e228d0a
commit f454a7be21
4 changed files with 6 additions and 10 deletions

View File

@@ -84,8 +84,7 @@ OTHER_OPTION_NAMES = \
RGB_MATRIX_KEYPRESSES \ RGB_MATRIX_KEYPRESSES \
LED_MIRRORED \ LED_MIRRORED \
RGBLIGHT_FULL_POWER \ RGBLIGHT_FULL_POWER \
Link_Time_Optimization \ LTO_ENABLE
LINK_TIME_OPTIMIZATION_ENABLE
define NAME_ECHO define NAME_ECHO
@echo " $1 = $($1) # $(origin $1)" @echo " $1 = $($1) # $(origin $1)"

View File

@@ -165,16 +165,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
endif endif
ifeq ($(strip $(LTO_ENABLE)), yes) ifeq ($(strip $(LTO_ENABLE)), yes)
LINK_TIME_OPTIMIZATION_ENABLE = yes
endif
ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
ifeq ($(PLATFORM),CHIBIOS) ifeq ($(PLATFORM),CHIBIOS)
$(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.)
$(info If unsure, set LINK_TIME_OPTIMIZATION_ENABLE = no.) $(info If unsure, set LTO_ENABLE = no.)
endif endif
EXTRAFLAGS += -flto EXTRAFLAGS += -flto
TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE TMK_COMMON_DEFS += -DLTO_ENABLE
TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATON_ENABLE
endif endif
# Search Path # Search Path

View File

@@ -29,7 +29,7 @@ extern "C" {
#endif #endif
/* Disable macro and function features when LTO is enabled, since they break */ /* Disable macro and function features when LTO is enabled, since they break */
#ifdef LINK_TIME_OPTIMIZATION_ENABLE #ifdef LTO_ENABLE
# ifndef NO_ACTION_MACRO # ifndef NO_ACTION_MACRO
# define NO_ACTION_MACRO # define NO_ACTION_MACRO
# endif # endif

View File

@@ -181,7 +181,7 @@ static void print_version(void) {
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
" NKRO" " NKRO"
#endif #endif
#ifdef LINK_TIME_OPTIMIZATION_ENABLE #ifdef LTO_ENABLE
" LTO" " LTO"
#endif #endif