From ceb5431a2feccc0bbe7e650c90946056513cba88 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 15 Oct 2020 11:00:55 +0200 Subject: 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 Signed-off-by: Sascha Hauer --- Makefile | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3