From patchwork Wed Aug 14 17:11:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 819142 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp802605wrm; Wed, 14 Aug 2024 10:13:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWmuTCBewgfb6dXiOolyAbqa3iW5RBrcy9jFHCYcxVBZJynoX0cD8jlagcxZNBuefsJsIshDebxo4f0OOCd904m X-Google-Smtp-Source: AGHT+IHDlrfYS8kj1TQjYYvzPs5JXq5itIiiV21Da6YnpFSeDigLj0d/zLH+K6MbhGgeX33HHwqE X-Received: by 2002:a05:620a:2990:b0:7a2:2de:efc7 with SMTP id af79cd13be357-7a4ee31aae9mr399081485a.14.1723655588917; Wed, 14 Aug 2024 10:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723655588; cv=none; d=google.com; s=arc-20160816; b=zBvKwQRZ+zz5eiwRusGmJZ9bCjZclFoc7pkE1Fd2giZ/THLC1Iftpj7VDw9hzpSExH X8BjkT/Qb/4wUM01mBAxCx4eHczcTXYYpX6nC6U20yzTdqwQITzi7V02rWcsuVqpkcZu imFo9En6SYMWLdUr47tqbuUW88txwC6kwTMFs495ttP7zt/bMzLvl3VC8yAuclE/TopZ zEV8mvYgq/l2tVEOK4AycUtFWp1NXVFptlYU7EwPLjMGPtEfivdqNMWdwK8KATArCoJ1 ca7EtImUuqA7y72PiuOOT5TY0TpuHaovjKkU8kh4zGGRtg7POH0PDw8Y/cjSsyguGl3Y 9tew== 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=CvLg/jdd02raDyPuokVKWkE8Jw8u8gKV/oNxvgJVSos=; fh=2zasdEIMl2g9By/aYULsdPxvg2j0c442hBqLZY0SAzw=; b=n34yC5pp5XBYOHEC+17haUNcUXxj3BiY0OxSDrxvhBNXQxTyUruWXNhUmgHKl34Loy JfBNNDLUie9XWRMaJAdOYxFFyV+E1WGnvyvL3ouRkrvUxUyNrb6SCgDXijozlKGJ42IQ mvCuHCAXtYiBaSzgSMt5QCY7QtUCDaZOn5DK+A9mhXwb5YhSfW9xX0mg/CKx6OLK3C3a FJsvy9P4lGua9Q5NhCp6leyuhgXlcQD30pZzc2Fz60Odt+xcdGoloEM3KxEZdpNToWOa zT4oyZjVztUsBS1nMn2+u+3+zXQIspueY5Fh2EDjnBGsETWdHZoUaxKuY5z6AdA4Wew1 EGpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uqmmMwyH; 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-7a4c7e22f50si1094730585a.728.2024.08.14.10.13.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Aug 2024 10:13:08 -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=uqmmMwyH; 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 1seHXi-0000BS-GY; Wed, 14 Aug 2024 13:12:14 -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 1seHXe-00008r-4J for qemu-devel@nongnu.org; Wed, 14 Aug 2024 13:12:10 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seHXb-0006Cd-Nq for qemu-devel@nongnu.org; Wed, 14 Aug 2024 13:12:09 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-201cd78c6a3so600825ad.1 for ; Wed, 14 Aug 2024 10:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723655525; x=1724260325; 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=CvLg/jdd02raDyPuokVKWkE8Jw8u8gKV/oNxvgJVSos=; b=uqmmMwyHcNbl6MBKnVHzZQondDQ2RUhp1dWsR1AV4bQyREX5JoyZyKXY75WM9JMBOI SnXsB/d9jpfLvLQrGCt4gfyeLhU7Uy9cekdp3kKSTMH3BqEsliRz1jxlAmlSaOZzcrmA +2o5m4AjqhmZ9iEdy5WF/bIPgVZt3dLvqp4iuXBXu3vSPXCgZNCMdlFqSVhfwZ+fY9uF Bg+Kc30DAy7y8D7qP2KTOpLkct+TuPeeO4qKsqsfeE5g8bgLc89PvETonqOqjlouxwSi oB4DmDyu6qYIshdiYzH5dRAUyjiO6UOA0XqxQC4LqiIMb9Q2xjRj84zLWF5kVPoautM7 Gd3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723655525; x=1724260325; 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=CvLg/jdd02raDyPuokVKWkE8Jw8u8gKV/oNxvgJVSos=; b=BYxP6hOY1frecKmIprnO/jyxRAZ3yFkuiWP7OPMZAKoY7o6TSP5ERYyFND6r1eW7bJ TQCMl1f7smd0NUQ+YM24BhAqBw5o60DKYL36GoUQvq/oZkVQ9foC1Xu9vE6Lrj7N8WYM xsB25hk64xd1gEJhsQzuOdgzEUyrH9Lqn4i0j1KwDL5WkoxZq6+p16AsFhb/CEkesmYN Pzat+/uS1kzhgVPissxZzT414ovDq0040GS8fcmTTD0H5jzffATTs1NcLAdg/N7DpsLQ qy3W/OBLhFRW4Aexf3NQ0M14F5Hr8vzyVY/2C5uw7hLk/AO5pajFFW9pV3eLN//OyJ0I KIkg== X-Gm-Message-State: AOJu0Yyqgf15LoF8ooMaQUF6TEaIAWxe1M6Sqs2h02rTOQV6AoN44s9p tfKSosOdggqGz9upKY4h9U3Gbp7kh8OeKpYy5wrd9hRqQjf411c3CE/CVbp8dyUYx31nwG2ydvP r4aY= X-Received: by 2002:a17:903:2449:b0:1f6:e4ab:a1f4 with SMTP id d9443c01a7336-201d638d83cmr44171455ad.12.1723655525122; Wed, 14 Aug 2024 10:12:05 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::b861]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1c8783sm31813895ad.245.2024.08.14.10.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 10:12:04 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, Wainer dos Santos Moschetta , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Pierrick Bouvier Subject: [PATCH 1/4] meson: hide tsan related warnings Date: Wed, 14 Aug 2024 10:11:49 -0700 Message-Id: <20240814171152.575634-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814171152.575634-1-pierrick.bouvier@linaro.org> References: <20240814171152.575634-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62c.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=unavailable 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); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c2a050b8443..899660ef020 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