From patchwork Fri Dec 15 15:06:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 849221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yyvBN6yx3z9sBZ for ; Sat, 16 Dec 2017 02:15:24 +1100 (AEDT) Received: from localhost ([::1]:47057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePrhq-0002fF-Fc for incoming@patchwork.ozlabs.org; Fri, 15 Dec 2017 10:15:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePraH-0004N9-6C for qemu-devel@nongnu.org; Fri, 15 Dec 2017 10:07:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePraD-0001F4-B0 for qemu-devel@nongnu.org; Fri, 15 Dec 2017 10:07:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePraD-0001ED-5S for qemu-devel@nongnu.org; Fri, 15 Dec 2017 10:07:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5313725C54 for ; Fri, 15 Dec 2017 15:07:28 +0000 (UTC) Received: from localhost (ovpn-112-51.ams2.redhat.com [10.36.112.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B3DA87940; Fri, 15 Dec 2017 15:07:23 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Fri, 15 Dec 2017 16:06:50 +0100 Message-Id: <20171215150659.1811-5-marcandre.lureau@redhat.com> In-Reply-To: <20171215150659.1811-1-marcandre.lureau@redhat.com> References: <20171215150659.1811-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 15 Dec 2017 15:07:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 04/13] build-sys: add AddressSanitizer when --enable-debug if possible X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Marc-André Lureau --- 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 ##########################################