From patchwork Fri Jan 12 11:30:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 859795 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=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fVUX35QO"; dkim-atps=neutral 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 3zJ19R0Gzkz9s75 for ; Fri, 12 Jan 2018 22:43:55 +1100 (AEDT) Received: from localhost ([::1]:35250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZxkX-0000jr-1l for incoming@patchwork.ozlabs.org; Fri, 12 Jan 2018 06:43:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZxYh-0007KN-4T for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZxYg-0004ot-By for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:39 -0500 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:38253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZxYg-0004n5-6F for qemu-devel@nongnu.org; Fri, 12 Jan 2018 06:31:38 -0500 Received: by mail-wr0-x22d.google.com with SMTP id x1so857320wrb.5 for ; Fri, 12 Jan 2018 03:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WfgCfn8JMYH5WUWobgr721WcOZePAQ0aKDb1byldnMA=; b=fVUX35QOfdza+JzBMLBuhmfTxBzcDjvWJl3J/YacoxoxNwRuONR3z24ZZuoxgP7jTz IGTnJasDjPyYHrWN5T/nqXrQs0S258v5ZI4oK0s/XCUU8GbIcm2AF1j3JmunuwUlpyEU OFubJk+Zx1SCdNnHc+7aAV+UG1Owl3OyrvAP8z7shuOJspOcYb94Nszv5GjsOGJw9F9p 8iuIXEMlxSNLN/N/rYB6+4uzWz4bOZQ1wLnFHZ2backcQwOcVWjxpiqy7T3pR3iPA1lY U1lE2BpRJeVrg6gEQDG/BozGRHhgkhM91onh4R+9rDuFqRWXeV3y3L/RdROhiqagNbKd 24aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WfgCfn8JMYH5WUWobgr721WcOZePAQ0aKDb1byldnMA=; b=eiqTH2AURJdL0fRMe3WS2TR3MLSHHKbdZ8IHZ5F6meDFFB67ZzFqILVl4MeeBwvqvY p/SHLOJmjAi7DfZd5o/M/+u4DKg8p6LeE2z5K2dJiD1E2wYYO0bVBHQqIUhm7O+wak4w vp337LJUQgBzCa99lNNODRVlaRroBNsU0w1tMonUtkQxc+5pZrX4CSPU+HN7lZicPYl2 1ul9WQg9HwMM7yfoj3TKhvb2M7DpF9yzMgjpbtr4+dPdA4mG3biQKtnEsI0yXk4qA5xS uM6ckq7nkw6zuh6GrcCgnr+iVIKbFaP1uWwLYRmK82wBrO/GWmDHcEBmJjqt3MAF96lS qR2w== X-Gm-Message-State: AKGB3mLRW0Ta+OoW8wpjOzsYKsvag4GqYRaFV2IR3BG+yXGvcd9nQB7J StKh4Mw9elIdQdyy9BAgSZjbraOf X-Google-Smtp-Source: ACJfBovl4VTPa2CYJkHpSBenYFka02deyOtT599XfyngyeH59CK6PUNnBOSWxt4Ry/iudMKlfFE4ww== X-Received: by 10.223.181.2 with SMTP id a2mr24085847wrd.90.1515756696739; Fri, 12 Jan 2018 03:31:36 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id l8sm2732271wmg.46.2018.01.12.03.31.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 03:31:36 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 12:30:39 +0100 Message-Id: <1515756676-3860-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> References: <1515756676-3860-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22d Subject: [Qemu-devel] [PULL 15/52] build-sys: add some sanitizers 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" From: Marc-André Lureau Enable ASAN/UBSan by default if the compiler supports it. Typical slowdown introduced by AddressSanitizer is 2x. UBSan shouldn't have much impact on runtime cost. Signed-off-by: Marc-André Lureau Message-Id: <20180104160523.22995-8-marcandre.lureau@redhat.com> Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index 6f1b7cd..d033286 100755 --- a/configure +++ b/configure @@ -5195,6 +5195,13 @@ if test "$gcov" = "yes" ; then elif test "$fortify_source" = "yes" ; then CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" elif test "$debug" = "yes"; then + write_c_skeleton; + if compile_prog "-fsanitize=address" ""; then + CFLAGS="-fsanitize=address $CFLAGS" + fi + if compile_prog "-fsanitize=undefined" ""; then + CFLAGS="-fsanitize=undefined $CFLAGS" + fi if compile_prog "-Og" ""; then CFLAGS="-Og $CFLAGS" elif compile_prog "-O1" ""; then