~ruther/qmk_firmware

92385b3fb617326b129609726020453c8949c7f8 — Drashna Jaelre 5 years ago 3f392c0
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
79 files changed, 85 insertions(+), 99 deletions(-)

M docs/config_options.md
M docs/ja/config_options.md
M keyboards/1upkeyboards/sweet16/v1/rules.mk
M keyboards/1upkeyboards/sweet16/v2/promicro/rules.mk
M keyboards/bm60rgb/rules.mk
M keyboards/clueboard/66/keymaps/via/rules.mk
M keyboards/clueboard/card/rules.mk
M keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk
M keyboards/crkbd/keymaps/ninjonas/rules.mk
M keyboards/crkbd/keymaps/rpbaptist/rules.mk
M keyboards/dz60/keymaps/via/rules.mk
M keyboards/dztech/dz60rgb/keymaps/xunz/rules.mk
M keyboards/dztech/dz65rgb/keymaps/chocol8/rules.mk
M keyboards/dztech/dz65rgb/keymaps/matthewrobo/rules.mk
M keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk
M keyboards/ergodox_ez/keymaps/nathanvercaemert/rules.mk
M keyboards/flx/virgo/rules.mk
M keyboards/gray_studio/think65/hotswap/rules.mk
M keyboards/gray_studio/think65/solder/rules.mk
M keyboards/handwired/promethium/rules.mk
M keyboards/helix/pico/keymaps/biacco/rules.mk
M keyboards/helix/pico/keymaps/default/rules.mk
M keyboards/helix/pico/keymaps/mtei/rules.mk
M keyboards/helix/pico/local_features.mk
M keyboards/helix/rev2/keymaps/default/rules.mk
M keyboards/helix/rev2/keymaps/edvorakjp/rules.mk
M keyboards/helix/rev2/keymaps/five_rows/rules.mk
M keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk
M keyboards/helix/rev2/keymaps/froggy/rules.mk
M keyboards/helix/rev2/keymaps/froggy_106/rules.mk
M keyboards/helix/rev2/keymaps/led_test/rules.mk
M keyboards/helix/rev2/keymaps/yshrsmz/rules.mk
M keyboards/helix/rev2/local_features.mk
M keyboards/hineybush/h88/rules.mk
M keyboards/hotdox/keymaps/ninjonas/rules.mk
M keyboards/id80/keymaps/via/rules.mk
M keyboards/kc60/keymaps/noroadsleft/rules.mk
M keyboards/keebio/bdn9/keymaps/via/rules.mk
M keyboards/keebio/iris/keymaps/pvinis/rules.mk
M keyboards/keebio/iris/keymaps/via/rules.mk
M keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk
M keyboards/keebio/quefrency/keymaps/via/rules.mk
M keyboards/kyria/keymaps/ninjonas/rules.mk
M keyboards/kyria/rules.mk
M keyboards/launchpad/keymaps/via/rules.mk
M keyboards/lily58/keymaps/ninjonas/rules.mk
M keyboards/pinky/3/keymaps/ninjonas/rules.mk
M keyboards/planck/keymaps/oryx/rules.mk
M keyboards/planck/keymaps/sascha/rules.mk
M keyboards/planck/keymaps/tylerwince/rules.mk
M keyboards/preonic/rev1/rules.mk
M keyboards/preonic/rev2/rules.mk
M keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk
M keyboards/rgbkb/sol/rev2/rules.mk
M keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk
M keyboards/rgbkb/zygomorph/keymaps/default/rules.mk
M keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk
M keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk
M keyboards/tg4x/rules.mk
M keyboards/tkc/candybar/lefty/rules.mk
M keyboards/tkc/candybar/righty/rules.mk
M keyboards/v60_type_r/rules.mk
M keyboards/vitamins_included/rules.mk
M keyboards/xd004/v1/config.h
M keyboards/xd004/v1/rules.mk
M keyboards/xd84/rules.mk
M keyboards/xd96/rules.mk
M keyboards/yushakobo/quick7/config.h
M show_options.mk
M tmk_core/common.mk
M tmk_core/common/action.h
M tmk_core/common/command.c
M users/bcat/rules.mk
M users/dshields/rules.mk
M users/issmirnov/rules.mk
M users/kuchosauronad0/rules.mk
M users/pvinis/rules.mk
M users/yanfali/rules.mk
M users/yet-another-developer/rules.mk
M docs/config_options.md => docs/config_options.md +1 -3
@@ 324,11 324,9 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
    ```
* `LAYOUTS`
  * A list of [layouts](feature_layouts.md) this keyboard supports.
* `LINK_TIME_OPTIMIZATION_ENABLE`
* `LTO_ENABLE`
  * Enables Link Time Optimization (LTO) when compiling the keyboard.  This makes the process take longer, but it can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable).
However, this will automatically disable the legacy TMK Macros and Functions features, as these break when LTO is enabled.  It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`.  (Note: This does not affect QMK [Macros](feature_macros.md) and [Layers](feature_layers.md).)
* `LTO_ENABLE`
  * Has the same meaning as `LINK_TIME_OPTIMIZATION_ENABLE`.  You can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.

