qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 04/12] build-sys: add AddressSanitizer when --enable


From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH 04/12] build-sys: add AddressSanitizer when --enable-debug if possible
Date: Fri, 8 Dec 2017 01:58:17 +0100

Enable ASAN by default if the compiler supports it.

If necessary, we could consider a seperate configure option, although
I like the idea to have it enabled by default with --enable-debug, so
other people more actively fix errors/warnings, and having less
configure options in general.

Signed-off-by: Marc-André Lureau <address@hidden>
---
 configure | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index 2b8c71f522..52d9fd71e5 100755
--- a/configure
+++ b/configure
@@ -5129,6 +5129,11 @@ elif test "$fortify_source" = "yes" ; then
   CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
 elif test "$debug" = "no"; then
   CFLAGS="-O2 $CFLAGS"
+elif test "$debug" = "yes"; then
+    write_c_skeleton;
+    if compile_prog "-fsanitize=address" ""; then
+        CFLAGS="-fsanitize=address $CFLAGS"
+    fi
 fi
 
 ##########################################
-- 
2.15.1.355.g36791d7216




reply via email to

[Prev in Thread] Current Thread [Next in Thread]