File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,18 @@ CFLAGS += -Wno-unused-parameter -Wno-expansion-to-defined
270270# TinyUSB tusb_hal_nrf_power_event
271271CFLAGS += -Wno-cast-function-type
272272
273+ # Nordic Softdevice SDK header files contains inline assembler that has
274+ # broken constraints. As a result the IPA-modref pass, introduced in gcc-11,
275+ # is able to "prove" that arguments to wrapper functions generated with
276+ # the SVCALL() macro are unused and, as a result, the optimizer will remove
277+ # code within the callers that sets up these arguments (which results in
278+ # a broken bootloader). The broken headers come from Nordic-supplied zip
279+ # files and are not trivial to patch so, for now, we'll simply disable the
280+ # new gcc-11 inter-procedural optimizations.
281+ ifeq (,$(findstring unrecognized,$(shell $(CC ) $(CFLAGS ) -fno-ipa-modref 2>&1) ) )
282+ CFLAGS += -fno-ipa-modref
283+ endif
284+
273285# Defined Symbol (MACROS)
274286CFLAGS += -D__HEAP_SIZE=0
275287CFLAGS += -DCONFIG_GPIO_AS_PINRESET
You can’t perform that action at this time.
0 commit comments