From 339b7cce9ba701aecda7829c7fec6ce9f68fa30d Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 10 Jul 2023 16:32:51 +0000 Subject: [PATCH] Specifiable -fto parameter in makefiles. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16328 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/common/startup/ARM/compilers/GCC/rules.mk | 8 ++++++-- os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk | 8 ++++++-- os/common/startup/SIMIA32/compilers/GCC/rules.mk | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) 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