From patchwork Fri Jan 29 10:59:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 373292 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp2091499jam; Fri, 29 Jan 2021 03:05:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNjFN/WOlZNMAbV+FS/RAGQiEtKU0Qqw3vjz/pbbTiL2i3boLKrGPdvc8xv6BcJ42jY5Yw X-Received: by 2002:a25:2186:: with SMTP id h128mr4986992ybh.369.1611918340658; Fri, 29 Jan 2021 03:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611918340; cv=none; d=google.com; s=arc-20160816; b=u2FQv/Hi2jRORggfQoDUw7EEBZOnPMOQq5FdXUkYr480wbJRoJuH/jObQSYcLsMdIv n/SHfmC6V8iEqyTmByFLnKcx2SXHm3vmXNHD8GQDTSrn+k88wYHydspJOXKgrHiPTNK4 9r4EbrwzmmYZKnWUZ/SEmYtfjjShyXKUgrbg0gtJPXP5Sp5uMqPo5S1lZgl75sqaLbia 4dkwSbQwdtx1g0amrDj50rkR3X75INSq4Ev42BsLsW6WN5MCajoxsZyGBfhPUvhi6rUF y7jlBYl4JzFdpJg93fSjwpELpANEZDcLG4Y0WBwDfIVXv7UoqlADRb2u+0Un5vk7bezL 3d/w== 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=iW8Ts76zOzAuSJ0IzcTQOSJYua+KNxe9xoQ6aMzjrVY=; b=k8MIbj0QvHyHzeQe99Uyih9j8I5KGOik0DQSi2qVE8MgweUI6tJZlVqBb0FxnEt43y 71reU74KZy9MidoIEwxHiw+tCeUBuN6N7oAQLx8b2sXLyThTpo+OLE5fz9oevFRMP/l8 jXZtPRo24HASnfiyc28VTIRhirZPZZ38UcmBAa+7qdfPaReqWb03AOXvWXhRQV+Y6h8X 9SJSgEEfIfOcaxilNJRWcAZnokEGQNImNRrgn5Pv8eLLGSPGJWFqqo8psScSh78vYihq 3NL1jf3NBeIvTtioWcPzOiIO14t8XGiF5awn6WO8aEQX4hm5JL+miQWvkc1fqAL5NSC7 1X4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KT5BrKcp; 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 c205si1523264ybf.432.2021.01.29.03.05.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jan 2021 03:05:40 -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=KT5BrKcp; 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]:47128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5Rau-0002uu-41 for patch@linaro.org; Fri, 29 Jan 2021 06:05:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5RW3-0004Pc-Un for qemu-devel@nongnu.org; Fri, 29 Jan 2021 06:00:39 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:43311) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5RVp-0006wr-KE for qemu-devel@nongnu.org; Fri, 29 Jan 2021 06:00:39 -0500 Received: by mail-wr1-x42c.google.com with SMTP id z6so8339079wrq.10 for ; Fri, 29 Jan 2021 03:00:24 -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=iW8Ts76zOzAuSJ0IzcTQOSJYua+KNxe9xoQ6aMzjrVY=; b=KT5BrKcpDPmtWwQ/4kxdCsBhjTFwYfwOtl+N3Xax/It+IYSnTLT0AZU/W2Zr6StYdI j8UGai7pw4veE8eJgftB4Xbr3tWujxzvfDCAXaFG9mXQm0Jc2YdVi9zVAn5iJvJD8OWS FiS+HGeeMf2iiW6EfmfwdwHkoasozq5aFDBVC7mcDc+Yxs4Aqcw+3IwI+6FPdotJtjxS 8EPup0VekGQQYpceSQP/krTfBwl0Zqrm90RBoLayeGQZCU1hOuBi5hcU8IocXDk8ND7D hMNl5/Y16L3K5tYrFRmx+iA7IeKMSG3M1j+y3pys00CNw4GAD40hEaezWnwNaUcrrSnG frtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iW8Ts76zOzAuSJ0IzcTQOSJYua+KNxe9xoQ6aMzjrVY=; b=dpnYV55CtSjL8bz3CgKlnYcY8mzYYTU3FVKu4lmTJJ1XmN6lI+42ySbl7okz58w+Vw GffpxCU1nxPhiyRAPu/TQVoPILJBbTuL39J1FPRCAPRh5xxQCN3RrkYCjpps3uzIejEE Zde2y8JlcNdeIx+6Xwqnq1Y6D+5HfjmN82BTFWu0fhcy1jOSH3DV4ZQhWcaAPYI/cP9x HsUu7fYQRunGScMnwlaUFFV4hm+PtxEB14zyRxF7EaYJni3ZKa9tcAtqdpC+MFWmCCeA 8T3LyVr+JCV6PPpHXTpTDZsydPQGCtilK2j8lRTgTaz5iPrJ9Co56Ajp1qGhATGvWq8A ljbA== X-Gm-Message-State: AOAM530gVMCPDesYAwJlIYnIxt5nEb8didcGdkIgRb1HF5lAYuzbkewl kRuddxScTmr4vH2lPuv2kYjQ1xXALBz2KQ== X-Received: by 2002:a5d:6189:: with SMTP id j9mr3852673wru.256.1611918023539; Fri, 29 Jan 2021 03:00:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w20sm9268761wmm.12.2021.01.29.03.00.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 03:00:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/46] configure: Move preadv check to meson.build Date: Fri, 29 Jan 2021 10:59:35 +0000 Message-Id: <20210129110012.8660-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210129110012.8660-1-peter.maydell@linaro.org> References: <20210129110012.8660-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Move the preadv availability check to meson.build. This is what we want to be doing for host-OS-feature-checks anyway, but it also fixes a problem with building for macOS with the most recent XCode SDK on a Catalina host. On that configuration, 'preadv()' is provided as a weak symbol, so that programs can be built with optional support for it and make a runtime availability check to see whether the preadv() they have is a working one or one which they must not call because it will runtime-assert. QEMU's configure test passes (unless you're building with --enable-werror) because the test program using preadv() compiles, but then QEMU crashes at runtime when preadv() is called, with errors like: dyld: lazy symbol binding failed: Symbol not found: _preadv Referenced from: /Users/pm215/src/qemu/./build/x86/tests/test-replication Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found: _preadv Referenced from: /Users/pm215/src/qemu/./build/x86/tests/test-replication Expected in: /usr/lib/libSystem.B.dylib Meson's own function availability check has a special case for macOS which adds '-Wl,-no_weak_imports' to the compiler flags, which forces the test to require the real function, not the macOS-version-too-old stub. So this commit fixes the bug where macOS builds on Catalina currently require --disable-werror. Signed-off-by: Peter Maydell Acked-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210126155846.17109-1-peter.maydell@linaro.org --- configure | 16 ---------------- meson.build | 4 +++- 2 files changed, 3 insertions(+), 17 deletions(-) -- 2.20.1 diff --git a/configure b/configure index 87de49e2c21..8549c7b5ebe 100755 --- a/configure +++ b/configure @@ -3531,19 +3531,6 @@ if compile_prog "" "" ; then iovec=yes fi -########################################## -# preadv probe -cat > $TMPC < -#include -#include -int main(void) { return preadv(0, 0, 0, 0); } -EOF -preadv=no -if compile_prog "" "" ; then - preadv=yes -fi - ########################################## # fdt probe @@ -5748,9 +5735,6 @@ fi if test "$iovec" = "yes" ; then echo "CONFIG_IOVEC=y" >> $config_host_mak fi -if test "$preadv" = "yes" ; then - echo "CONFIG_PREADV=y" >> $config_host_mak -fi if test "$membarrier" = "yes" ; then echo "CONFIG_MEMBARRIER=y" >> $config_host_mak fi diff --git a/meson.build b/meson.build index a58c6f67854..27c31caa2d1 100644 --- a/meson.build +++ b/meson.build @@ -1128,6 +1128,8 @@ config_host_data.set('HAVE_PTY_H', cc.has_header('pty.h')) config_host_data.set('HAVE_SYS_IOCCOM_H', cc.has_header('sys/ioccom.h')) config_host_data.set('HAVE_SYS_KCOV_H', cc.has_header('sys/kcov.h')) +config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include ')) + ignored = ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target arrays = ['CONFIG_AUDIO_DRIVERS', 'CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] strings = ['HOST_DSOSUF', 'CONFIG_IASL'] @@ -2414,7 +2416,7 @@ summary_info += {'PIE': get_option('b_pie')} summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} summary_info += {'malloc trim support': has_malloc_trim} summary_info += {'membarrier': config_host.has_key('CONFIG_MEMBARRIER')} -summary_info += {'preadv support': config_host.has_key('CONFIG_PREADV')} +summary_info += {'preadv support': config_host_data.get('CONFIG_PREADV')} summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')} summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')} summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')}