Skip to content

Commit

Permalink
toolchains: Compiler versioning adds --print-memory-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
W-M-R committed Dec 25, 2024
1 parent 3c1086a commit 1e24fc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 12 additions & 8 deletions arch/arm/src/common/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,18 @@ else
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523

ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
ARCHOPTIMIZATION += --param=min-pagesize=0
LDFLAGS += --print-memory-usage
ifeq ($(CONFIG_ARCH_RAMFUNCS),y)
LDFLAGS += --no-warn-rwx-segments
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
ARCHOPTIMIZATION += --param=min-pagesize=0
LDFLAGS += --print-memory-usage
ifeq ($(CONFIG_ARCH_RAMFUNCS),y)
LDFLAGS += --no-warn-rwx-segments
else ifeq ($(CONFIG_BOOT_RUNFROMFLASH),)
LDFLAGS += --no-warn-rwx-segments
endif
endif
endif
endif
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/src/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)

endif
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
LDFLAGS += --no-warn-rwx-segments
LDFLAGS += --print-memory-usage
endif
endif
Expand Down

0 comments on commit 1e24fc9

Please sign in to comment.