From patchwork Wed Aug 14 22:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 819149 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp906287wrm; Wed, 14 Aug 2024 15:42:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWePi9EgBl64LT+Zp2lwkcL7djJN6ZgIWaloC+gNQ2KmeCFsxOtbp+QvENdJJMyr1El9YioG2vDL3VrF/J8OYVZ X-Google-Smtp-Source: AGHT+IFjmUwxgTZlCyXxNOU+QtE9Pu5TaK/BDOTFamq6QwcCeUYDiDJL2kzjUYUf0hIlESVZccNz X-Received: by 2002:a05:620a:2981:b0:7a2:e2e:31c6 with SMTP id af79cd13be357-7a4fd1927a3mr189631985a.21.1723675359174; Wed, 14 Aug 2024 15:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723675359; cv=none; d=google.com; s=arc-20160816; b=zOowyy0QItEFfEtoJZK1CC9qSRh7uQe3EW/KNT4FY1GN/m6jQtfAgKjIIFNBVyotXM gp/YrSBetvFEa7sraEgIKys+zYvbhGZCoex153I47H8wByN7hMoe9FX0pjz+qVVRE2Yi oKLa1MuEAN7IDZhz7+f0ce1rCcijiTmeuHL9djB+5hXtwMp1uLM0OlAXrV+AWusxgmH3 gKWOgvbDXICxT6OYz46fmOAcxj9r4hsxWSdq8AgjoMPoDnoKOzRrRwr42VN9h0OtMyJd e8cs31UoFXIfzriOJHEsUh96ijE24KCo1lnExb9IRcU/whHIfyByZ9S3W7eE4bxbugUK umuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=BA0vIbfMo/Ez2DzL8kYXbRUniB5/Y+edtyx+BnopKwA=; fh=VjGIVy33gfqRtM9nOjXsRmpOiUp81jdvfncfpJZdwe8=; b=GHV2mLK1vhZWletERnI6wA+Q1wl2MDG7Q5CPy3x6UXgcnQQp7px6lCfzeegMRm3w8O Ov3EynLdZ+UOmFAgI7amyX3MPB+ZKhc1JGHmaKBwIwZMQJ1ylELx+HCZ/dwoJ7M6rKp6 SyggRHzGEin7Nd5M4qLgVs9p+OGRhiIYDGGpLAEyb/LtoDhOA03q56ppzqjeTJqpyRD8 PsJYfsFX30lq4EwcF8uhp8/T0B1HPuemgDRwza060CitoMtd4oAcAhHBI7hOLFiV+B3K M5jjagOllTTZuoZQB4bcxDUXatbv/1yRg3DnFIo1PVYQJka1Busus9/DLQF3900H9I11 LmJg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fd74EX9L; 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-7a4ff10cd81si36154485a.546.2024.08.14.15.42.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Aug 2024 15:42:39 -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=Fd74EX9L; 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 1seMgZ-00022F-Ch; Wed, 14 Aug 2024 18:41:43 -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 1seMgX-0001xi-VR for qemu-devel@nongnu.org; Wed, 14 Aug 2024 18:41:41 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seMgU-0007La-FG for qemu-devel@nongnu.org; Wed, 14 Aug 2024 18:41:41 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1fc56fd4de1so2702395ad.0 for ; Wed, 14 Aug 2024 15:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723675297; x=1724280097; 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=BA0vIbfMo/Ez2DzL8kYXbRUniB5/Y+edtyx+BnopKwA=; b=Fd74EX9L6YEtAnGPwwpxA1UGpXv65qOAejrKcULnerI2e8zP2JG0KGor+OlPP3MEZM oZsE0bD4ONYFNdPXC2GSHaZZ266X70Jf195VXOzTio6NkzSxKiCLZFKJlwMKK/oMt5F1 zinQHgGmgJRyHrlx9QK9lOpkQM/n19WAc75LVAEOzLqkyFKnCeDiS/vtlUrixmLId4XK TQZ31oGRL+v4hry0BBLo42dJ48uL+1hs7lIAVU6UnD+kRZW4DSS/IwbzsTAs+iz0X4Qo o5HAcqK+OTg+wDeCFJYNSDqtm5v2lfph4HM1TjiUaF6da23xJsEsOYvJbPwv+b/EXegB exFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723675297; x=1724280097; 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=BA0vIbfMo/Ez2DzL8kYXbRUniB5/Y+edtyx+BnopKwA=; b=sJq65+QM6FMGVKfj8tiD9VMyePcuLoVrvuFkY1dFgHorczSClrpa1xo8PXYmP/GfXD 253n8oPr7VmEFY20kjhJybia46FhX2mkt/0LUPIPrnmh0tPPSp5XdR4ZsKfJKHA7xDWn 7JZJKglDbOsZ4bAkK0tg1OeCq4pG2cUGTYS0452R5oSxiKQuBShFkcOSDlVFVlRISws9 6uoPD4ZuIiAvF1EN6cDmvhy7fRHZGNUYTl9mLolxS2SG1o2eLDD9esVqysj7tFognifX rW8q0DZy+0YzHikm1yzpgo+HNnMPVyyju/864hetWRpW0Cfml1Z2r56djV0UB+EpWv1R lEQQ== X-Gm-Message-State: AOJu0Yw0EEwQqy+tJxdQMwld/LUSrxgZYCSJpxMn3BDsYwg76Owq3PD5 L0Ag9AhJ2x1mIkpV29GUgaLXL92J4Cnce9QiehFdXwe51rS2+HaAdrs6Zm2Dh39qKUGo8i++FVE lpzE= X-Received: by 2002:a17:902:e807:b0:1f9:e2c0:d962 with SMTP id d9443c01a7336-201ee519f73mr13281165ad.31.1723675297099; Wed, 14 Aug 2024 15:41:37 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00:5b09:8db7:b002:cf61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03b2874sm1225595ad.308.2024.08.14.15.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 15:41:36 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Beraldo Leal , David Hildenbrand , Thomas Huth , Marcelo Tosatti , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , kvm@vger.kernel.org, Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Ilya Leoshkevich , Pierrick Bouvier Subject: [PATCH v2 1/4] meson: hide tsan related warnings Date: Wed, 14 Aug 2024 15:41:29 -0700 Message-Id: <20240814224132.897098-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814224132.897098-1-pierrick.bouvier@linaro.org> References: <20240814224132.897098-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62a.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 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 --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 81ecd4bae7c..52e5aa95cc0 100644 --- a/meson.build +++ b/meson.build @@ -499,7 +499,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