8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2819609 commit 7551187Copy full SHA for 7551187
ports/nrf/Makefile
@@ -129,7 +129,15 @@ CFLAGS_MCU_m4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-s
129
130
CFLAGS_MCU_m0 = $(CFLAGS_CORTEX_M) -fshort-enums -mtune=cortex-m0 -mcpu=cortex-m0 -mfloat-abi=soft
131
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)
136
LTO ?= 1
137
+else
138
+LTO ?= 0
139
+endif
140
+
141
ifeq ($(LTO),1)
142
CFLAGS += -flto
143
else
0 commit comments