瀏覽代碼

Keyboard: fixed build break (size overflow) HelixPico with Backlight or Underglow (#3546)

* 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
Takeshi ISHII 7 年之前
父節點
當前提交
b29799f887

+ 9 - 0
keyboards/helix/config.h

@@ -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 */

+ 14 - 0
keyboards/helix/pico/keymaps/default/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/default/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/edvorakjp/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/five_rows/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/froggy/rules.mk

@@ -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
 

+ 5 - 0
keyboards/helix/rev2/keymaps/led_test/rules.mk

@@ -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