From patchwork Mon Mar 7 16:46:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 548872 Delivered-To: patch@linaro.org Received: by 2002:adf:80eb:0:0:0:0:0 with SMTP id 98csp1092316wrl; Mon, 7 Mar 2022 08:50:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVPqz6Ipm8yOL9t9iiY1W2vwsvsbPrREHgx+D58nzNhw3LPm76+xw7FZV2tccIyhEDLNkM X-Received: by 2002:a25:4dd7:0:b0:621:a740:3988 with SMTP id a206-20020a254dd7000000b00621a7403988mr8933529ybb.58.1646671797089; Mon, 07 Mar 2022 08:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646671797; cv=none; d=google.com; s=arc-20160816; b=nk2H+gtMRNk8CIu9KkbI0ziYDtkOI1rkUaK3g0ibvl+HwOzU5l0/f6xN7tX/ENPAQ9 YdYEM9Z0tuVMn7dNYsCJuu7L5aot5j/soY5Ndn0GGSDIbkefa1mj4tALRtKo9V00t1cY kqeNJqS67IVxlO/E8sGp9D8WXKF4jIMHB5LeyIcObgleQVdouKvUTmrClfdfAO2ikWIV Tb9gKHSydyOVZ8hsRRrvXNSfIm75c47ML8aAJx/kTXZOywf1RJzyaHErVKFY6vnwESBX qp7HMjvxCD2GQnTYy2Dw7tDOdp69ciropwX7VjLfYq7xVIT7rnf8XBvP5+vDQze1CaQF uadw== 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:to:from :dkim-signature; bh=xpC06DHhxVDLscz6Xo2CkegCEhzKYUxBYFFVOWGgdvk=; b=nK1iXeLq+gzz7fhmGYhH4H1rfhJTKYzssRrxEsJ/U8HPI9ywh8yDMEKmljOF7W+pEs gaxu53AuUyg66Pta7vKJdZGcf6Ug2diea36hIt3B+OJjFY5y9euH+JxBA4vgNy8ebl/j hfq7jcGtzLR4Xcn4CH1oME6ePFOpk9Eij/6IwNhyTIcu8ZlJvzzDNxqiwNVRWCsNuzG8 fFsg3ARtkBkpLaJ89PZee6/kKgRzPJt6LypcNLExLplg/p87D0E9eKUiwhRQcB5PWdg9 Ww0nt02JGrQr5y7HvpoIGKL0o1+BTo6KMwePtZin7GaQK2RtKY5rdp5TeBd0QA4udnpc 4oCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIqeN4At; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z14-20020a5b0e8e000000b0062894ce39a9si7991282ybr.195.2022.03.07.08.49.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 08:49:57 -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=pass header.i=@linaro.org header.s=google header.b=SIqeN4At; 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 Received: from localhost ([::1]:40520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRGYV-0006lf-Ly for patch@linaro.org; Mon, 07 Mar 2022 11:49:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRGVy-0001QQ-Db for qemu-devel@nongnu.org; Mon, 07 Mar 2022 11:47:18 -0500 Received: from [2a00:1450:4864:20::431] (port=33631 helo=mail-wr1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRGVw-0007jF-Ks for qemu-devel@nongnu.org; Mon, 07 Mar 2022 11:47:18 -0500 Received: by mail-wr1-x431.google.com with SMTP id j17so24366977wrc.0 for ; Mon, 07 Mar 2022 08:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=xpC06DHhxVDLscz6Xo2CkegCEhzKYUxBYFFVOWGgdvk=; b=SIqeN4AtLpG9QCpuK4KlXzRTsmeuUtwHAJ6m5pZMNg/XPLrpK6p7G2BkS6MsYsIHso S+/2NuSTbjQ2PPEg3Bv1JxgpR+G36OReOaV/fN6GLwR3LGcSWoeuMUlSGO8WeXky1QNG f9OojReDk8Z5KMd+0ZcuwBtPD0yR8VXexKXLCYvYvOB4g8vMCl6iEB5Hh2XDPuftoWk4 TN4IKmh3BRHulQ+uIRiTv+YgA+/h1dLJojTAyGHCbkXA8W02/fW4MDwmBxJN8bJ98Kuy A8g3v+jQvLhIFCJ4nRGKwWSdH2DbYqHjM4362bmLzASgDhh4CtYv4Lg1/hgI1P34hDqj +upw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xpC06DHhxVDLscz6Xo2CkegCEhzKYUxBYFFVOWGgdvk=; b=CboB/6hH3jH0eK6wygrIGkiRsnyHCB8ChNYDdPrzZ6rKlIEjDw61A52uJWY19cE7rP l1iHOm6LaeUQlNQaBZudL9O4L6/q0aN2wVW7o6yi+CsSgWjkE2lCoAfcUUYpZhjv0SIf yhLG56oJ4t1uwGCJlpGydO8TAXFai86ZN32Clam/pu+GzgHshhch1xCkj9D3Sgi9rftw r7b7AFiBeLjA7U/MfIcfRVXIaroJ56iWCcUxyWlLH5u9ncLVjl6HrWy156QMVZSIgNEY zZOlA+UX0iRIDfDCk0fpS9+zamW4cLlVD0ABgoFF5et56CGY88xubl0Ng2lH/PUu8x0i mtSQ== X-Gm-Message-State: AOAM533TpExL7ayCcS3t3tqhp2CxBmlF5EdtcfXrt89DgegwrBD90sXL GnGdvoj0ztDQiLMdj1m/I0fW1RQvP/Fj5A== X-Received: by 2002:adf:f1c1:0:b0:1e3:1381:7bd5 with SMTP id z1-20020adff1c1000000b001e313817bd5mr9076519wro.450.1646671635234; Mon, 07 Mar 2022 08:47:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v188-20020a1cacc5000000b00384b71a50d5sm13806652wme.24.2022.03.07.08.47.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 08:47:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/18] meson.build: Don't misdetect posix_memalign() on Windows Date: Mon, 7 Mar 2022 16:46:55 +0000 Message-Id: <20220307164709.2503250-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220307164709.2503250-1-peter.maydell@linaro.org> References: <20220307164709.2503250-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::431 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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: , 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 038502714ab..b541506c1c5 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))