From 7c8d331fbb0bb51af441f7e7615be2486e56c0d2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 4 Aug 2017 16:36:21 -0700 Subject: [PATCH] Fine-tune compiler flags Per default, GCC enables -fdelete-null-pointer-checks, which is harmful and hence we should disable it: "Assume that programs cannot safely dereference null pointers, and that no code or data element resides there." We want to be careful with our stack usage, hence enable -fconserve-stack: "Attempt to minimize stack usage. The compiler will attempt to use less stack space, even if that makes the program slower." Change-Id: I74eac2b07c986553f79898a2f2e57bbead4223f8 Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/20883 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.inc b/Makefile.inc index 49344a6c74..679e0ac393 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -363,6 +363,7 @@ CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS_common += -Wstrict-aliasing -Wshadow -Wdate-time CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -ffunction-sections -fdata-sections -fno-pie +CFLAGS_common += -fno-delete-null-pointer-checks -fconserve-stack ADAFLAGS_common += -gnatg -gnatp ADAFLAGS_common += -Wuninitialized -Wall -Werror