From patchwork Thu Sep 3 08:31:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3F91C433E7 for ; Thu, 3 Sep 2020 08:33:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A6D9205F4 for ; Thu, 3 Sep 2020 08:33:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U+/m3NZN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A6D9205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:60244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkgP-0000ql-Md for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfA-0007i5-Sr for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:08 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:46232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkf8-0001Vy-Tu for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:08 -0400 Received: by mail-pf1-x432.google.com with SMTP id b124so1698366pfg.13 for ; Thu, 03 Sep 2020 01:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=khVmfuvTdyvS7QBmYXBUkXeRmJb4FrO0KFERex1f1TA=; b=U+/m3NZNlc1pfFZqoLNgskTiXKs1ZMecZI8gDN4POkgRjXmlTndGM+9P+DVVagEME7 t4shwbNJqU8Tt7W2hoEBztuYQrfFrcj2WhRoYz8qDeP9qTaMm0DQqTFjeGUy7lb+KTDT 6rlDbA6BhIlJquJzJo3kUI4ANH1q7Xkvp7JTcBNOafsu+RUtRTtlDuUuJ/PadS7F+RQb I8WOHxh2VZJN+PkiSBD92w7aIm0WG2vd6agC2lrc/a9voUTKFRR479NlwJaAgWmBGDwA WBeL05pLEEfKhcfECdD2roHkKguUhWbL1av6W73w/mEKqcl+3h3V7tLVkH6OtT2Vtsb+ 4atw== 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=khVmfuvTdyvS7QBmYXBUkXeRmJb4FrO0KFERex1f1TA=; b=Kc2EXtLIuVKNIEp8KM6Ef5KRKVFiFvMl0TnVHzYKVm9/dl3xAFt6YBWHxfblHmEjo/ GOPn0lF1NmplAx88G+k+STI9uYis1sqJGto9xEqmJ4dMRDITU98LeVxowEpev63u/XSB G6ksSlf+UP6XKimqHzj61g0JXsci5JWtXx2Kx2segJ6yrHQYzm1nIOukq094Yi7Gh77Y 0XSHs4fDUnhEBingDThE+rMwNOsEc4bXBHAgPplW+gquge+98/rMQNF25RQmyHOtrFo5 cMyBmXauTitcx+anMB5Z+ZvLnNfLhld4vJa0KuH/OT1IaXvHFa2Ve79nTF7b8M2mIi/0 67Dw== X-Gm-Message-State: AOAM533Vjy6tC4OpnrDaCZcoGmcLXunXCQWkbdTtZ6D4i0hk/BxWAcGd eSSSn1b3wo22ITJPQtDfSyDlwLcJAKGetvO/ X-Google-Smtp-Source: ABdhPJwY/tnEQnLIL6ZjcD6ACzS5uXb0RnWsMY51Lc8iOjPswnrWRhF7vOrCsBSpjh3b0RVd9Ug0uQ== X-Received: by 2002:a17:902:bc44:: with SMTP id t4mr1984703plz.77.1599121924811; Thu, 03 Sep 2020 01:32:04 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:04 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 02/12] meson: Convert undefsym.sh to undefsym.py Date: Thu, 3 Sep 2020 16:31:37 +0800 Message-Id: <20200903083147.707-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" undefsym.sh are not msys2 compatible, convert it to python script Signed-off-by: Yonggang Luo --- meson.build | 2 +- scripts/undefsym.py | 57 +++++++++++++++++++++++++++++++++++++++++++++ scripts/undefsym.sh | 20 ---------------- 3 files changed, 58 insertions(+), 21 deletions(-) create mode 100644 scripts/undefsym.py delete mode 100755 scripts/undefsym.sh diff --git a/meson.build b/meson.build index 55c7d2318c..c9f5d05664 100644 --- a/meson.build +++ b/meson.build @@ -863,7 +863,7 @@ foreach d, list : modules endforeach nm = find_program('nm') -undefsym = find_program('scripts/undefsym.sh') +undefsym = find_program('scripts/undefsym.py') block_syms = custom_target('block.syms', output: 'block.syms', input: [libqemuutil, block_mods], capture: true, diff --git a/scripts/undefsym.py b/scripts/undefsym.py new file mode 100644 index 0000000000..c690f88c7a --- /dev/null +++ b/scripts/undefsym.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Before a shared module's DSO is produced, a static library is built for it +# and passed to this script. The script generates -Wl,-u options to force +# the inclusion of symbol from libqemuutil.a if the shared modules need them, +# This is necessary because the modules may use functions not needed by the +# executable itself, which would cause the function to not be linked in. +# Then the DSO loading would fail because of the missing symbol. + + +""" +Compare the static library with the shared module for compute the symbol duplication +""" + +import sys +import subprocess + +def filter_lines_set(stdout, is_static = True): + linesSet = set() + for line in stdout.splitlines(): + tokens = line.split(b' ') + if len(tokens) >= 1: + if len(tokens) > 1: + if is_static and tokens[1] == b'U': + continue + if not is_static and tokens[1] != b'U': + continue + new_line = b'-Wl,-u,' + tokens[0] + if not new_line in linesSet: + linesSet.add(new_line) + return linesSet + +def main(args): + if len(args) <= 3: + sys.exit(0) + + nm = args[1] + staticlib = args[2] + pc = subprocess.run([nm, "-P", "-g", staticlib], stdout=subprocess.PIPE) + if pc.returncode != 0: + sys.exit(-1) + lines_set_left = filter_lines_set(pc.stdout) + + shared_modules = args[3:] + pc = subprocess.run([nm, "-P", "-g"] + shared_modules, stdout=subprocess.PIPE) + if pc.returncode != 0: + sys.exit(-1) + lines_set_right = filter_lines_set(pc.stdout, False) + lines = [] + for line in sorted(list(lines_set_right)): + if line in lines_set_left: + lines.append(line) + sys.stdout.write(b'\n'.join(lines).decode()) + +if __name__ == "__main__": + main(sys.argv) diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh deleted file mode 100755 index b9ec332e95..0000000000 --- a/scripts/undefsym.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env bash - -# Before a shared module's DSO is produced, a static library is built for it -# and passed to this script. The script generates -Wl,-u options to force -# the inclusion of symbol from libqemuutil.a if the shared modules need them, -# This is necessary because the modules may use functions not needed by the -# executable itself, which would cause the function to not be linked in. -# Then the DSO loading would fail because of the missing symbol. - -if test $# -le 2; then - exit 0 -fi - -NM=$1 -staticlib=$2 -shift 2 -# Find symbols defined in static libraries and undefined in shared modules -comm -12 \ - <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \ - <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u) From patchwork Thu Sep 3 08:31:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E69D2C433E7 for ; Thu, 3 Sep 2020 08:36:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D0DA205F4 for ; Thu, 3 Sep 2020 08:36:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UecifaYj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D0DA205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkjY-0006PK-7t for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:36:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfJ-000815-8r for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:17 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:46994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkfH-0001XA-Dm for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:16 -0400 Received: by mail-pf1-x441.google.com with SMTP id b124so1698727pfg.13 for ; Thu, 03 Sep 2020 01:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=voK9C8LiSWL+Sm9aw369V+YjsDRfz05KST8rSNgg5Yw=; b=UecifaYjE9GcSWUSF9N1tLjhA+cZsMLg2kcs0qDM1722DxUXQyJMfS4Y28AqFcK5Ve apIIxrH7idFQCZN3JBeP6jCmiTRt7ViWrIdCCh3vykKn39OEn7aM8zBiakcR1Aaity9T R9wtiTZgSTPB+UXDCV3A03PsaA0TUAifBBL35AfudFzXLhVuBVYMXDkdATfIuSp2LBy4 dOslYXE4s4q7uDPmJQ7Jt01CyutEb/QmYeqqdto5AE9zansbGUV4KR6kDWnJwP3PYFYL HJ6oSN+0PgOhu3W6Xh8gd0GvPajfRcKYs20ScbeVtQ+w28152vkYrE6oNs8H2t7vhWYv 06kw== 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=voK9C8LiSWL+Sm9aw369V+YjsDRfz05KST8rSNgg5Yw=; b=iX8UydwiCkuQrCpWxf1IWKIQGP8tcJ47RMOBZ3DMabyJqD1CosytQGg6Tv2yFzdtRz KM2I95IJ7FGuZ7JTTUWG832TsYBJKcbWk/oeIYpGQpdP9/FqWll6Mu6GA9OMfCIEqtFK 8BBosQ1R4dnUk15q5U6DAihculUu20ZJJTFMkj8Jc2lLVtZYtuoNmT3fMdP/RQORQGPp d4J2JVZAM1s7vYFXy+fyJz/wnfyu+haISJhIhJ0GGBldFe1OT5q01bbWkO9xsTb0KFAo NPWzlXJa+cPB1aSUcBHQgE+WXsMMyBFosIBqrhaxcHqCnamZhTIa/s7uDucxR07Msw8v RBDg== X-Gm-Message-State: AOAM533LwEw/5SiZQ3J6QBNray168RRipRtqiXhG0r+N6hFdgV3sZ/Gk u2CbRBj84IzM2RXeMeaRJ6/yqK6pCNvFJCJX X-Google-Smtp-Source: ABdhPJzuPzccfJ9n3HTblO9AeBYT1UfxblO/Calkraw50nPagKPG4SjkLO8S9cFEV3HqhTxQFfWstg== X-Received: by 2002:a62:8443:: with SMTP id k64mr2720150pfd.252.1599121931510; Thu, 03 Sep 2020 01:32:11 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:10 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 05/12] configure: Fix include and linkage issue on msys2 Date: Thu, 3 Sep 2020 16:31:40 +0800 Message-Id: <20200903083147.707-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by the compiler Cause $PWD are result posix style path such as /e/path/to/qemu that can not be recognized by mingw gcc, and `pwd -W` are result Windows style path such as E:/path/to/qemu that can be recognized by the mingw gcc. So we replace all $PWD with $build_path that can building qemu under msys2/mingw environment. Signed-off-by: Yonggang Luo --- configure | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 30f8c4db29..5f2bcc4b57 100755 --- a/configure +++ b/configure @@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes # make source path absolute source_path=$(cd "$(dirname -- "$0")"; pwd) +build_path=$PWD +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then +source_path=$(cd "$(dirname -- "$0")"; pwd -W) +build_path=`pwd -W` +fi -if test "$PWD" = "$source_path" +if test "$build_path" = "$source_path" then echo "Using './build' as the directory for build output" @@ -346,7 +351,12 @@ ld_has() { $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 } -if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; +check_valid_build_path="[[:space:]:]" +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then +check_valid_build_path="[[:space:]]" +fi + +if printf %s\\n "$source_path" "$build_path" | grep -q "$check_valid_build_path"; then error_exit "main directory cannot contain spaces nor colons" fi @@ -943,7 +953,7 @@ Linux) linux="yes" linux_user="yes" kvm="yes" - QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES" + QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I${build_path}/linux-headers $QEMU_INCLUDES" libudev="yes" ;; esac @@ -4259,7 +4269,7 @@ EOF fdt=git mkdir -p dtc fdt_cflags="-I${source_path}/dtc/libfdt" - fdt_ldflags="-L$PWD/dtc/libfdt" + fdt_ldflags="-L${build_path}/dtc/libfdt" fdt_libs="$fdt_libs" elif test "$fdt" = "yes" ; then # Not a git build & no libfdt found, prompt for system install @@ -5244,7 +5254,7 @@ case "$capstone" in else LIBCAPSTONE=libcapstone.a fi - capstone_libs="-L$PWD/capstone -lcapstone" + capstone_libs="-L${build_path}/capstone -lcapstone" capstone_cflags="-I${source_path}/capstone/include" ;; @@ -6244,8 +6254,8 @@ case "$slirp" in git_submodules="${git_submodules} slirp" fi mkdir -p slirp - slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src" - slirp_libs="-L$PWD/slirp -lslirp" + slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src" + slirp_libs="-L${build_path}/slirp -lslirp" if test "$mingw32" = "yes" ; then slirp_libs="$slirp_libs -lws2_32 -liphlpapi" fi @@ -8190,7 +8200,7 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -NINJA=${ninja:-$PWD/ninjatool} $meson setup \ +NINJA=${ninja:-${build_path}/ninjatool} $meson setup \ --prefix "${pre_prefix}$prefix" \ --libdir "${pre_prefix}$libdir" \ --libexecdir "${pre_prefix}$libexecdir" \ @@ -8212,7 +8222,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\ $cross_arg \ - "$PWD" "$source_path" + "$build_path" "$source_path" if test "$?" -ne 0 ; then error_exit "meson setup failed" From patchwork Thu Sep 3 08:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEEC0C433E7 for ; Thu, 3 Sep 2020 08:37:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5A44205F4 for ; Thu, 3 Sep 2020 08:37:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JRvMP0Ix" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5A44205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkkK-000804-O7 for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:37:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfK-00083C-99 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:18 -0400 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:53437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkfH-0001XG-IF for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:17 -0400 Received: by mail-pj1-x1042.google.com with SMTP id k15so1164814pji.3 for ; Thu, 03 Sep 2020 01:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bscWSrwzBlA91ho91MKRFqbKOrFCfnhQG9RPGa7f72A=; b=JRvMP0IxTuWCaVUbP1JTPzaIAPD2+wHmYDdVw+z84kXL5jM7Ir/OMJ9zW7GanKJ8fr U0iaOzgtysl/h25g6LaNusdO26Ki31kBOPuaukdAL9Z+v1PfdrfGOu+UfYxkcYBZiiDM FuXI6QnnIZbrREwh3cxq5s0otuApSrIPVaoFm8KR8r+GOvBsjkqm+bOsGulwz6cjFo20 mr5V0L06Jlyp9yizeqj2LXi7rk2RK/C+Sggs2LsilDUmKt6k8oI+znwqxswRfCNq+64H UmfUyiFD2W0WKy253F6u5GPaVKIlqfYcXXKN/gKUmlgWck1Iws3JiAINhO1w/cdJaAbc x0eg== 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=bscWSrwzBlA91ho91MKRFqbKOrFCfnhQG9RPGa7f72A=; b=gde5KmqOJUloN8uspV1EG1A4iOxHR/42nbKy3g1e2lxPOcaN4gdJr4vMku/PtVIjct 5OFk4YwESZ62hJmPvR7nNboY0i7T4ojeCzUgZ9UjAnyhawE2bLwfmSJu+BTRtxF08bsL Fr1s28CtwGJoH9GOplLfNIZ4mbkTUrVW3VbYV9yLsmMqi3P/zIv/e6UVmCf2v4P2zyRi ChrUuS4Bqo6qAo10b5k0mUASiygqOVFVGEOr3scLBhMQxwoPfSND5wwy+pV3DlNlpvqo Gtahr9ZFQ3iNIdpG9pFX67YJbyyJY3ifPXgV2y6NP85Yk0ST0pkjsAui4Yr9ckqBfSFs qdJw== X-Gm-Message-State: AOAM5321HmR8NycKn2CqWOTYm2Gnj4vBGCtWpao/6dXRpro3cbmlAmqJ IKxhG/EDmtBTDLY+yPqnC2CuC/9lSz9qSbxX X-Google-Smtp-Source: ABdhPJwyElI0uUF+z5TC8kNYHF9A3vZscgcUS4CFsdvmAjZMpGmP07Ak9atNW0MvoiZ22ouqa82WRA== X-Received: by 2002:a17:90b:611:: with SMTP id gb17mr2198066pjb.71.1599121933602; Thu, 03 Sep 2020 01:32:13 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:12 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 06/12] block: Fixes nfs on msys2/mingw Date: Thu, 3 Sep 2020 16:31:41 +0800 Message-Id: <20200903083147.707-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1042.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yonggang Luo --- block/nfs.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 61a249a9fc..34b2cd5708 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -24,7 +24,9 @@ #include "qemu/osdep.h" +#if !defined(_WIN32) #include +#endif #include "qemu/config-file.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -51,6 +53,12 @@ #define QEMU_NFS_MAX_PAGECACHE_SIZE (8388608 / NFS_BLKSIZE) #define QEMU_NFS_MAX_DEBUG_LEVEL 2 +#if defined (_WIN32) +#define nfs_stat __stat64 +#else +#define nfs_stat stat +#endif + typedef struct NFSClient { struct nfs_context *context; struct nfsfh *fh; @@ -58,7 +66,7 @@ typedef struct NFSClient { bool has_zero_init; AioContext *aio_context; QemuMutex mutex; - blkcnt_t st_blocks; + int64_t st_size; bool cache_used; NFSServer *server; char *path; @@ -70,7 +78,7 @@ typedef struct NFSRPC { int ret; int complete; QEMUIOVector *iov; - struct stat *st; + struct nfs_stat *st; Coroutine *co; NFSClient *client; } NFSRPC; @@ -419,7 +427,7 @@ static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, int flags, int open_flags, Error **errp) { int64_t ret = -EINVAL; - struct stat st; + struct nfs_stat st; char *file = NULL, *strp = NULL; qemu_mutex_init(&client->mutex); @@ -545,7 +553,7 @@ static int64_t nfs_client_open(NFSClient *client, BlockdevOptionsNfs *opts, } ret = DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE); - client->st_blocks = st.st_blocks; + client->st_size = st.st_size; client->has_zero_init = S_ISREG(st.st_mode); *strp = '/'; goto out; @@ -729,11 +737,11 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) { NFSClient *client = bs->opaque; NFSRPC task = {0}; - struct stat st; + struct nfs_stat st; if (bdrv_is_read_only(bs) && !(bs->open_flags & BDRV_O_NOCACHE)) { - return client->st_blocks * 512; + return client->st_size; } task.bs = bs; @@ -746,7 +754,7 @@ static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) nfs_set_events(client); BDRV_POLL_WHILE(bs, !task.complete); - return (task.ret < 0 ? task.ret : st.st_blocks * 512); + return (task.ret < 0 ? task.ret : st.st_size); } static int coroutine_fn @@ -778,7 +786,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) { NFSClient *client = state->bs->opaque; - struct stat st; + struct nfs_stat st; int ret = 0; if (state->flags & BDRV_O_RDWR && bdrv_is_read_only(state->bs)) { @@ -800,7 +808,7 @@ static int nfs_reopen_prepare(BDRVReopenState *state, nfs_get_error(client->context)); return ret; } - client->st_blocks = st.st_blocks; + client->st_size = st.st_size; } return 0; From patchwork Thu Sep 3 08:31:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB98AC433E7 for ; Thu, 3 Sep 2020 08:35:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B435206E7 for ; Thu, 3 Sep 2020 08:35:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="crfxegqz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B435206E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDki8-0004Co-Ji for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:35:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfQ-0008Gh-Bx for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:24 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:35738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkfO-0001Y2-Kc for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:24 -0400 Received: by mail-pf1-x442.google.com with SMTP id o68so1737445pfg.2 for ; Thu, 03 Sep 2020 01:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6lmnRR0tZitC7JnT2Axu3G4iTyGoQuwXgZI7oqF9oeM=; b=crfxegqzLtzvHjQPbKaRnD7Mp7dr+VcWUlqSpgwL7RZ2P0Vwn/TrD+tfBl8qxj4HBw yetOpMB+UKcEkvPDi7Iu+xKW1cnqYd+rKVxLUvngqhB/2IY5+kIcXvsa/8mM1KxgMl9t We7gem8zwTvL68OR90zYZStmrJ1VWPayNll5KMsF+G46KQS9oNUUr1U4HtekcV+TvMxG 5nkZwDN2tCqrZdwUWN8vd4bH1RuhDq3/bSESwKg46LncGUletuydcHQolEudATYJv5+7 5zpI16PpNMvMx+T0gGyvhG1PErkQJVxynhME/dRmstEEJ9TAqcfy78mKOwip9nSmDPsg h7bg== 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=6lmnRR0tZitC7JnT2Axu3G4iTyGoQuwXgZI7oqF9oeM=; b=miD6Cp3X6Wc/qG+spVHTNvLCgAPL0y5E/ITkGEFnyzl77BdEiarHxETsb3GaupbZdc 7hRRbnCGYaPqVxhLdt95Ab3ygzJeAZeKXzEF2A5ZcvYd982/AYULnO+owYXfQFvqag0r 0by2+ntaUoHhJGSeUl72HRIXPnCeUyXUE9uYcbjP8fBDCGaQZF8zrbgEfh7zSSmHJxVc CVzmdncEmKs2NHXcOWvGdrRjVxL4lb932pCgX04/qIqNUD/nNPYzY7Jn6B+6vKT+akYS wljeVxHD+8ysTQlkZfpwktmebbcybshRCOuo5Hz+r4OEudsitQoZe61WbaMQvZvlFx/s p+aw== X-Gm-Message-State: AOAM530XHkuFxNVqwJvpJa6A37cULHYxRF9sIYLKhMqOLUVpfmYykcBV 1QJPpYumPR3Bzy090+nk4hXrdMALJ1mpe3wh X-Google-Smtp-Source: ABdhPJyhXcLybArxKbSoHg3/1IhdFcZhVLprmbIm1fCabTYO6htP4qYDSTJy20fLnIT40FzaSiO4mA== X-Received: by 2002:a62:5fc4:: with SMTP id t187mr2819613pfb.34.1599121940947; Thu, 03 Sep 2020 01:32:20 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:20 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 09/12] stubs: qemu_notify_event have no need to stub Date: Thu, 3 Sep 2020 16:31:44 +0800 Message-Id: <20200903083147.707-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" LINK tests/test-qdev-global-props.exe LINK tests/test-timed-average.exe C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: libqemuutil.a(util_main-loop.c.obj): in function `qemu_notify_event': C:\work\xemu\qemu-build/../qemu/util/main-loop.c:139: multiple definition of `qemu_notify_event'; libqemuutil.a(stubs_notify-event.c.obj):C:\work\xemu\qemu-build/../qemu/stubs/notify-event.c:6: first defined here collect2.exe: error: ld returned 1 exit status make: *** [C:/work/xemu/qemu/rules.mak:88:tests/test-timed-average.exe] 错误 1 Signed-off-by: Yonggang Luo --- stubs/notify-event.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/stubs/notify-event.c b/stubs/notify-event.c index 827bb52d1a..59935db11e 100644 --- a/stubs/notify-event.c +++ b/stubs/notify-event.c @@ -1,6 +1,2 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" - -void qemu_notify_event(void) -{ -} From patchwork Thu Sep 3 08:31:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C2A1C433E2 for ; Thu, 3 Sep 2020 08:38:52 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 45A48205F4 for ; Thu, 3 Sep 2020 08:38:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qjua9vm4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45A48205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDklf-0001NE-Do for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:38:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfS-0008Lf-Iy for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:26 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:38137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkfQ-0001YM-NR for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:26 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d22so1725634pfn.5 for ; Thu, 03 Sep 2020 01:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bq1eYS85B3lVfUWOPYt+//P+vJhXogDV3XY3bX1W5SI=; b=Qjua9vm4Xb2s+TOoRz8gpA20TD505Ci12y11ViB0+MiyYsBaKii5dfLwmQtVdGjPkI EGNZQMgUivNRybmo8F0IMnESP714Ig8xxOfRmHDy5tDjjv+AJhfcg3uWH9Om1VCAIfFW v/UOMkB1e3E9Gv2b7Ll51H2grJ/frYg6pkpNwwUc3C9vrkUZIa3LwOHZURtjz6ByJles v+E6n6XkRpQhMLz4ya11EF3f+KMuaMA58Eqbh9/ydQSCJp3jGrmSL3SEPQH3JcwYeQq5 VsHCuFPxUaFy0mDrEiDgRKraMTsISd4oNYsf8VIN22+8phEDSclp6cuHVqWBIaagjXjd 26Pg== 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=Bq1eYS85B3lVfUWOPYt+//P+vJhXogDV3XY3bX1W5SI=; b=D7JccgknVYU3DV/K1XnjPLfEuhV1icgxDa8P4M2bFlJBzMaLeFUurPQb5RYGpRA+9N +qlFZocHFq+88a/lab6MfATCXD5xWKvl/3XxqoMZTQYlgG03N6fQktlsOgxkS+ApYZDJ DX8RWu2Y7PftZvB3t8cxN5ItdCCBYtjRaSuPoMZ04ZD/qVJRH0z3WV2i8ET9WCeslLqf XeDeovQeCG3K5Sn+OJ1B7WEXJAwnqYitmyYAB42EEXwzWi49N7W6gmEMJu2d8iMF1z1o QVdV+CipiiSkN7cH1HBwrTcUcoyYmZ3M9kBmMQA/V+1dLFPZ1A3+0J1TNEmjy1gJdmqa u2+A== X-Gm-Message-State: AOAM531fYx2rQobe7cPXNu60nXRiFl7WZWq1FObHhmxzRWNkdaUJrXDC ODdCM9/tZip59IKC6/XQW4b15Q/DQxJwa/+6 X-Google-Smtp-Source: ABdhPJyVQK+5CBAl6B2nr7dRouGpaxenn3rjtGw7mjxuUUKrMn0ABbAg/N7u0GU3bGST9HgeG3N7+Q== X-Received: by 2002:a62:7bc3:: with SMTP id w186mr2714255pfc.221.1599121943019; Thu, 03 Sep 2020 01:32:23 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:22 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 10/12] meson: Fixes qapi tests. Date: Thu, 3 Sep 2020 16:31:45 +0800 Message-Id: <20200903083147.707-11-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The error are: +@end table + +@end deftypefn + make: *** [Makefile.mtest:63: check-qapi-schema] Error 1 Signed-off-by: Yonggang Luo --- tests/qapi-schema/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index c87d141417..67ba0a5ebd 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -220,6 +220,7 @@ qapi_doc = custom_target('QAPI doc', # "full_path()" needed here to work around # https://github.com/mesonbuild/meson/issues/7585 -test('QAPI doc', diff, args: ['-u', files('doc-good.texi'), qapi_doc[0].full_path()], +test('QAPI doc', diff, args: ['--strip-trailing-cr', + '-u', files('doc-good.texi'), qapi_doc[0].full_path()], depends: qapi_doc, suite: ['qapi-schema', 'qapi-doc']) From patchwork Thu Sep 3 08:31:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78DE6C433E2 for ; Thu, 3 Sep 2020 08:39:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30D29205F4 for ; Thu, 3 Sep 2020 08:39:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m6b1t1Tt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30D29205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDkmg-0003Mz-BI for qemu-devel@archiver.kernel.org; Thu, 03 Sep 2020 04:39:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDkfX-000079-W3 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:32 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:39957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDkfV-0001Yq-R8 for qemu-devel@nongnu.org; Thu, 03 Sep 2020 04:32:31 -0400 Received: by mail-pg1-x542.google.com with SMTP id h12so1542727pgm.7 for ; Thu, 03 Sep 2020 01:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=saL59JT8vgtuerHEUxQexVZzR88NjHdTy6fNel9QYzI=; b=m6b1t1TtAVQBIztwJWWUBz8Ysg5lj+8MQ4G7KKUHFLKaEM+Rxfy74crF+FDOPd+0cg eZfEsK0BZmXUINkLaI06eZmjze04vlPbGVbZKt8vgScZVrObjO/QBjp0/Qe5WNKdY0Dx fo23dw7b6IBj/SkPAzlxzp6Rj+bWhQEn3lnVIJDbSLk6QjeVm34tq/MQ7hCTV515A6Y3 IFtANtWx2vIRyXjC2mEaOT87mCHoP0d7B+2dka15TqOWtlOXhWpNNyxOFOFqnUlqon8/ iZXg2AribxjwvYF2kxLrpnlHSXa2naui5uUBL0oLOCwwCgr5WjDTBC0jZcFTc+aY5XYr mgKg== 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=saL59JT8vgtuerHEUxQexVZzR88NjHdTy6fNel9QYzI=; b=fvZ02lU6eLtVNArFZbYh5HJ+8RgYYCVt6bHFJxF0FH4GBtM2UXtyMrONNfynaftgxt y7w264BZZDMpGF7u5T9pgQQsVV1+R/8Cfc6/pFs8H8lfxVyxjzybi+iqaHbefPfFunDr dgPYkudnFEkF7/F32HZqjny/kSHhHOYNxxy42GN6/T2lmYhEH2zAwhE9Mbox4UB8JCf7 yK6FRePoBDqxy3DGXTpibNctpo5AJv0CAAupW5Ku36YIbjC8V7gubnnGfWmwvbFeuuw3 bAYR3l0gvnnqXwudqK8j61fprXt9/6+h7NRhLLgGLUI+VmRye0fRPAI9bXrarF1zcdiu 1yFw== X-Gm-Message-State: AOAM530NXq1LGJOg+OdP2u6QV+vqHmM0npaST3B1lcQjDxWhchAmgH1/ 3A6xsEZDoEwkCyExPKzPka6dPFIddNjY14Hs X-Google-Smtp-Source: ABdhPJxMX7X+HG4avHrHPrd/o0Z+SZ0DYX/7GkLK3NUIvS7QZYe5yb8SF0cNkjuytMKn/tIZhvhpPQ== X-Received: by 2002:aa7:925a:: with SMTP id 26mr2918417pfp.6.1599121947960; Thu, 03 Sep 2020 01:32:27 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id e7sm1759201pgn.64.2020.09.03.01.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:32:27 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v4 12/12] ci: Enable msys2 ci in cirrus Date: Thu, 3 Sep 2020 16:31:47 +0800 Message-Id: <20200903083147.707-13-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200903083147.707-1-luoyonggang@gmail.com> References: <20200903083147.707-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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: Paolo Bonzini , Yonggang Luo Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Install msys2 in a proper way refer to https://github.com/cirruslabs/cirrus-ci-docs/issues/699 The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be updated. There is no need of --cross-prefix, open mingw64.exe instead of msys2.exe then we don't need the --cross-prefix, besides using ENV MSYS: winsymlinks:nativestrict MSYSTEM: MINGW64 CHERE_INVOKING: 1 to opening mingw64 native shell. Signed-off-by: Yonggang Luo --- .cirrus.yml | 24 +++++++++++++++++++++ scripts/ci/windows/msys2_build.sh | 33 +++++++++++++++++++++++++++++ scripts/ci/windows/msys2_install.sh | 31 +++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 scripts/ci/windows/msys2_build.sh create mode 100644 scripts/ci/windows/msys2_install.sh diff --git a/.cirrus.yml b/.cirrus.yml index f287d23c5b..0bfb465193 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -40,3 +40,27 @@ macos_xcode_task: - ../configure --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check + +windows_msys2_task: + windows_container: + image: cirrusci/windowsservercore:cmake + os_version: 2019 + cpu: 8 + memory: 8G + env: + MSYS: winsymlinks:nativestrict + MSYSTEM: MINGW64 + CHERE_INVOKING: 1 + printenv_script: + - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv' + install_script: + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig" + - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools && pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman -Sy --noconfirm" + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --needed --noconfirm -S bash pacman pacman-mirrors msys2-runtime" + - taskkill /F /IM gpg-agent.exe + - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2_install.sh" + script: + - C:\tools\msys64\usr\bin\bash.exe -lc "sh scripts/ci/windows/msys2_build.sh" diff --git a/scripts/ci/windows/msys2_build.sh b/scripts/ci/windows/msys2_build.sh new file mode 100644 index 0000000000..3ba89a4206 --- /dev/null +++ b/scripts/ci/windows/msys2_build.sh @@ -0,0 +1,33 @@ +mkdir build +cd build +../configure \ + --python=python3 \ + --enable-gtk --enable-sdl \ + --enable-capstone=git \ + --enable-stack-protector \ + --ninja=ninja \ + --enable-gnutls \ + --enable-nettle \ + --enable-vnc \ + --enable-vnc-sasl \ + --enable-vnc-jpeg \ + --enable-vnc-png \ + --enable-membarrier \ + --enable-slirp=git \ + --disable-kvm \ + --enable-hax \ + --enable-whpx \ + --disable-spice \ + --enable-lzo \ + --enable-snappy \ + --enable-bzip2 \ + --enable-vdi \ + --enable-qcow1 \ + --enable-tools \ + --enable-libusb \ + --enable-usb-redir \ + --enable-libnfs \ + --enable-libssh \ + --disable-pie +make -j$NUMBER_OF_PROCESSORS +# make check diff --git a/scripts/ci/windows/msys2_install.sh b/scripts/ci/windows/msys2_install.sh new file mode 100644 index 0000000000..ff35b73ef2 --- /dev/null +++ b/scripts/ci/windows/msys2_install.sh @@ -0,0 +1,31 @@ +pacman --noconfirm -S --needed \ +base-devel \ +git \ +mingw-w64-x86_64-python \ +mingw-w64-x86_64-python-setuptools \ +mingw-w64-x86_64-toolchain \ +mingw-w64-x86_64-SDL2 \ +mingw-w64-x86_64-SDL2_image \ +mingw-w64-x86_64-gtk3 \ +mingw-w64-x86_64-ninja \ +mingw-w64-x86_64-make \ +mingw-w64-x86_64-lzo2 \ +mingw-w64-x86_64-libjpeg-turbo \ +mingw-w64-x86_64-pixman \ +mingw-w64-x86_64-libgcrypt \ +mingw-w64-x86_64-capstone \ +mingw-w64-x86_64-libpng \ +mingw-w64-x86_64-libssh \ +mingw-w64-x86_64-libxml2 \ +mingw-w64-x86_64-snappy \ +mingw-w64-x86_64-libusb \ +mingw-w64-x86_64-usbredir \ +mingw-w64-x86_64-libtasn1 \ +mingw-w64-x86_64-libnfs \ +mingw-w64-x86_64-nettle \ +mingw-w64-x86_64-cyrus-sasl \ +mingw-w64-x86_64-curl \ +mingw-w64-x86_64-gnutls \ +mingw-w64-x86_64-zstd \ +mingw-w64-x86_64-glib2 +