summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-10-15 11:00:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-19 09:58:30 +0200
commitceb5431a2feccc0bbe7e650c90946056513cba88 (patch)
tree41c02da3d67244651c6c9a110739e089fd8f4917
parentdf5840be03ca6f3ac1ef39afc47b5fed8e98b019 (diff)
downloadbarebox-ceb5431a2feccc0bbe7e650c90946056513cba88.tar.gz
barebox-ceb5431a2feccc0bbe7e650c90946056513cba88.tar.xz
kbuild: force compiler to assume two's complement
The kernel is compiled with this option and kernel code we port assumes that integer types are two's complement, so play it safe and disable optimizations that are possibly buggy in respect to barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c8e84575b6..92f318f9ab 100644
--- a/Makefile
+++ b/Makefile
@@ -619,6 +619,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning, trampolines)
KBUILD_CFLAGS += $(call cc-option, -fno-delete-null-pointer-checks,)
+# disable invalid "can't wrap" optimizations for signed / pointers
+KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
+
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
# Align the bit size of userspace programs with the kernel