[Skiboot] [PATCH] Don't warn about stack size on host binaries

Anton Blanchard anton at ozlabs.org
Mon Aug 2 11:02:10 AEST 2021

I'm hitting a stack size warning when building pflash:

common/arch_flash_powerpc.c: In function ‘get_dev_mtd.constprop’:
common/arch_flash_powerpc.c:177:1: error: the frame size of 8240
    bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

That function has 2 PATH_MAX strings, each of which will use up 4kB of

We've tried to work around the issue of stack size warnings on host
binaries in a few places, with limited success. This patch removes the
check completely instead. We need to modify the HOSTCFLAGS variable
assignment to be immediate for this to work.

Signed-off-by: Anton Blanchard <anton at ozlabs.org>

diff --git a/Makefile.main b/Makefile.main
index d21f27be..189b4ae4 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -51,7 +51,7 @@ endif
 # Host tools and options
 HOSTEND=$(shell uname -m | sed -e 's/^i.*86$$/LITTLE/' -e 's/^x86.*/LITTLE/' -e 's/^ppc64le/LITTLE/' -e 's/^ppc.*/BIG/')
 HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11)
 HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-m64)
 HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
@@ -62,9 +62,6 @@ HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \
 # We want small stack usage for skiboot
-# but host compilation of unit tests tend to inline heavily,
-# which creates larger stack frames and triggering useless warnings
-HOSTCFLAGS += -Wframe-larger-than=4096
 CWARNS += -Wframe-larger-than=1024
 HOSTGCOVCFLAGS = -fprofile-arcs -ftest-coverage -lgcov -O0 -g -pg
diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk
index 8d5a7bfd..1d1b6048 100644
--- a/external/pflash/rules.mk
+++ b/external/pflash/rules.mk
@@ -52,7 +52,6 @@ $(LIBFLASH_OBJS): libflash-%.o : libflash/%.c | links
 $(CCAN_OBJS): ccan-list-%.o: ccan/list/%.c | links
 	$(Q_CC)$(CC) $(CFLAGS) -c $< -o $@
-$(EXE): CFLAGS += -Wframe-larger-than=2048
 $(EXE): $(OBJS)
 	$(Q_CC)$(CC) $(LDFLAGS) $(CFLAGS) $^ -lrt -o $@

More information about the Skiboot mailing list