From patchwork Mon Jul 12 15:59:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 473136 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3074140jao; Mon, 12 Jul 2021 09:02:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFdiMJZrwPWiM4biNb89ieF1joG4XIcFwjyXqiBOack3xND0UTcmxfPRKUKQiTy/AooSZi X-Received: by 2002:a7b:c316:: with SMTP id k22mr15083899wmj.56.1626105737430; Mon, 12 Jul 2021 09:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626105737; cv=none; d=google.com; s=arc-20160816; b=UGRYVIEUtvl0+pD6q40Uveg22nGvpOtlFXnfFUM4M7Y7iD167QE1NQrInu4Bw7uOTm AcsHyBOJippcE5yU4Fs9s4sAuc+lEAQTlLa87Ke3Vst1JyUC4kXDQOfJbOuHEpg+9Ood a4GPZ4oGINRgL1g0EWceLh7hTQPGPB8bd0uUr+m396y1cHVEF/va4uhEwSjkSnvS5r0S /p8FoqsIkkhxaeAG3/3K8+EFvfnTg67KsoQoZUll3//7kmeZ0x8I6WsWASKUTbHKS0Xw 61klyEmaLSvvADa9YOS5AO6Y0+LM/q3jvFAPaAhN1nD0KhKclMaR5Zr6ZrAbI9MKxMRx vlGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=T+H4xJOdclX41RzHCXkYk0QTpQSN2UXGitrvAjova9Y=; b=W2Nsyvd2pA3YV7SQXyFzPoI81R8bTWOXCcfrH2tUBcLBUloqdBXUMuZgxXfW49vgDy U4SBtjsAtMtGFUBKV2V3mLZmFCUZE7JyLPdMuNirVd7YZACOIx2UX1i82qSDsvWQPwl0 Xq5BBhnkD3QBAT5UzhGZ1bY2uS04Xt4aZYYwwiQA02AfRyLVBvIX41hjulLXk329Rl8t U3/c+P12HOcggFXgLZ3M+9v7hUAeJzD0nc5ysqfw0mjSEK8npFgWINTb+NExME8Evhq4 gMB+ftcLHCCSbW9ISdg8PzC3DNue6So2s3c1VXXQw5XKftlneWT8tHJ9d07fWM8+eZyH gO7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hv/W9EfL"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m17si24768663wmg.88.2021.07.12.09.02.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jul 2021 09:02:17 -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=fail header.i=@linaro.org header.s=google header.b="hv/W9EfL"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2yNs-0000UI-9x for patch@linaro.org; Mon, 12 Jul 2021 12:02:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2yL9-0000Nm-Cv for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:59:27 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:35340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2yL4-000759-DD for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:59:27 -0400 Received: by mail-pg1-x52a.google.com with SMTP id v7so18725339pgl.2 for ; Mon, 12 Jul 2021 08:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T+H4xJOdclX41RzHCXkYk0QTpQSN2UXGitrvAjova9Y=; b=hv/W9EfLFSGRnP0eeXoPohDuSVF+lu4KQfqa26tKk3D++6X/Agq0XYWZpOQR9z8K2h 7MNuwGmSg+j32u9twFPUx9Gef3NWq7xcTghvqdi+8M6S2OlB32Z7Jhc9DbOwzFc5EJfg oZ9fJJr+wObRQbA38iUqjxvflb63dMzklJZU4ISNdnDyqqw2Lt6h9APux8+Y1VUBKtZ6 fnC1O2ciMMu+PClEz4DQiLmewDgfbSnhWf4gcTwNMzUaDxsFaGvDC65/NaPt6ANIjIkK xoYpHZiKtDIL3BJPqBBYDnhnK72N8iLv0GziUGaY9jC151zKZgaLudEcIe6xHQ6FKQ7O exbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+H4xJOdclX41RzHCXkYk0QTpQSN2UXGitrvAjova9Y=; b=taIVtmMathcFfJWQ7zkownBK0ztKq2IdvqD/xOp3PluusxB9Dky2kkeKkbayhv3iko GXwpnuNG7VKoCkrcXdWeahkcibXxceTOZK7xKzWWD7Fv5lKVJa0SqFm6xoC9OtRPxucT 4lYXZFCvqrToiD2vYCElbjXPecB1r9FnYgLbd0KfXtc3AEWwFv9OnQ9s7UpLXYz1HPRi DcqBfDCoDmX/V7MwjOvWxztokcJRgw+6oheeBSHlN+Dap/zmw1uwAODPhdehdIZjFmiK pqVajkdRi3UhtKDdNTkPOpWBHX/B/aXjRsxC/Rbujd3R0S2rh29URp0lnoM/wYcb+sg4 92UA== X-Gm-Message-State: AOAM532piTX9l509FL0ZQwVUDFyPMdajBj5zn2/ITHDcRiMbsDHoKNxK KqV9K/5p6QXFU8BDXEoYWVlMpWswTZGfxg== X-Received: by 2002:a62:c501:0:b029:32a:dfe9:8648 with SMTP id j1-20020a62c5010000b029032adfe98648mr10123860pfg.28.1626105561184; Mon, 12 Jul 2021 08:59:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j16sm16745021pfi.165.2021.07.12.08.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 08:59:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/3] configure: Conditionally disable clang-12 -Watomic-alignment Date: Mon, 12 Jul 2021 08:59:18 -0700 Message-Id: <20210712155918.1422519-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712155918.1422519-1-richard.henderson@linaro.org> References: <20210712155918.1422519-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, pbonzini@redhat.com, crobinso@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The i386 abi does not align uint64_t (or double) in structures to 8 bytes, only to 4 bytes. Furthermore, the hardware does not require 8 byte alignent for cmpxchg8b, so the warning is confusing and useless. Retain the warning for hosts (notably x86_64) where the ABI is sane, and one has to do something extraordinary to remove alignment. Signed-off-by: Richard Henderson --- configure | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.25.1 diff --git a/configure b/configure index 95e0a08938..163b4edee2 100755 --- a/configure +++ b/configure @@ -3927,6 +3927,22 @@ if compile_prog "" "" ; then atomic64=yes fi +# Test for clang atomic misalignment warning vs ABI structure misalignment. +# E.g. i386 only aligns structures to 4 bytes by default. +if test "$atomic64" = "yes" ; then +cat > $TMPC << EOF +#include +struct X { uint64_t x; }; +uint64_t foo(struct X *p) { return __atomic_exchange_n(&p->x, 0, 0); } +EOF + if ! compile_prog "-Werror" "" ; then + if cc_has_warning_flag "-Wno-atomic-alignment" ; then + glib_cflags="-Wno-atomic-alignment $glib_cflags" + CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Wno-atomic-alignment" + fi + fi +fi + ######################################### # See if --dynamic-list is supported by the linker ld_dynamic_list="no"