public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] configure: add support for memory sanitizer (--enable-msan)
@ 2020-03-17 23:18 Matthias Maennich
  2020-03-18 21:45 ` Dodji Seketeli
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Maennich @ 2020-03-17 23:18 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, maennich

Similarly to asan, tsan and ubsan, add support for msan conditionally at
configure time. This allows us to track down issues caused by using
uninitialized values.

        * configure.ac: Add configure options for -fsanitize=memory

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 configure.ac | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 50a50c6c8932..9f30ea38cf86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,12 @@ AC_ARG_ENABLE(asan,
 	      ENABLE_ASAN=$enableval,
 	      ENABLE_ASAN=no)
 
+AC_ARG_ENABLE(msan,
+	      AS_HELP_STRING([--enable-msan=yes|no],
+			     [enable the support of building with -fsanitize=memory)]),
+	      ENABLE_MSAN=$enableval,
+	      ENABLE_MSAN=no)
+
 AC_ARG_ENABLE(tsan,
 	      AS_HELP_STRING([--enable-tsan=yes|no],
 			     [enable the support of building with -fsanitize=thread)]),
@@ -620,6 +626,11 @@ if test x$ENABLE_ASAN = xyes; then
     CXXFLAGS="$CXXFLAGS -fsanitize=address"
 fi
 
+if test x$ENABLE_MSAN = xyes; then
+    CFLAGS="$CFLAGS -fsanitize=memory -fsanitize-memory-track-origins"
+    CXXFLAGS="$CXXFLAGS -fsanitize=memory -fsanitize-memory-track-origins"
+fi
+
 if test x$ENABLE_TSAN = xyes; then
     CFLAGS="$CFLAGS -fsanitize=thread"
     CXXFLAGS="$CXXFLAGS -fsanitize=thread"
@@ -918,6 +929,7 @@ AC_MSG_NOTICE([
     Enable python 3				   : ${ENABLE_PYTHON3}
     Enable running tests under Valgrind            : ${enable_valgrind}
     Enable build with -fsanitize=address    	   : ${ENABLE_ASAN}
+    Enable build with -fsanitize=memory    	   : ${ENABLE_MSAN}
     Enable build with -fsanitize=thread    	   : ${ENABLE_TSAN}
     Enable build with -fsanitize=undefined  	   : ${ENABLE_UBSAN}
     Generate html apidoc	                   : ${ENABLE_APIDOC}
-- 
2.25.1.481.gfbce0eb801-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] configure: add support for memory sanitizer (--enable-msan)
  2020-03-17 23:18 [PATCH] configure: add support for memory sanitizer (--enable-msan) Matthias Maennich
@ 2020-03-18 21:45 ` Dodji Seketeli
  0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2020-03-18 21:45 UTC (permalink / raw)
  To: Matthias Maennich; +Cc: libabigail, kernel-team

Matthias,

Matthias Maennich <maennich@google.com> a écrit:

> Similarly to asan, tsan and ubsan, add support for msan conditionally at
> configure time. This allows us to track down issues caused by using
> uninitialized values.
>
>         * configure.ac: Add configure options for -fsanitize=memory

Applied to master.

Thanks!

-- 
		Dodji

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-18 21:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 23:18 [PATCH] configure: add support for memory sanitizer (--enable-msan) Matthias Maennich
2020-03-18 21:45 ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).