Skip to content

Commit

Permalink
cpu/cortexm_common: enable LTO by default
Browse files Browse the repository at this point in the history
LTO support in GCC should be pretty mature by now, to a point where
Fedora enables it by default for all packages[0].

Let's follow suit by enabling LTO for our Cortex-M target.
This is the most mature target and is well-tested regularly.
So if any issues are caused by this, they should pop up fairly quick.

[0] https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/CQEI3UGK5HSHZ7JHE7NRTQHBWQYWA5HM/
  • Loading branch information
benpicco committed Aug 19, 2020
1 parent 5dd8d89 commit 83f7f78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions makefiles/arch/cortexm.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ TARGET_ARCH ?= arm-none-eabi
# define build specific options
CFLAGS_CPU = -mcpu=$(MCPU) -mlittle-endian -mthumb $(CFLAGS_FPU)

# enable LTO by default
LTO ?= 1

ifneq (llvm,$(TOOLCHAIN))
# Clang (observed with v3.7) does not understand -mno-thumb-interwork, only add if
# not building with LLVM
Expand Down

0 comments on commit 83f7f78

Please sign in to comment.