Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit62e0fa0

Browse files
pi-anldpgeorge
authored andcommitted
nrf/Makefile: Enable LTO by default only on newer gcc.
Older gcc/binutils linker does not support lto with wrap.Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent56c1617 commit62e0fa0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎ports/nrf/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ CFLAGS_MCU_m4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-s
129129

130130
CFLAGS_MCU_m0 =$(CFLAGS_CORTEX_M) -fshort-enums -mtune=cortex-m0 -mcpu=cortex-m0 -mfloat-abi=soft
131131

132+
# linker wrap does not work with lto on older gcc/binutils: https://sourceware.org/bugzilla/show_bug.cgi?id=24406
133+
GCC_VERSION =$(shell arm-none-eabi-gcc --version | sed -n -E 's:^arm.*([0-9]+\.[0-9]+\.[0-9]+).*$$:\1:p')
134+
GCC_MAJOR_VERS =$(word 1,$(subst ., ,$(GCC_VERSION)))
135+
ifeq ($(shell test$(GCC_MAJOR_VERS) -ge 10; echo$$?),0)
132136
LTO ?= 1
137+
else
138+
LTO ?= 0
139+
endif
140+
133141
ifeq ($(LTO),1)
134142
CFLAGS += -flto
135143
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp