mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
Cc: Ahmad Fatoum <>
Subject: [PATCH 2/3] kbuild: force compiler to assume two's complement
Date: Thu, 15 Oct 2020 11:00:55 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 <>
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 164f23e872df..ae713b5a665b 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

barebox mailing list

  reply	other threads:[~2020-10-15  9:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  9:00 [PATCH 1/3] sandbox: fix link error when UBSAN is selected without ASAN Ahmad Fatoum
2020-10-15  9:00 ` Ahmad Fatoum [this message]
2020-10-15  9:00 ` [PATCH 3/3] Revert "common: ubsan: ignore shifting one into sign bit" Ahmad Fatoum
2020-10-19  7:58 ` [PATCH 1/3] sandbox: fix link error when UBSAN is selected without ASAN Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox