anchao commented on code in PR #8903: URL: https://github.com/apache/nuttx/pull/8903#discussion_r1162961965
########## arch/arm/src/common/Toolchain.defs: ########## @@ -248,6 +214,27 @@ ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y) ARCHOPTIMIZATION += -fshort-enums endif +# Link Time Optimization + +ifeq ($(CONFIG_LTO_THIN),y) + ARCHOPTIMIZATION += -flto=thin + ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y) + LDFLAGS += --lto + endif +else ifeq ($(CONFIG_LTO_FULL),y) + ifeq ($(GCCVER),12.2) + ARCHOPTIMIZATION += -flto=auto Review Comment: we can skip the version check, always set -flto-auto as default -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org