From nobody Sat Oct 25 09:07:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152034332575213.322211400017636; Tue, 6 Mar 2018 05:35:25 -0800 (PST) Received: from localhost ([::1]:55780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCkV-00039B-Um for importer@patchew.org; Tue, 06 Mar 2018 08:35:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVR-0004qF-Cf for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVO-0006Gp-WB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:40136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVO-0006GG-Pp for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:46 -0500 Received: by mail-wm0-x241.google.com with SMTP id t6so22233856wmt.5 for ; Tue, 06 Mar 2018 05:19:46 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:44 -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=ExnxpKndTsPSZ9cB3srpn658cSG5Kyd5DBF0UQm4lKI=; b=aEBpJFG9pi7ntb97OiNAnCI1MfOPj+lEEG7g2P1Q4ncJQzEMzEcQV4TZn4mG9rt4eb v4T/Hr4BjtRKW4qdCej6PTmUZuwSpPyAssfV6Ym6KVKXG5L2qIIeZL60XlIuciCYYf2D rk7ize47z9GEuhdeLm6VLBts6Kp2CugeTtQxcs9etrZLDr50/009Tw9jpxb7r91zTDYu S9ZWMKWQz7ixwpNbmpwrJUSvGfaxw9yodFf+cozX6VSlwxUT2gYjfunt7GFhjaeMZHvh ghxxhJzxQM8IRpBQzK4AX1+ZpZY89gIupG5qOk7yp3dGKfC21BvVJVoPyRvaAH2XpJ6P fxIw== 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=ExnxpKndTsPSZ9cB3srpn658cSG5Kyd5DBF0UQm4lKI=; b=kOj17BsolJxL5TGhcS8f6s1JOi0eRWB+Pft+hIOJ+YGINyZzg4Q1BMhcT94lvLluWj /eBstL3J4Nu5l3WXkkBYlLapzVHxwevqYYU0qyGV3JKHuEOPlWKOpVK0pPWMAqeGezgD 9kx+NDmgXKhOPu1vAZNVfV6sMXWt98F25ErF/zDJYBIHXDYCvr8Yq3ALDMxfS4xvdcPt zMMBjGwZ6TztYopwmZE1uhFncDNfE0BRpSDySszgjRlilJL6nIGZg4q+s2KJ/hA79p0w oX/aWIIw1Y4i2REacBXRfG2A5Q/gJOrnnjkmLmDYZcN+wkTDFpdIBhqE4FH1gra0yEPw blxA== X-Gm-Message-State: AElRT7HyQqg2qP9xms6Nb8FEOQI5GFhQRDeB+aI3dcuJNlflIvBI9UuL Lji0Hlh+5hqX6OXYuFY1m76erPHP X-Google-Smtp-Source: AG47ELtCNS++ACNJakgsy12azSJQKqXokVy4SUy50wrZkog0/2FUP0pMfARiqHAfSlx0KqUK1t+UmQ== X-Received: by 10.28.34.3 with SMTP id i3mr10540035wmi.121.1520342385436; Tue, 06 Mar 2018 05:19:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:06 +0100 Message-Id: <1520342370-123606-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 10/34] build-sys: fix -fsanitize=address check 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=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Since 218bb57dd79d6843e0592c30a82ea8c1fddc74a5, the -fsanitize=3Daddress check fails with: config-temp/qemu-conf.c:3:20: error: integer overflow in expression [-Werro= r=3Doverflow] return INT32_MIN / -1; Interestingly, UBSAN check doesn't produce a compile time warning. Use a test that doesn't have compile time warnings, and make it specific to UBSAN check. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180215212552.26997-2-marcandre.lureau@redhat.com> Reviewed-by: Emilio G. Cota Signed-off-by: Paolo Bonzini --- configure | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 27d3f66..7ff00f8 100755 --- a/configure +++ b/configure @@ -5316,25 +5316,27 @@ fi ########################################## # checks for sanitizers =20 -# we could use a simple skeleton for flags checks, but this also -# detect the static linking issue of ubsan, see also: -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84285 -cat > $TMPC << EOF -#include -int main(void) { - return INT32_MIN / -1; -} -EOF - have_asan=3Dno have_ubsan=3Dno have_asan_iface_h=3Dno have_asan_iface_fiber=3Dno =20 if test "$sanitizers" =3D "yes" ; then + write_c_skeleton if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Daddress" ""; then have_asan=3Dyes fi + + # we could use a simple skeleton for flags checks, but this also + # detect the static linking issue of ubsan, see also: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84285 + cat > $TMPC << EOF +#include +int main(void) { + void *tmp =3D malloc(10); + return *(int *)(tmp + 2); +} +EOF if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Dundefined" ""; then have_ubsan=3Dyes fi --=20 1.8.3.1