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 @@ -103,6 +103,18 @@ CFLAGS += $(OPTIMIZATION_FLAGS)
103
103
104
104
CFLAGS += $(INC ) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS ) $(CFLAGS_MOD ) $(COPT )
105
105
106
+ # Nordic Softdevice SDK header files contains inline assembler that has
107
+ # broken constraints. As a result the IPA-modref pass, introduced in gcc-11,
108
+ # is able to "prove" that arguments to wrapper functions generated with
109
+ # the SVCALL() macro are unused and, as a result, the optimizer will remove
110
+ # code within the callers that sets up these arguments (which results in
111
+ # a broken bootloader). The broken headers come from Nordic-supplied zip
112
+ # files and are not trivial to patch so, for now, we'll simply disable the
113
+ # new gcc-11 inter-procedural optimizations.
114
+ ifeq (,$(findstring unrecognized,$(shell $(CC ) $(CFLAGS ) -fno-ipa-modref 2>&1) ) )
115
+ CFLAGS += -fno-ipa-modref
116
+ endif
117
+
106
118
# Undo some warnings.
107
119
# nrfx does casts that increase alignment requirements.
108
120
CFLAGS += -Wno-cast-align
You can’t perform that action at this time.
0 commit comments