From patchwork Fri Mar 4 11:21:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 548108 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp1275imq; Fri, 4 Mar 2022 03:32:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxviHPcFRjA8QDkXs7ycxkf4zenbajZWjNoRMdtvXq8eL6C5aw32uvGIUyu+MafrCtHA1Wm X-Received: by 2002:a25:585:0:b0:628:9860:39da with SMTP id 127-20020a250585000000b00628986039damr13134101ybf.383.1646393531859; Fri, 04 Mar 2022 03:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646393531; cv=none; d=google.com; s=arc-20160816; b=MLwkOF0FurW5dzPD+BaSPZsYYEKIANk9GIA9tapgZfkQLICapudxUgBglZtPTWN2O3 tn+l2waP7Rt0USmlbizmKlrly5jMvjTEsz9QMSY+Y/8gGO3CXTmBjKLRQkatrSs0kGf3 nVXwabHVWDrIamarRX21/wz7dL9m1sWm+Q5vCQ8V4n13TVjpjZM8KrbMe6C0MnUeCP9e U+svLqODpLwYze98fRhwgP+XEtlMQ1jprtLHDTaorkchzSxOFo7xEpMDwAEAKTZBUfV/ IM7M2JeE3ZmY/bDLGCoBb6MSu7AHMjh0OobA3jLavWhHZwhqixfqFFWItMjIzhB5Alvc H9Ow== 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=mcsPtmWVkD2iOC6zuv9lO7mH5DMh4k1zBSF/wMzprBs=; b=0MyNf/Ti5J3KGbQCFC67OT+ORyvIrmckhpuULcnz6j/zLZfwDp1UlBfbVoWP3hLxDw mEMTeVxlEea1u4O0HntXMJWs0G5Y9okEaJpk3blxJm6MM4iGOM8xRhc5iua8ZirnDrfW eJxj9D94ocxhJvVFrlP5KtTbnnia6ktn4ayCOEZTr/QGp+5jRuWnwNmCSANhoiIRK4up 8BRrN63ud6LSLSujrwONXG0LfU2gCcU6s2LBDSQi8HC0EKtsaaDvfWH3O6l9ngBAiCe+ Ppg+2Wja0wl5nkfmE6pzqbDO0n6WOHAFyexw8UotsfQfx3d2FoT/I2pEG/TkchwEhtzV D6rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Sm6UdJ83; 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 135-20020a81038d000000b002dc1590a287si3979194ywd.249.2022.03.04.03.32.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Mar 2022 03:32:11 -0800 (PST) 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=Sm6UdJ83; 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]:41788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ6AN-0005kO-63 for patch@linaro.org; Fri, 04 Mar 2022 06:32:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ609-0002dQ-K0 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 06:21:37 -0500 Received: from [2a00:1450:4864:20::330] (port=39804 helo=mail-wm1-x330.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ607-0004fd-S6 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 06:21:37 -0500 Received: by mail-wm1-x330.google.com with SMTP id o18-20020a05600c4fd200b003826701f847so6417499wmq.4 for ; Fri, 04 Mar 2022 03:21:35 -0800 (PST) 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=mcsPtmWVkD2iOC6zuv9lO7mH5DMh4k1zBSF/wMzprBs=; b=Sm6UdJ83Sqx8eMJ48iUyUo3ay0OTyiZullh8e7t/vxyzPHHbbOx4MCjN3DahoehJNq UxgWyb8ScdT2TokckQz63IU70kJ3jx0PlpcBsl448xET7Q4fJ9LtNYJbHBTolc3cTDy5 BmUYAqL4cqtgZie8scApN879/oH8lgf/Xq37DzCAG7R/YJgkqw1OlKrnhaCo6LsBjuOo zttu1kuaYjvGd/isR2lc2JJqG2xoozQezJsILg2CSmY/zF2DrjILTmqsLL5thL7uEEOi XYzjMKrdKDVu2d3sRb+AsWe52wiZGiq5/eaf8ACRhL2Pd1JUkNeFxpnQ+VSX4LJxNjrv Enyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mcsPtmWVkD2iOC6zuv9lO7mH5DMh4k1zBSF/wMzprBs=; b=RJDOmhUSvktt3ygcCYwfLlR8ms2ol1O5oQOVBo6J5/YrLpvfMkJdwOBLv/N4HnQ6IK sauEBkGED5yVI/i8WC875xulLYZA/CU1ebwcop0qKmK2RYi/6fS7yZlZJDYI8IFshyTQ 7AaftOEPAXt+mcQqAwJuvYHVhmxtNvHk+8NHPKBuja9JiJxsPrpAZCvu9V1/hNilcQHV VwT/SrWS0bOhzosgCckoNET3Rr/fAzF7vJ9SENrxemkEJTBucA+Cq5qS8DbH/wIi2VqO AjufrLGJeKgYCXa4up2MOmN5yr1KzQoFube/aIS+284HRvxvoxImpH1raHY1aMipgk9N rwPg== X-Gm-Message-State: AOAM532aXyADBIz1q/RldOwHMPmxwwPOehh+YKxtefAE8aBcrRUFmr9d bzV2BKc037MTepT69Z31NIMtE+xDgchChg== X-Received: by 2002:a05:600c:264e:b0:389:802e:c7fa with SMTP id 14-20020a05600c264e00b00389802ec7famr1813725wmy.93.1646392894532; Fri, 04 Mar 2022 03:21:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id u14-20020adfed4e000000b001e3323611e5sm4148651wro.26.2022.03.04.03.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 03:21:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v2 5/9] meson.build: Don't misdetect posix_memalign() on Windows Date: Fri, 4 Mar 2022 11:21:22 +0000 Message-Id: <20220304112126.2261039-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304112126.2261039-1-peter.maydell@linaro.org> References: <20220304112126.2261039-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::330 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Paolo Bonzini , Richard Henderson , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently we incorrectly think that posix_memalign() exists on Windows. This is because of a combination of: * the msys2/mingw toolchain/libc claim to have a __builtin_posix_memalign when there isn't a builtin of that name * meson will assume that if you have a __builtin_foo that counts for has_function('foo') Specifying a specific include file via prefix: causes meson to not treat builtins as sufficient and actually look for the function itself; see this meson pull request which added that as the official way to get the right answer: https://github.com/mesonbuild/meson/pull/1150 Currently this misdectection doesn't cause problems because we only use CONFIG_POSIX_MEMALIGN in oslib-posix.c; however that will change in a following commit. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220226180723.1706285-6-peter.maydell@linaro.org Reviewed-by: Philippe Mathieu-Daudé --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a5b63e62cdc..73fd17a0523 100644 --- a/meson.build +++ b/meson.build @@ -1619,7 +1619,9 @@ config_host_data.set('CONFIG_CLOCK_ADJTIME', cc.has_function('clock_adjtime')) config_host_data.set('CONFIG_DUP3', cc.has_function('dup3')) config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate')) config_host_data.set('CONFIG_POSIX_FALLOCATE', cc.has_function('posix_fallocate')) -config_host_data.set('CONFIG_POSIX_MEMALIGN', cc.has_function('posix_memalign')) +# Note that we need to specify prefix: here to avoid incorrectly +# thinking that Windows has posix_memalign() +config_host_data.set('CONFIG_POSIX_MEMALIGN', cc.has_function('posix_memalign', prefix: '#include ')) config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll')) config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwait', dependencies: threads))