## AVR MCU Options
* `MCU = atmega32u4`

M docs/ja/config_options.md => docs/ja/config_options.md +1 -3
@@ 322,11 322,9 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
    ```
* `LAYOUTS`
  * このキーボードがサポートする[レイアウト](ja/feature_layouts.md)のリスト
* `LINK_TIME_OPTIMIZATION_ENABLE`
* `LTO_ENABLE`
  * キーボードをコンパイルする時に、Link Time Optimization (LTO) を有効にします。これは処理に時間が掛かりますが、コンパイルされたサイズを大幅に減らします (そして、ファームウェアが小さいため、追加の時間は分からないくらいです)。
ただし、LTO が有効な場合、古い TMK のマクロと関数の機能が壊れるため、自動的にこれらの機能を無効にします。これは `NO_ACTION_MACRO` と `NO_ACTION_FUNCTION` を自動的に定義することで行われます。(メモ: これは QMK の [マクロ](ja/feature_macros.md) と [レイヤー](ja/feature_layers.md) には影響を与えません。)
* `LTO_ENABLE`
  * LINK_TIME_OPTIMIZATION_ENABLE と同じ意味です。`LINK_TIME_OPTIMIZATION_ENABLE` の代わりに `LTO_ENABLE` を使うことができます。

## AVR MCU オプション
* `MCU = atmega32u4`

M keyboards/1upkeyboards/sweet16/v1/rules.mk => keyboards/1upkeyboards/sweet16/v1/rules.mk +1 -1
@@ 14,4 14,4 @@ BOOTLOADER = caterina
RGBLIGHT_ENABLE = yes
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/1upkeyboards/sweet16/v2/promicro/rules.mk => keyboards/1upkeyboards/sweet16/v2/promicro/rules.mk +1 -1
@@ 18,4 18,4 @@ CONSOLE_ENABLE = yes
RGBLIGHT_ENABLE = no
ENCODER_ENABLE = yes

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/bm60rgb/rules.mk => keyboards/bm60rgb/rules.mk +1 -1
@@ 31,7 31,7 @@ BLUETOOTH_ENABLE = no        # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no            # Audio output on port C6
FAUXCLICKY_ENABLE = no       # Use buzzer to emulate clicky switches
RGB_MATRIX_ENABLE = WS2812
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# partially generated by KBFirmware JSON to QMK Parser
# https://noroadsleft.github.io/kbf_qmk_converter/

M keyboards/clueboard/66/keymaps/via/rules.mk => keyboards/clueboard/66/keymaps/via/rules.mk +1 -1
@@ 1,4 1,4 @@
# rules.mk overrides to enable VIA

VIA_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes

M keyboards/clueboard/card/rules.mk => keyboards/clueboard/card/rules.mk +1 -1
@@ 26,4 26,4 @@ UNICODE_ENABLE = no        # Unicode
BLUETOOTH_ENABLE = no      # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes         # Audio output on port C6

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk => keyboards/converter/usb_usb/keymaps/chriskopher/rules.mk +1 -1
@@ 19,6 19,6 @@ EXTRAKEY_ENABLE = yes # Used for audio control and system control keys
COMBO_ENABLE = yes # Used to allow chording of keys to trigger an action
TAP_DANCE_ENABLE = yes # Used to allow multiple taps of a key to perform different actions

LINK_TIME_OPTIMIZATION_ENABLE = yes # Reduces the compiled firmware size
LTO_ENABLE = yes # Reduces the compiled firmware size

SRC += combo.c tap_dance.c

M keyboards/crkbd/keymaps/ninjonas/rules.mk => keyboards/crkbd/keymaps/ninjonas/rules.mk +1 -1
@@ 1,7 1,7 @@
RGB_MATRIX_ENABLE = WS2812
MOUSEKEY_ENABLE = no
OLED_DRIVER_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend

M keyboards/crkbd/keymaps/rpbaptist/rules.mk => keyboards/crkbd/keymaps/rpbaptist/rules.mk +1 -1
@@ 1,5 1,5 @@
#This enables Link Time Optimization.This can save a good chunk of space(several KB for me), but the macro and function... functions cause it to error out.
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

#Build Options
#change to "no" to disable the options, or define them in the Makefile in

M keyboards/dz60/keymaps/via/rules.mk => keyboards/dz60/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
VIA_ENABLE = yes

M keyboards/dztech/dz60rgb/keymaps/xunz/rules.mk => keyboards/dztech/dz60rgb/keymaps/xunz/rules.mk +1 -2
@@ 1,5 1,4 @@
NKRO_ENABLE = yes                 # USB Nkey Rollover
# VELOCIKEY_ENABLE = yes

LINK_TIME_OPTIMIZATION_ENABLE = yes

LTO_ENABLE = yes

M keyboards/dztech/dz65rgb/keymaps/chocol8/rules.mk => keyboards/dztech/dz65rgb/keymaps/chocol8/rules.mk +1 -2
@@ 2,5 2,4 @@ NKRO_ENABLE = yes            # USB Nkey Rollover
VELOCIKEY_ENABLE = yes
# AUTO_SHIFT_ENABLE = yes      # Auto Shift

LINK_TIME_OPTIMIZATION_ENABLE = yes

LTO_ENABLE = yes

M keyboards/dztech/dz65rgb/keymaps/matthewrobo/rules.mk => keyboards/dztech/dz65rgb/keymaps/matthewrobo/rules.mk +1 -2
@@ 2,5 2,4 @@ NKRO_ENABLE = yes                 # USB Nkey Rollover
AUTO_SHIFT_ENABLE = yes      # Auto Shift
# VELOCIKEY_ENABLE = yes

LINK_TIME_OPTIMIZATION_ENABLE = yes

LTO_ENABLE = yes

M keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk => keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk +1 -1
@@ 1,7 1,7 @@
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
NKRO_ENABLE      = yes  # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
TAP_DANCE_ENABLE = yes
MOUSEKEY_ENABLE  = yes  # Mouse keys(+4700b).

M keyboards/ergodox_ez/keymaps/nathanvercaemert/rules.mk => keyboards/ergodox_ez/keymaps/nathanvercaemert/rules.mk +1 -1
@@ 1,6 1,6 @@
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
COMMAND_ENABLE = no
RGBLIGHT_ENABLE = no
TAP_DANCE_ENABLE=yes

M keyboards/flx/virgo/rules.mk => keyboards/flx/virgo/rules.mk +1 -2
@@ 30,5 30,4 @@ UNICODE_ENABLE = no          # Unicode
BLUETOOTH_ENABLE = no        # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no            # Audio output on port C6
FAUXCLICKY_ENABLE = no       # Use buzzer to emulate clicky switches
LINK_TIME_OPTIMIZATION_ENABLE = yes

LTO_ENABLE = yes

M keyboards/gray_studio/think65/hotswap/rules.mk => keyboards/gray_studio/think65/hotswap/rules.mk +1 -1
@@ 32,7 32,7 @@ AUDIO_ENABLE = no            # Audio output on port C6
FAUXCLICKY_ENABLE = no       # Use buzzer to emulate clicky switches
HD44780_ENABLE = no          # Enable support for HD44780 based LCDs

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

LAYOUTS = 65_ansi_blocker


M keyboards/gray_studio/think65/solder/rules.mk => keyboards/gray_studio/think65/solder/rules.mk +1 -1
@@ 32,7 32,7 @@ AUDIO_ENABLE = no            # Audio output on port C6
FAUXCLICKY_ENABLE = no       # Use buzzer to emulate clicky switches
HD44780_ENABLE = no          # Enable support for HD44780 based LCDs

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

LAYOUTS = 65_ansi_blocker


M keyboards/handwired/promethium/rules.mk => keyboards/handwired/promethium/rules.mk +1 -1
@@ 45,4 45,4 @@ SRC += rgbsps.c
SRC += analog.c
SRC += matrix.c

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/helix/pico/keymaps/biacco/rules.mk => keyboards/helix/pico/keymaps/biacco/rules.mk +1 -1
@@ 7,7 7,7 @@
#
EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
AUDIO_ENABLE = yes           # Audio output on port B5
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 6 Variables

M keyboards/helix/pico/keymaps/default/rules.mk => keyboards/helix/pico/keymaps/default/rules.mk +1 -1
@@ 7,7 7,7 @@
#
EXTRAKEY_ENABLE = yes       # Audio control and System control
AUDIO_ENABLE = yes          # Audio output on port B5
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 6 Variables

M keyboards/helix/pico/keymaps/mtei/rules.mk => keyboards/helix/pico/keymaps/mtei/rules.mk +1 -1
@@ 7,7 7,7 @@
#
EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
AUDIO_ENABLE = yes          # Audio output on port B5
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 6 Variables

M keyboards/helix/pico/local_features.mk => keyboards/helix/pico/local_features.mk +3 -3
@@ 106,10 106,10 @@ endif

ifeq ($(strip $(AUDIO_ENABLE)),yes)
  ifeq ($(strip $(RGBLIGHT_ENABLE)),yes)
    LINK_TIME_OPTIMIZATION_ENABLE = yes
    LTO_ENABLE = yes
  endif
  ifeq ($(strip $(OLED_ENABLE)),yes)
    LINK_TIME_OPTIMIZATION_ENABLE = yes
    LTO_ENABLE = yes
  endif
endif



@@ 120,7 120,7 @@ ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
     $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE))
     $(info -- CONSOLE_ENABLE     = $(CONSOLE_ENABLE))
     $(info -- OPT_DEFS           = $(OPT_DEFS))
     $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE))
     $(info -- LTO_ENABLE = $(LTO_ENABLE))
     $(info )
  endif
endif

M keyboards/helix/rev2/keymaps/default/rules.mk => keyboards/helix/rev2/keymaps/default/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/edvorakjp/rules.mk => keyboards/helix/rev2/keymaps/edvorakjp/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option
TAP_DANCE_ENABLE = yes

# Helix Spacific Build Options

M keyboards/helix/rev2/keymaps/five_rows/rules.mk => keyboards/helix/rev2/keymaps/five_rows/rules.mk +1 -1
@@ 11,7 11,7 @@
 #      yes, no  +1500
 #      yes, yes +3200
 #      no,  yes +400
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk => keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/froggy/rules.mk => keyboards/helix/rev2/keymaps/froggy/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/froggy_106/rules.mk => keyboards/helix/rev2/keymaps/froggy_106/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/led_test/rules.mk => keyboards/helix/rev2/keymaps/led_test/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/keymaps/yshrsmz/rules.mk => keyboards/helix/rev2/keymaps/yshrsmz/rules.mk +1 -1
@@ 5,7 5,7 @@
#   See TOP/keyboards/helix/rules.mk for a list of options that can be set.
#   See TOP/docs/config_options.md for more information.
#
LINK_TIME_OPTIMIZATION_ENABLE = no  # if firmware size over limit, try this option
LTO_ENABLE = no  # if firmware size over limit, try this option

# Helix Spacific Build Options
# you can uncomment and edit follows 7 Variables

M keyboards/helix/rev2/local_features.mk => keyboards/helix/rev2/local_features.mk +1 -1
@@ 119,7 119,7 @@ ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
     $(info -- OLED_DRIVER_ENABLE = $(OLED_DRIVER_ENABLE))
     $(info -- CONSOLE_ENABLE     = $(CONSOLE_ENABLE))
     $(info -- OPT_DEFS           = $(OPT_DEFS))
     $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE))
     $(info -- LTO_ENABLE = $(LTO_ENABLE))
     $(info )
  endif
endif

M keyboards/hineybush/h88/rules.mk => keyboards/hineybush/h88/rules.mk +1 -1
@@ 30,4 30,4 @@ UNICODE_ENABLE = no         # Unicode
BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/hotdox/keymaps/ninjonas/rules.mk => keyboards/hotdox/keymaps/ninjonas/rules.mk +1 -1
@@ 1,1 1,1 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes

M keyboards/id80/keymaps/via/rules.mk => keyboards/id80/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
VIA_ENABLE = yes

M keyboards/kc60/keymaps/noroadsleft/rules.mk => keyboards/kc60/keymaps/noroadsleft/rules.mk +1 -1
@@ 1,6 1,6 @@
# https://github.com/qmk/qmk_firmware/issues/3448#issuecomment-406636125
# EXTRAFLAGS        += -flto
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

MOUSEKEY_ENABLE = no        # Mouse keys
# COMMAND_ENABLE = no         # Commands for debug and configuration

M keyboards/keebio/bdn9/keymaps/via/rules.mk => keyboards/keebio/bdn9/keymaps/via/rules.mk +1 -1
@@ 1,5 1,5 @@
VIA_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
MOUSEKEY_ENABLE = yes
CONSOLE_ENABLE = yes
COMMAND_ENABLE = no

M keyboards/keebio/iris/keymaps/pvinis/rules.mk => keyboards/keebio/iris/keymaps/pvinis/rules.mk +1 -1
@@ 4,6 4,6 @@ RGBLIGHT_ENABLE  = yes  # rgb leds underlight
ENCODER_ENABLE   = yes  # rotary knob

# Some extra stuff to make firmware smaller.
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = no

M keyboards/keebio/iris/keymaps/via/rules.mk => keyboards/keebio/iris/keymaps/via/rules.mk +1 -1
@@ 1,2 1,2 @@
VIA_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk => keyboards/keebio/quefrency/keymaps/drashna_ms/rules.mk +1 -1
@@ 1,4 1,4 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
RGBLIGHT_ENABLE = yes
EXTRAKEY_ENABLE = yes
AUDIO_ENABLE = yes

M keyboards/keebio/quefrency/keymaps/via/rules.mk => keyboards/keebio/quefrency/keymaps/via/rules.mk +1 -1
@@ 1,3 1,3 @@
VIA_ENABLE = yes
CONSOLE_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/kyria/keymaps/ninjonas/rules.mk => keyboards/kyria/keymaps/ninjonas/rules.mk +2 -2
@@ 1,6 1,6 @@
OLED_DRIVER_ENABLE = yes   # Enables the use of OLED displays
ENCODER_ENABLE = yes       # Enables the use of one or more encoders
RGBLIGHT_ENABLE = yes      # Enable keyboard RGB underglow
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

SRC += oled.c
\ No newline at end of file
SRC += oled.c

M keyboards/kyria/rules.mk => keyboards/kyria/rules.mk +1 -1
@@ 31,6 31,6 @@ AUDIO_ENABLE = no          # Audio output on port C6
FAUXCLICKY_ENABLE = no     # Use buzzer to emulate clicky switches
HD44780_ENABLE = no        # Enable support for HD44780 based LCDs
SPLIT_KEYBOARD = yes       # Split common
LINK_TIME_OPTIMIZATION_ENABLE =yes 
LTO_ENABLE = yes

DEFAULT_FOLDER = kyria/rev1

M keyboards/launchpad/keymaps/via/rules.mk => keyboards/launchpad/keymaps/via/rules.mk +1 -1
@@ 1,3 1,3 @@
VIA_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
RGBLIGHT_ENABLE = yes

M keyboards/lily58/keymaps/ninjonas/rules.mk => keyboards/lily58/keymaps/ninjonas/rules.mk +1 -1
@@ 1,2 1,2 @@
OLED_DRIVER_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes

M keyboards/pinky/3/keymaps/ninjonas/rules.mk => keyboards/pinky/3/keymaps/ninjonas/rules.mk +1 -1
@@ 1,2 1,2 @@
MOUSEKEY_ENABLE = no
LINK_TIME_OPTIMIZATION_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes

M keyboards/planck/keymaps/oryx/rules.mk => keyboards/planck/keymaps/oryx/rules.mk +1 -1
@@ 1,6 1,6 @@
SRC += muse.c
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
COMMAND_ENABLE = no
MOUSEKEY_ENABLE = no

M keyboards/planck/keymaps/sascha/rules.mk => keyboards/planck/keymaps/sascha/rules.mk +1 -1
@@ 1,7 1,7 @@
AUTO_SHIFT_ENABLE = yes
AUTO_SHIFT_MODIFIERS = yes
UNICODE_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

ifeq ($(strip $(KEYBOARD)), planck/rev5)
BACKLIGHT_ENABLE = yes

M keyboards/planck/keymaps/tylerwince/rules.mk => keyboards/planck/keymaps/tylerwince/rules.mk +1 -1
@@ 1,7 1,7 @@
SRC += muse.c
# Set any rules.mk overrides for your specific keymap here.
# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
COMMAND_ENABLE = no
MOUSEKEY_ENABLE = no
TAP_DANCE_ENABLE=yes

M keyboards/preonic/rev1/rules.mk => keyboards/preonic/rev1/rules.mk +1 -1
@@ 34,4 34,4 @@ SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend

LAYOUTS = ortho_5x12

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/preonic/rev2/rules.mk => keyboards/preonic/rev2/rules.mk +1 -1
@@ 34,4 34,4 @@ SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend

LAYOUTS = ortho_5x12

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk => keyboards/rgbkb/sol/keymaps/kageurufu/rules.mk +1 -2
@@ 11,11 11,10 @@ LED_MIRRORED            = no        # Mirror LEDs across halves (enable DIP 1 on
RGB_MATRIX_ENABLE       = WS2812    # Enable per-key coordinate based RGB effects. Do not enable with RGBlight

# Userspace implements their own LTO
LINK_TIME_OPTIMIZATION_ENABLE = no
LTO_ENABLE = no



# Do not edit past here

include keyboards/$(KEYBOARD)/post_rules.mk


M keyboards/rgbkb/sol/rev2/rules.mk => keyboards/rgbkb/sol/rev2/rules.mk +1 -1
@@ 29,7 29,7 @@ IOS_DEVICE_ENABLE       = no        # Limit max brightness to connect to IOS dev
OLED_DRIVER_ENABLE      = no        # Enable the OLED Driver
EXTRA_ENCODERS_ENABLE   = no        # Enables 3 encoders per side (up from 1, not compatible with OLED_DRIVER_ENABLE)
SWAP_HANDS_ENABLE       = no        # Enable one-hand typing
LINK_TIME_OPTIMIZATION_ENABLE = yes # Enable Link Time Optimizations greatly reducing firmware size by disabling the old Macros and Functions features
LTO_ENABLE = yes # Enable Link Time Optimizations greatly reducing firmware size by disabling the old Macros and Functions features

# Special RGB Matrix, OLED, & Encoder Control Menu!
RGB_OLED_MENU           = no        # Enabled by setting this to the encoder index (0-5) you wish to use to control the menu.

M keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk => keyboards/rgbkb/zygomorph/keymaps/5x6pad/rules.mk +1 -1
@@ 19,7 19,7 @@ SWAP_HANDS_ENABLE = no      # Enable one-hand typing
ENCODER_ENABLE = yes        # Enable rotary encoder
OLED_DRIVER_ENABLE = no     # Enable the OLED Driver
IOS_DEVICE_ENABLE = no      # Limit max brightness to connect to IOS device (iPad,iPhone)
LINK_TIME_OPTIMIZATION_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.
LTO_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.

# Do not edit past here


M keyboards/rgbkb/zygomorph/keymaps/default/rules.mk => keyboards/rgbkb/zygomorph/keymaps/default/rules.mk +1 -1
@@ 19,7 19,7 @@ SWAP_HANDS_ENABLE = no      # Enable one-hand typing
ENCODER_ENABLE = yes        # Enable rotary encoder
OLED_DRIVER_ENABLE = no     # Enable the OLED Driver
IOS_DEVICE_ENABLE = no      # Limit max brightness to connect to IOS device (iPad,iPhone)
LINK_TIME_OPTIMIZATION_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.
LTO_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.

# Do not edit past here


M keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk => keyboards/rgbkb/zygomorph/keymaps/default_oled/rules.mk +1 -1
@@ 19,7 19,7 @@ SWAP_HANDS_ENABLE = no      # Enable one-hand typing
ENCODER_ENABLE = yes        # Enable rotary encoder
OLED_DRIVER_ENABLE = yes    # Enable the OLED Driver
IOS_DEVICE_ENABLE = no      # Limit max brightness to connect to IOS device (iPad,iPhone)
LINK_TIME_OPTIMIZATION_ENABLE = yes     # Enable optimizations to reduce firmware size. Also disables action macros and functions.
LTO_ENABLE = yes     # Enable optimizations to reduce firmware size. Also disables action macros and functions.

# Do not edit past here


M keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk => keyboards/rgbkb/zygomorph/keymaps/xulkal/rules.mk +1 -1
@@ 19,7 19,7 @@ SWAP_HANDS_ENABLE = no      # Enable one-hand typing
ENCODER_ENABLE = no         # Enable rotary encoder
OLED_DRIVER_ENABLE = no     # Enable the OLED Driver
IOS_DEVICE_ENABLE = no      # Limit max brightness to connect to IOS device (iPad,iPhone)
LINK_TIME_OPTIMIZATION_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.
LTO_ENABLE = no      # Enable optimizations to reduce firmware size. Also disables action macros and functions.

# Do not edit past here


M keyboards/tg4x/rules.mk => keyboards/tg4x/rules.mk +1 -1
@@ 31,4 31,4 @@ AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
HD44780_ENABLE = no         # Enable support for HD44780 based LCDs

LINK_TIME_OPTIMIZATION_ENABLE = yes
\ No newline at end of file
LTO_ENABLE = yes

M keyboards/tkc/candybar/lefty/rules.mk => keyboards/tkc/candybar/lefty/rules.mk +1 -1
@@ 5,7 5,7 @@ MCU = STM32F072
#   comment out to disable the options.
#
# EXTRAFLAGS+=-flto
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
BACKLIGHT_ENABLE = no
BOOTMAGIC_ENABLE = lite  # Virtual DIP switch configuration
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)

M keyboards/tkc/candybar/righty/rules.mk => keyboards/tkc/candybar/righty/rules.mk +1 -1
@@ 5,7 5,7 @@ MCU = STM32F072
#   comment out to disable the options.
#
# EXTRAFLAGS+=-flto
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
BACKLIGHT_ENABLE = no
BOOTMAGIC_ENABLE = lite  # Virtual DIP switch configuration
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)

M keyboards/v60_type_r/rules.mk => keyboards/v60_type_r/rules.mk +1 -1
@@ 32,6 32,6 @@ BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

LAYOUTS = 60_ansi 60_iso

M keyboards/vitamins_included/rules.mk => keyboards/vitamins_included/rules.mk +1 -1
@@ 25,4 25,4 @@ LAYOUTS = ortho_4x12

DEFAULT_FOLDER = vitamins_included/rev2

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

M keyboards/xd004/v1/config.h => keyboards/xd004/v1/config.h +1 -1
@@ 75,6 75,6 @@ further optimizations can be done on that side.

/* disable action features */
// #define NO_ACTION_ONESHOT // 462 bytes <- this needs to be un-commented out if Link Time Optimization is disabled, otherwise file is too large
// The two below are implicit since we use LINK_TIME_OPTIMIZATION_ENABLE (in rules.mk)
// The two below are implicit since we use LTO_ENABLE (in rules.mk)
// #define NO_ACTION_MACRO
// #define NO_ACTION_FUNCTION

M keyboards/xd004/v1/rules.mk => keyboards/xd004/v1/rules.mk +1 -1
@@ 27,6 27,6 @@ RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.
SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
SPACE_CADET_ENABLE = no
# Saves about 5% of space:
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

#LAYOUTS = ortho_1x4

M keyboards/xd84/rules.mk => keyboards/xd84/rules.mk +1 -1
@@ 31,7 31,7 @@ BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
HD44780_ENABLE = no         # Enable support for HD44780 based LCDs
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# custom matrix setup
CUSTOM_MATRIX = lite

M keyboards/xd96/rules.mk => keyboards/xd96/rules.mk +1 -1
@@ 31,7 31,7 @@ BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no           # Audio output on port C6
FAUXCLICKY_ENABLE = no      # Use buzzer to emulate clicky switches
HD44780_ENABLE = no         # Enable support for HD44780 based LCDs
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# custom matrix setup
CUSTOM_MATRIX = lite

M keyboards/yushakobo/quick7/config.h => keyboards/yushakobo/quick7/config.h +1 -1
@@ 192,7 192,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_ONESHOT

/* disable these deprecated features by default */
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
#ifndef LTO_ENABLE
  #define NO_ACTION_MACRO
  #define NO_ACTION_FUNCTION
#endif

M show_options.mk => show_options.mk +1 -2
@@ 82,8 82,7 @@ OTHER_OPTION_NAMES = \
  RGB_MATRIX_KEYPRESSES \
  LED_MIRRORED \
  RGBLIGHT_FULL_POWER \
  Link_Time_Optimization \
  LINK_TIME_OPTIMIZATION_ENABLE
  LTO_ENABLE

define NAME_ECHO
	@echo "  $1 = $($1)		# $(origin $1)"

M tmk_core/common.mk => tmk_core/common.mk +3 -6
@@ 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

M tmk_core/common/action.h => tmk_core/common/action.h +1 -1
@@ 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

M tmk_core/common/command.c => tmk_core/common/command.c +1 -1
@@ 180,7 180,7 @@ static void print_version(void) {
#ifdef NKRO_ENABLE
          " NKRO"
#endif
#ifdef LINK_TIME_OPTIMIZATION_ENABLE
#ifdef LTO_ENABLE
          " LTO"
#endif


M users/bcat/rules.mk => users/bcat/rules.mk +1 -1
@@ 14,7 14,7 @@ EXTRAKEY_ENABLE = yes
NKRO_ENABLE = yes

# Enable link-time optimization to reduce binary size.
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# Disable unused build options on all keyboards.
COMMAND_ENABLE = no

M users/dshields/rules.mk => users/dshields/rules.mk +1 -2
@@ 10,7 10,7 @@ SPACE_CADET_ENABLE    = no
LEADER_ENABLE         = no
DYNAMIC_MACRO_ENABLE  = yes

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

ifeq ($(strip $(KEYBOARD)), planck/rev3)
	AUDIO_ENABLE	  = no


@@ 29,4 29,3 @@ ifeq ($(strip $(KEYBOARD)), planck/light)
	BACKLIGHT_ENABLE  = no
	RGB_MATRIX_ENABLE = yes
endif


M users/issmirnov/rules.mk => users/issmirnov/rules.mk +1 -1
@@ 4,7 4,7 @@ SRC += issmirnov.c

# https://www.reddit.com/r/olkb/comments/bmpgjm/programming_help/
# Should shave 2000 bytes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes

# Enable debugging only when needed.
CONSOLE_ENABLE = yes # +400 bytes (hid_listen support)

M users/kuchosauronad0/rules.mk => users/kuchosauronad0/rules.mk +2 -2
@@ 1,7 1,7 @@
SRC += kuchosauronad0.c \
	   process_records.c

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
SPACE_CADET_ENABLE            = no

ifneq ($(strip $(RGBLIGHT_ENABLE)),yes )


@@ 24,7 24,7 @@ ifeq ($(strip $(LEADER_ENABLE)), yes)
     SRC += leader.c
endif

ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") 
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
     SRC += secrets.c
endif
ifeq ($(strip $(NO_SECRETS)), yes)

M users/pvinis/rules.mk => users/pvinis/rules.mk +1 -1
@@ 14,6 14,6 @@ SRC += pvinis.c # add userspace file

## Some extra stuff to make firmware smaller.

# LINK_TIME_OPTIMIZATION_ENABLE = yes
# LTO_ENABLE = yes
# CONSOLE_ENABLE = no
# COMMAND_ENABLE = no

M users/yanfali/rules.mk => users/yanfali/rules.mk +1 -1
@@ 2,7 2,7 @@ BOOTMAGIC = lite
DYNAMIC_KEYMAP_ENABLE = no
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
AUDIO_ENABLE = no

# only enable audio on specific boards

M users/yet-another-developer/rules.mk => users/yet-another-developer/rules.mk +1 -1
@@ 1,7 1,7 @@
SRC += yet-another-developer.c \
       process_records.c

LINK_TIME_OPTIMIZATION_ENABLE = yes
LTO_ENABLE = yes
SPACE_CADET_ENABLE            = no

ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)