Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84044?usp=email )
(
7 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Makefile.mk: Suppress stack-usage LTO link warning ......................................................................
Makefile.mk: Suppress stack-usage LTO link warning
Suppress the following warning during linking with gcc: src/drivers/spi/spi_flash.c: In function 'spi_flash_cmd_write': src/drivers/spi/spi_flash.c:138:5: error: stack usage might be unbounded [-Werror=stack-usage=] 138 | int spi_flash_cmd_write(const struct spi_slave *spi, const u8 *cmd,
Change-Id: If08d6d543a4fcff07003af8d1f8dd59ab79f42f8 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/84044 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M Makefile.mk 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Angel Pons: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/Makefile.mk b/Makefile.mk index 18ec01a..ca79d05 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -1339,12 +1339,14 @@ fi endif # CONFIG_CBFS_VERIFICATION
+LTO_LINK_CFLAGS := -Wno-stack-usage + define link_stage # $1 stage name ifeq ($(CONFIG_LTO),y) $$(objcbfs)/$(1).debug: $$$$($(1)-libs) $$$$($(1)-objs) @printf " LINK $$(subst $$(obj)/,,$$(@))\n" - $$(CC_$(1)) $$(CPPFLAGS_$(1)) $$(CFLAGS_$(1)) $$(LDFLAGS_$(1):%=-Wl,%) -o $$@ -L$$(obj) $$(COMPILER_RT_FLAGS_$(1):%=-Wl,%) -Wl,--whole-archive -Wl,--start-group $$(filter-out %.ld,$$($(1)-objs)) $$($(1)-libs) -Wl,--no-whole-archive $$(COMPILER_RT_$(1)) -Wl,--end-group -T $(call src-to-obj,$(1),$(CONFIG_MEMLAYOUT_LD_FILE)) + $$(CC_$(1)) $$(CPPFLAGS_$(1)) $$(CFLAGS_$(1)) $$(LDFLAGS_$(1):%=-Wl,%) $(LTO_LINK_CFLAGS) -o $$@ -L$$(obj) $$(COMPILER_RT_FLAGS_$(1):%=-Wl,%) -Wl,--whole-archive -Wl,--start-group $$(filter-out %.ld,$$($(1)-objs)) $$($(1)-libs) -Wl,--no-whole-archive $$(COMPILER_RT_$(1)) -Wl,--end-group -T $(call src-to-obj,$(1),$(CONFIG_MEMLAYOUT_LD_FILE)) else $$(objcbfs)/$(1).debug: $$$$($(1)-libs) $$$$($(1)-objs) @printf " LINK $$(subst $$(obj)/,,$$(@))\n"