From patchwork Wed Sep 25 17:11:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13812363 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 044884AEF2 for ; Wed, 25 Sep 2024 17:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727284312; cv=none; b=V7n/XShk5pPWx0ReEzKMLrXJOMVsJo/DMgr1KlOInXyrObag2E4J7ygzRJ20dNt9mD65ZeI43utB24xcy8ESWemFIT491WvGoF2tsow0uvU3ZJMg3wZmAUENZYaiLve36ztQq9++Z+mBHsbl7GHJo/8BTygxignH/1el6gxAcmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727284312; c=relaxed/simple; bh=28vXbYY3NnUgjx+dHCeL74DCpQMF3AD60aLX+nWUK6M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=K25rDWhH7u12tvkx8C4hneoI/Vvgcpqax3t1at4yON+gIbo65UOb53VhvcSyepAY3cytQofhtyc7YYTsPu9NAQtNAyTegRgU8H/NF7Fhr6QcU3q6FjqJfW5kVPnSFlyQbRFZlJu2/4o8J/JD0T9Wczxue5QBvfgAu1Xi3TX2wtY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mYTSXDzt; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mYTSXDzt" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42cc43454d5so132285e9.3 for ; Wed, 25 Sep 2024 10:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727284309; x=1727889109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ycFC3pmsoWssj1+GB+z++1OZtt6It3e2DUWkH7pV350=; b=mYTSXDztzTdHz94iYoZLa19eBc/VXpRnIZqWNK3p44rjh8sPU7ohtg3SBIxwu72V+Z yD4LvqiWg7+vchk03luH8kfrjhBWAIElqGHRzm8cudAx2/tM6mSTz0QjyqBkvdRcxKPZ sLfzRZc1TKQ1M3hCPHQ3XcqQk/HqJKFb5nKs0Pl3Oi8Sn8ZOEs0x1MoaRcc0+cpOjmHM m1PnRzLWriBEQsvCn1Dqh1u7tI76oeHUar9moRI8H112LeJl+LAW7+X6h1xnff6N3Esr iXKIEc5HW2c0RnROiMNflRkRQWcser36Nnk2z2jSUVUwkVsofna87gISFFXN9aRZaUeT QqPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727284309; x=1727889109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ycFC3pmsoWssj1+GB+z++1OZtt6It3e2DUWkH7pV350=; b=o+YPMKFyhBGtu8Ql6TXYmE1LcOo5WTMGEBSDMaS301ERfiYgsjKk9m6WXdqr+1bRUS 6/VsTORsRh1xYTc7nCdaYCo70T5AuMwtP5GwzEG8u5Qn3yT1VT6sfnE8uNk7/XoOBOgK czNluepsV2z6B5VD5UtG/Y98PHoI9Dfu1tRi08jHJhVY/+eLd92LEwIKpXZM3m4afn7q 06SE8VR6GC33w99TD4OqJjre+dJdahe7Vbhwqz9Cn9oe0PU44CuEX2BKocj7lh/I14RO +MkHoAdw94ut0/tQrcnNdG7QIp662IhkY8QlXinYCv3VpBezUkBg7waWnpSJikAmkdp7 4/vg== X-Forwarded-Encrypted: i=1; AJvYcCVQJp3tWV5nwNca8Kcjscam2ZfAQ+MP4PLpkljypMOkAMRA9KHhUUQ+cTNzSqccblwKCqY=@vger.kernel.org X-Gm-Message-State: AOJu0YwpM0cydtoFmb06/5vE75Z83B7TI0zWSejonClCDmfkQfK4k36k xlFwD3mll3Sd64G9oACq7fF8bZs71NeM8twygEG083jjzlCsd++1OZ3b6LQZifA= X-Google-Smtp-Source: AGHT+IFRxeZoSgBmmopQctlKDB9ApqhA+1oJ+LWS6CG6+0s5NaCxN5dtRqAGt/nMi5ztrLWq2e6P4w== X-Received: by 2002:a05:600c:1c05:b0:426:6158:962d with SMTP id 5b1f17b1804b1-42e961445d3mr23154945e9.23.1727284309232; Wed, 25 Sep 2024 10:11:49 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e902560cfsm56646345e9.0.2024.09.25.10.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 10:11:45 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CA71C5FA36; Wed, 25 Sep 2024 18:11:40 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Zhao Liu , "Edgar E. Iglesias" , Marcel Apfelbaum , Alexandre Iooss , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Mahmoud Mandour , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Pierrick Bouvier , Wainer dos Santos Moschetta , kvm@vger.kernel.org, Jiaxun Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , qemu-arm@nongnu.org, Peter Maydell , devel@lists.libvirt.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Marcelo Tosatti , Laurent Vivier , Yanan Wang , Thomas Huth , Beraldo Leal Subject: [PATCH 05/10] meson: hide tsan related warnings Date: Wed, 25 Sep 2024 18:11:35 +0100 Message-Id: <20240925171140.1307033-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240925171140.1307033-1-alex.bennee@linaro.org> References: <20240925171140.1307033-1-alex.bennee@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pierrick Bouvier When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/include/qemu/atomic.h:36:52: error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’ [-Werror=tsan] 36 | #define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Pierrick Bouvier Reviewed-by: Thomas Huth Message-Id: <20240910174013.1433331-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 10464466ff..ceee6b22c8 100644 --- a/meson.build +++ b/meson.build @@ -518,7 +518,15 @@ if get_option('tsan') prefix: '#include ') error('Cannot enable TSAN due to missing fiber annotation interface') endif - qemu_cflags = ['-fsanitize=thread'] + qemu_cflags + tsan_warn_suppress = [] + # gcc (>=11) will report constructions not supported by tsan: + # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’" + # https://gcc.gnu.org/gcc-11/changes.html + # However, clang does not support this warning and this triggers an error. + if cc.has_argument('-Wno-tsan') + tsan_warn_suppress = ['-Wno-tsan'] + endif + qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags endif