]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Keyboard: fixed build break (size overflow) HelixPico with Backlight or Underglow...
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>
Thu, 2 Aug 2018 21:16:17 +0000 (06:16 +0900)
committerDrashna Jaelre <drashna@live.com>
Thu, 2 Aug 2018 21:16:17 +0000 (14:16 -0700)
* build break fix for HelixPico

* add customize variable 'Link_Time_Optimization' into rev2 and pico keymaps rules.mk

* "CFLAGS += -flto" change to "EXTRAFLAGS += -flto"

* add USE_Link_Time_Optimization macro

keyboards/helix/config.h
keyboards/helix/pico/keymaps/default/rules.mk
keyboards/helix/rev2/keymaps/default/rules.mk
keyboards/helix/rev2/keymaps/edvorakjp/rules.mk
keyboards/helix/rev2/keymaps/five_rows/rules.mk
keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk
keyboards/helix/rev2/keymaps/froggy/rules.mk
keyboards/helix/rev2/keymaps/led_test/rules.mk

index 7bd4d2645687a671bb56ff45e9d77a87cc67dc31..fbfbd328043425aa52f0bf696e9fbc284a531eef 100644 (file)
@@ -39,4 +39,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //     ./tmk_core
 //     ......
 
+#ifdef USE_Link_Time_Optimization
+  // LTO has issues with macros (action_get_macro) and "functions" (fn_actions),
+  //  so just disable them
+  #define NO_ACTION_MACRO
+  #define NO_ACTION_FUNCTION
+
+  #define DISABLE_LEADER
+#endif // USE_Link_Time_Optimization
+
 #endif /* CONFIG_H */
index 18b1d596b4c01d9ee6a581dd8d3ace822eafc46a..afb1240685d46922fe2d02d9ef3ee2d5c546da72 100644 (file)
@@ -35,6 +35,7 @@ LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -102,6 +103,19 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(AUDIO_ENABLE)),yes)
+  ifeq ($(strip $(RGBLIGHT_ENABLE)),yes)
+    Link_Time_Optimization = yes
+  endif
+  ifeq ($(strip $(OLED_ENABLE)),yes)
+    Link_Time_Optimization = yes
+  endif
+endif
+
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index 4174a3045796b84785621d00566946e8a0a31a67..5340a74ba2d0c94c914370578f1f5fa9f53a732a 100644 (file)
@@ -36,6 +36,7 @@ LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index d8fc35c486db96229cb7280325973f0b70f38cc4..67da9c370b936e0ca1888ff79af78d22dff65a45 100644 (file)
@@ -35,6 +35,7 @@ LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -113,6 +114,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
   OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index 53a00d8d4d004bf0c5022a6053eee3c35f4d2762..402f855ae1badb3e9d0abf2756ac6c915d4a4882 100644 (file)
@@ -36,6 +36,7 @@ LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index 4174a3045796b84785621d00566946e8a0a31a67..5340a74ba2d0c94c914370578f1f5fa9f53a732a 100644 (file)
@@ -36,6 +36,7 @@ LED_BACK_ENABLE = no        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index 2052b8f4e346a2fbc1e2e2226f3edb610ace8c6d..aa979641347d83249cfe8b314e4f62cea1fce938 100644 (file)
@@ -36,6 +36,7 @@ LED_BACK_ENABLE = yes        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 
index b3cd5ee42a177a8b0549fa61faaec50ca3ed1700..c7ee75c36bae8f047de4717bbae3ed0e64072d9c 100644 (file)
@@ -36,6 +36,7 @@ LED_BACK_ENABLE = yes        # LED backlight (Enable WS2812 RGB underlight.)
 LED_UNDERGLOW_ENABLE = no   # LED underglow (Enable WS2812 RGB underlight.)
 LED_ANIMATIONS = yes        # LED animations
 IOS_DEVICE_ENABLE = no      # connect to IOS device (iPad,iPhone)
+Link_Time_Optimization = no # if firmware size over limit, try this option
 
 ####  LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
 ####    Do not enable these with audio at the same time.
@@ -110,6 +111,10 @@ ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
     OPT_DEFS += -DLOCAL_GLCDFONT
 endif
 
+ifeq ($(strip $(Link_Time_Optimization)),yes)
+    EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
+endif
+
 SRC += led_test_init.c
 
 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE