diff options
author | Drashna Jaelre <drashna@live.com> | 2020-08-22 01:21:06 -0700 |
---|---|---|
committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-08-29 14:30:02 -0700 |
commit | 92385b3fb617326b129609726020453c8949c7f8 (patch) | |
tree | 29d881897a59f0b1568bbaf21534c81360ad21e6 /tmk_core | |
parent | 3f392c09b60d46d9e4a4d3cc150a26294dea4da7 (diff) | |
download | qmk_firmware-92385b3fb617326b129609726020453c8949c7f8.tar.gz qmk_firmware-92385b3fb617326b129609726020453c8949c7f8.zip |
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
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common.mk | 9 | ||||
-rw-r--r-- | tmk_core/common/action.h | 2 | ||||
-rw-r--r-- | tmk_core/common/command.c | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 56ed4a857..a6c439f5c 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk | |||
@@ -160,16 +160,13 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | |||
160 | endif | 160 | endif |
161 | 161 | ||
162 | ifeq ($(strip $(LTO_ENABLE)), yes) | 162 | ifeq ($(strip $(LTO_ENABLE)), yes) |
163 | LINK_TIME_OPTIMIZATION_ENABLE = yes | ||
164 | endif | ||
165 | |||
166 | ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes) | ||
167 | ifeq ($(PLATFORM),CHIBIOS) | 163 | ifeq ($(PLATFORM),CHIBIOS) |
168 | $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) | 164 | $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) |
169 | $(info If unsure, set LINK_TIME_OPTIMIZATION_ENABLE = no.) | 165 | $(info If unsure, set LTO_ENABLE = no.) |
170 | endif | 166 | endif |
171 | EXTRAFLAGS += -flto | 167 | EXTRAFLAGS += -flto |
172 | TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATION_ENABLE | 168 | TMK_COMMON_DEFS += -DLTO_ENABLE |
169 | TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATON_ENABLE | ||
173 | endif | 170 | endif |
174 | 171 | ||
175 | # Search Path | 172 | # Search Path |
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index c82c9c81b..345c030c9 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h | |||
@@ -29,7 +29,7 @@ extern "C" { | |||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | /* Disable macro and function features when LTO is enabled, since they break */ | 31 | /* Disable macro and function features when LTO is enabled, since they break */ |
32 | #ifdef LINK_TIME_OPTIMIZATION_ENABLE | 32 | #ifdef LTO_ENABLE |
33 | # ifndef NO_ACTION_MACRO | 33 | # ifndef NO_ACTION_MACRO |
34 | # define NO_ACTION_MACRO | 34 | # define NO_ACTION_MACRO |
35 | # endif | 35 | # endif |
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index ef6a39c0f..feeb2202e 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
@@ -180,7 +180,7 @@ static void print_version(void) { | |||
180 | #ifdef NKRO_ENABLE | 180 | #ifdef NKRO_ENABLE |
181 | " NKRO" | 181 | " NKRO" |
182 | #endif | 182 | #endif |
183 | #ifdef LINK_TIME_OPTIMIZATION_ENABLE | 183 | #ifdef LTO_ENABLE |
184 | " LTO" | 184 | " LTO" |
185 | #endif | 185 | #endif |
186 | 186 | ||