From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: afa@pengutronix.de
Subject: [PATCH 4/5] sandbox: support Address and UndefinedBehavior sanitizers
Date: Thu, 22 Aug 2019 08:19:40 +0200 [thread overview]
Message-ID: <20190822061941.6093-5-ahmad@a3f.at> (raw)
In-Reply-To: <20190822061941.6093-1-ahmad@a3f.at>
For the hosted implementation, we just need to pass the appropriate
options at compile and link time. No further arch-specific
code needed.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
arch/sandbox/Kconfig | 2 ++
arch/sandbox/Makefile | 13 ++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 5227cb624f2b..254ae9a5d30c 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -2,6 +2,8 @@ config SANDBOX
bool
select OFTREE
select GPIOLIB
+ select ARCH_HAS_UBSAN_SANITIZE_ALL
+ select HAVE_ARCH_KASAN
default y
config ARCH_TEXT_BASE
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 85c70b5e8059..1504b2390ddd 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -45,9 +45,20 @@ ifeq ($(CONFIG_GPIO_LIBFTDI1),y)
FTDI1_LIBS := $(shell pkg-config libftdi1 --libs)
endif
+ifeq ($(CONFIG_KASAN),y)
+SANITIZERS += -fsanitize=address
+endif
+
+ifeq ($(CONFIG_UBSAN),y)
+SANITIZERS += $(CFLAGS_UBSAN)
+endif
+
+CPPFLAGS += $(SANITIZERS)
+
cmd_barebox__ = $(CC) -o $@ -Wl,-T,$(barebox-lds) \
-Wl,--start-group $(barebox-common) -Wl,--end-group \
- -lrt -lpthread $(SDL_LIBS) $(FTDI1_LIBS)
+ -lrt -lpthread $(SDL_LIBS) $(FTDI1_LIBS) \
+ $(SANITIZERS)
common-y += $(BOARD) arch/sandbox/os/
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-08-22 6:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 6:19 [PATCH 0/5] sandbox: support -fsanitize={address,ubsan} Ahmad Fatoum
2019-08-22 6:19 ` [PATCH 1/5] sandbox: include header to provide missing prototype Ahmad Fatoum
2019-08-22 6:19 ` [PATCH 2/5] common: add generic CONFIG_UBSAN_SANITIZE_ALL plumbing Ahmad Fatoum
2019-08-22 6:19 ` [PATCH 3/5] common: add generic CONFIG_KASAN option Ahmad Fatoum
2019-08-22 6:19 ` Ahmad Fatoum [this message]
2019-08-22 6:19 ` [PATCH 5/5] commands: fix unaligned accesses of aliased commands on amd64 Ahmad Fatoum
2019-08-23 7:36 ` Sascha Hauer
2019-08-23 9:08 ` Ahmad Fatoum
2019-08-23 9:13 ` [PATCH 0/5] sandbox: support -fsanitize={address,ubsan} Ahmad Fatoum
2019-08-23 12:31 ` Ahmad Fatoum
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190822061941.6093-5-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=afa@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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