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: 830482 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1374:b0:367:895a:4699 with SMTP id q20csp856955wrz; Wed, 25 Sep 2024 10:14:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWvq41gKzKWZZm/dhpERQpYvTh2bcbAg2AEedaq/dt1PQkqnhTyFbDLk3EesQPlxpW6cdZ+iw==@linaro.org X-Google-Smtp-Source: AGHT+IGOZkKpZmgJFcEn4TSO6xnI2hQ7w3sWgzq7nVMTsYAzOuyKtjdlJmls44ilt/ubby4sYLlY X-Received: by 2002:a05:620a:1707:b0:7ac:c348:6a55 with SMTP id af79cd13be357-7ace7413518mr569090785a.38.1727284452236; Wed, 25 Sep 2024 10:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727284452; cv=none; d=google.com; s=arc-20240605; b=QU5KtFIKmEQK9K6byXHPLCXUz6H71f7TORhwZrEb3a0D8sruh/qTlzKI4/we3Ee1+F md+dTOx8/a0540szk4ZddlDmOaFhQdJVlxbm9b94DsVGwpyEgaR0/Uq3QayptacffKxh NfTbgAlON8lKD+xoslwzP6wGahjOFjktnkn1IXmS1AhTUYzBhjJ3n9NEdkiAFNR84ocF uVi8gVpZyuKhnAXTDZNyN2pFOh29VCuqonneSSu4qgm13AIBg15Kk9lN6LVxWnnXats7 q2oZfAPAZHyiWe2NW/LtcOr6F87T9Wc0g7z9DGQgkI17MrSxc7pu/TCJkRirLihhgSz1 Y61Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ycFC3pmsoWssj1+GB+z++1OZtt6It3e2DUWkH7pV350=; fh=jOpm9kmPAspKh5iBNE/fo3cA2AnxrIpta9f9jvC2IBE=; b=kG1ByJFoQqJ4QhMsFhyaboqo3dSIq/WTTFFLsGVJqbiAMLsM85ZPUKo7L/IRwOK8mk n9mMA7e4CI3OOkiKBVOv9DGGLgyHee2/1Ibxwxc9Z2GbR+b9DIZsDjD+Ns77PGZeY49J f8PCNTHyMTZTqAKgJ03rJtBxzeSnbVtyW0Nr/U7bMkdjiwgQFLhruWpb74jeaLbVgIkR GQMbLHv7i9ptZXb97ofR/ORhLTLNTh3yudnwKG0y4ZM5p9AApj657bXICP6WuX0OXSdq MKoEixs/tkBnqTCVHSV07Ph8AhUrxDHOymXkWczFPjlFojON38czMxN1+Ml5QBBMmouL bq+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKWRlWdy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7acde5cd898si490799985a.254.2024.09.25.10.14.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Sep 2024 10:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKWRlWdy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stVYq-0001rC-Ao; Wed, 25 Sep 2024 13:12:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stVYR-0000Kw-HG for qemu-devel@nongnu.org; Wed, 25 Sep 2024 13:11:55 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stVYN-0000cz-2x for qemu-devel@nongnu.org; Wed, 25 Sep 2024 13:11:54 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cb1758e41so213495e9.1 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=nongnu.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=DKWRlWdyfZAGyamN+6xxwTv4k99DBGWkdCA6jof+LeDkD0M4KtzF1WRL0rcf9ny6dJ vbaRqz6rZgFxJ2TcnQwTUq3XqfFhghvFo59NCfzzD6/OYzlKA8ADzcu6Zsep507VQAaT AIbT1qqF9iJNQ3dOhEuGzMRGatamjWL9rXiGULKUcd4N6LzUq8fe3c5bSruwsC5di42O QvlFEN3zrH2xU/hl51QSpSnwtpUgB3S7m5SdpfNYC62av/o6kf1VHGxwfymCXu0ZksRr 8xSD8eKk4JhVeWb0ujohKpsNjBCPBBgknEkd0D9FTdUqqboxNFabPkLc6Lo3+l+yN37O UggA== 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=vUYL9QMSAW8yFQQ9y5Lfjta0ctrcz2dw/Jd94bU04untW5U9wi258vY8vo8EXEk2sX HKHQp8fTCN63JbBUblsEg0bYcBVZmB3VbLtplH7E1JoHr3UdoGHqAkiqORWZjyxQlm3Z iR32HmvHiQ65PbcPUW3RfEx3BNND1ZLouoE5Pk0LKC+iZPhxyfzTz4vpHRZF9hfzytBe itNxkVE2zyHA2RmsWnBtm2FP+AoAt42LQr7ejvGwuB6ZdhltgyafYlWxQijpfYFbbnse nsLwdynBf02A9Us5Ky/XIvXhT+Kcyx/SslZfIie7p5QTn5yApsE/8iqW5XDiA6HndNDq useA== X-Gm-Message-State: AOJu0YypqRCLiZXB/wZrI/TfKH6+2+HRjRbUuu1TvaQXf++7W7+sqPUn aVCGNLKpkyeW+cdPkvwCwl7xZKUIPi3Xj8qxtOwdV34SAtojb7SgtH8EhKKhiHc= 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> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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