Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/cortexm_common: enable LTO by default #14795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions makefiles/arch/cortexm.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ TARGET_ARCH ?= arm-none-eabi
CFLAGS_CPU = -mcpu=$(MCPU) -mlittle-endian -mthumb $(CFLAGS_FPU)

ifneq (llvm,$(TOOLCHAIN))
# enable LTO by default
LTO ?= 1

# Clang (observed with v3.7) does not understand -mno-thumb-interwork, only add if
# not building with LLVM
CFLAGS += -mno-thumb-interwork
Expand Down
1 change: 0 additions & 1 deletion makefiles/cflags.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CXXUWFLAGS += -std=%
CXXUWFLAGS += -Wstrict-prototypes -Wold-style-definition

ifeq ($(LTO),1)
$(warning Building with Link-Time-Optimizations is currently an experimental feature. Expect broken binaries.)
LTOFLAGS = -flto
LINKFLAGS += $(LTOFLAGS)
endif
Expand Down