summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2017-08-04 16:36:21 -0700
committerMartin Roth <martinroth@google.com>2017-08-11 15:56:12 +0000
commit7c8d331fbb0bb51af441f7e7615be2486e56c0d2 (patch)
tree6d402db70b1db457828d9afcf9a9b0bee235924a /Makefile.inc
parentb58366a4c056ca8a2dfed61963a1f92e66a2f4da (diff)
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 <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/20883 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc1
1 files changed, 1 insertions, 0 deletions
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