1
0
Fork 0

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 Jael're 2020-08-22 01:21:06 -07:00 committed by James Young
parent 3f392c09b6
commit 92385b3fb6
79 changed files with 85 additions and 99 deletions

View file

@ -160,16 +160,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
endif
ifeq ($(strip $(LTO_ENABLE)), yes)
LINK_TIME_OPTIMIZATION_ENABLE = yes
endif
ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes)
ifeq ($(PLATFORM),CHIBIOS)
$(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
EXTRAFLAGS += -flto
TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE
TMK_COMMON_DEFS += -DLTO_ENABLE
TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATON_ENABLE
endif
# Search Path

View file

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

View file

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