Skip to content

Commit 95a734c

Browse files
W-M-Rxiaoxiang781216
authored andcommitted
toolchains: Compiler versioning adds --print-memory-usage
1 parent 8bb6712 commit 95a734c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

arch/arm/src/common/Toolchain.defs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,18 @@ else
312312
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
313313

314314
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
315-
ifeq ($(GCCVER),)
316-
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
317-
endif
318-
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
319-
ARCHOPTIMIZATION += --param=min-pagesize=0
320-
LDFLAGS += --print-memory-usage
321-
ifeq ($(CONFIG_ARCH_RAMFUNCS),y)
322-
LDFLAGS += --no-warn-rwx-segments
315+
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
316+
ifeq ($(GCCVER),)
317+
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
318+
endif
319+
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
320+
ARCHOPTIMIZATION += --param=min-pagesize=0
321+
LDFLAGS += --print-memory-usage
322+
ifeq ($(CONFIG_ARCH_RAMFUNCS),y)
323+
LDFLAGS += --no-warn-rwx-segments
324+
else ifeq ($(CONFIG_BOOT_RUNFROMFLASH),)
325+
LDFLAGS += --no-warn-rwx-segments
326+
endif
323327
endif
324328
endif
325329
endif

arch/arm64/src/Toolchain.defs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
207207

208208
endif
209209
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
210-
LDFLAGS += --no-warn-rwx-segments
211210
LDFLAGS += --print-memory-usage
212211
endif
213212
endif

0 commit comments

Comments
 (0)