Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33846
Change subject: Makefile.inc, payloads: Enable -Wvla ......................................................................
Makefile.inc, payloads: Enable -Wvla
Variable length arrays are dangerous, so let's make sure they don't sneak back into coreboot or any of the payloads.
Change-Id: Idf2488cf0efab51c9569a3789ae953368b61880c Signed-off-by: Jacob Garber jgarber1@ualberta.ca --- M Makefile.inc M payloads/bayou/Makefile M payloads/coreinfo/Makefile M payloads/libpayload/Makefile.inc M payloads/linuxcheck/Makefile M payloads/nvramcui/Makefile 6 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/33846/1
diff --git a/Makefile.inc b/Makefile.inc index 362243e..498674e 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -401,7 +401,7 @@
CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs +CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wvla CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time -Wtype-limits CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie diff --git a/payloads/bayou/Makefile b/payloads/bayou/Makefile index 7a4b08b..b893ca7 100644 --- a/payloads/bayou/Makefile +++ b/payloads/bayou/Makefile @@ -39,7 +39,7 @@ OBJECTS-$(CONFIG_NRV2B) += nrv2b.o OBJECTS-$(CONFIG_BUILTIN_LAR) += builtin-lar.o
-CFLAGS= -Wall -Werror -Os $(FFLAGS-y) +CFLAGS= -Wall -Wvla -Werror -Os $(FFLAGS-y) LDFLAGS=-Wl,-T,bayou.ldscript -static LIBGCC=$(shell $(CC) -m32 -print-libgcc-file-name)
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index 50659d3..bcc5354 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -83,7 +83,7 @@ LPCC := CC="$(CC)" $(LIBPAYLOAD_OBJ)/bin/lpgcc LPAS := AS="$(AS)" $(LIBPAYLOAD_OBJ)/bin/lpas
-CFLAGS += -Wall -Werror -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES) +CFLAGS += -Wall -Wvla -Werror -Os -fno-builtin $(CFLAGS_$(ARCH-y)) $(INCLUDES)
ifneq ($(strip $(HAVE_DOTCONFIG)),) include $(src)/.config diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc index 7787762..aae3921 100644 --- a/payloads/libpayload/Makefile.inc +++ b/payloads/libpayload/Makefile.inc @@ -63,7 +63,7 @@ CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer CFLAGS += -ffunction-sections -fdata-sections CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs +CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wvla CFLAGS += -Wstrict-aliasing -Wshadow -Werror
$(obj)/libpayload-config.h: $(KCONFIG_AUTOHEADER) diff --git a/payloads/linuxcheck/Makefile b/payloads/linuxcheck/Makefile index b967369..838c90d 100644 --- a/payloads/linuxcheck/Makefile +++ b/payloads/linuxcheck/Makefile @@ -3,7 +3,7 @@ # build libpayload and put .config file in $(CURDIR) instead of ../libpayload # to avoid pollute the libpayload source directory and possible conflicts LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config" -CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib +CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib ifeq ($(CONFIG_ARCH_X86),y) TARGETARCH = i386 endif diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile index c6a9cd0..bf7053b 100644 --- a/payloads/nvramcui/Makefile +++ b/payloads/nvramcui/Makefile @@ -3,7 +3,7 @@ # build libpayload and put .config file in $(CURDIR) instead of ../libpayload # to avoid pollute the libpayload source directory and possible conflicts LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config" -CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib +CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
all: nvramcui.elf