diff --git a/os/common/startup/ARM/compilers/GCC/rules.mk b/os/common/startup/ARM/compilers/GCC/rules.mk index 1b8a2df38..f0ae61540 100644 --- a/os/common/startup/ARM/compilers/GCC/rules.mk +++ b/os/common/startup/ARM/compilers/GCC/rules.mk @@ -23,8 +23,12 @@ ifneq ($(USE_LDOPT),) endif # Link time optimizations -ifeq ($(USE_LTO),yes) - OPT += -flto=auto +ifneq ($(USE_LTO),no) + ifeq ($(USE_LTO),yes) + OPT += -flto + else + OPT += -flto=$(USE_LTO) + endif endif # Undefined state stack size diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk index 1783f87ea..27a49149c 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk @@ -23,8 +23,12 @@ ifneq ($(USE_LDOPT),) endif # Link time optimizations -ifeq ($(USE_LTO),yes) - OPT += -flto=auto +ifneq ($(USE_LTO),no) + ifeq ($(USE_LTO),yes) + OPT += -flto + else + OPT += -flto=$(USE_LTO) + endif endif # FPU options default (Cortex-M4 and Cortex-M7 single precision). diff --git a/os/common/startup/SIMIA32/compilers/GCC/rules.mk b/os/common/startup/SIMIA32/compilers/GCC/rules.mk index 1dcd83c20..1c134dd14 100644 --- a/os/common/startup/SIMIA32/compilers/GCC/rules.mk +++ b/os/common/startup/SIMIA32/compilers/GCC/rules.mk @@ -23,8 +23,12 @@ ifneq ($(USE_LDOPT),) endif # Link time optimizations -ifeq ($(USE_LTO),yes) - OPT += -flto=auto +ifneq ($(USE_LTO),no) + ifeq ($(USE_LTO),yes) + OPT += -flto + else + OPT += -flto=$(USE_LTO) + endif endif # Output directory and files