From patchwork Wed Sep 2 21:42:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE0B7722 for ; Wed, 2 Sep 2020 21:43:46 +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 900FB207EA for ; Wed, 2 Sep 2020 21:43:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JaKsd5Ee" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 900FB207EA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaXh-0007dN-Hx for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:43:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWb-000672-Ce for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:37 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:39761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWZ-0001QE-SE for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:37 -0400 Received: by mail-pf1-x441.google.com with SMTP id u128so450630pfb.6 for ; Wed, 02 Sep 2020 14:42:35 -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=38x0lAOA2AfvsIyHP+ReuB52i8b3LJOhHNpZq8BiwHk=; b=JaKsd5EeuMSJds4q5R4HR/TtJPk8oi5ylSr2sONOvWmjTdovICnzIIhRKVPqqqk7oa 3o/qsjVsGb1if9zAV5+Y2+L/Wj1YjzhIFRQdNsNNKTD0f7LE5cV2FTDnl7A2eviAS4Nx 5YNJkWKm04Y41NpDKFOj025XMK1a0sB7DxZE6Tcw/CPbNo8h5gaCiPBZxmqXve+7kIrR qNt4gtMYCOSJkl2iif8/qXb668I2woQbPdr63Ow6PQ1cOCZl5lOrooEijL4NkmuznoBG /KwsIxtss/SHElp1lM21bVtt9f6Q9l1llz/izu7f5dvb+pI1kk/pCklav4rVQ5WC5Iqc lOxw== 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=38x0lAOA2AfvsIyHP+ReuB52i8b3LJOhHNpZq8BiwHk=; b=L/Lnzk7CJQXU1Cev+y2kR6HEHguYyTIkEEN1P3zEekJTwL2abCYEQ1iseiO7FyVK5c vQ61rRp6tmm2hEm7cVe5OYzrg5WtE9UiJ+pelUZpta+8BQAQAA3+oO9TLwUSplB56/k2 yMe+CgavvrhXLKT9GiCMNFhUw75JyZGyH/0233y4FPD7TyeMxzAlesDLTp5XxYOhsby2 e89mnxVW/1y7Q6HP15SsybO3kW1cgjl36+qtKePC4V+pVzTFbdqZ73KgLnvQCUXdgq7w 9jeAcvg06UHqoOM8d8tZYEAyYl36IE1Xutjv/ZdVj3J+peR7tPr10PrRCLZDpTKs5XUY /1Mw== X-Gm-Message-State: AOAM530Tv5KUT13X5PpekIP/yy367b9JnwDRJGNVukRMHMMqLhsGETtP V/VM9HYQBlbIGyGRNNXfX87EPlarjp1wdQ== X-Google-Smtp-Source: ABdhPJz+vXxWGtQ08j/JrRtpzTSM1BHMGsytuH3wuYTE+uDUNKryz9Mc84t40TV75joqzsgmWGhAkA== X-Received: by 2002:a17:902:6bca:: with SMTP id m10mr399039plt.210.1599082953805; Wed, 02 Sep 2020 14:42:33 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:32 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 1/9] configure: fixes dtc not cloned when running msys2 CI Date: Thu, 3 Sep 2020 05:42:03 +0800 Message-Id: <20200902214211.337-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Symlink dtc after git submodule update, because on win32 symlink to non-exist folder are forbidden. Signed-off-by: Yonggang Luo --- configure | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 8a3acef89d..30f8c4db29 100755 --- a/configure +++ b/configure @@ -2053,9 +2053,6 @@ fi if test "$meson" = git; then git_submodules="${git_submodules} meson" fi -if test "$git_update" = yes; then - (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules") -fi case "$meson" in git | internal) @@ -4261,9 +4258,6 @@ EOF if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then fdt=git mkdir -p dtc - if [ "$pwd_is_source_path" != "y" ] ; then - symlink "$source_path/dtc/Makefile" "dtc/Makefile" - fi fdt_cflags="-I${source_path}/dtc/libfdt" fdt_ldflags="-L$PWD/dtc/libfdt" fdt_libs="$fdt_libs" @@ -6593,6 +6587,16 @@ if test "$cpu" = "s390x" ; then fi fi +if test $git_update = 'yes' ; then + (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules") + + if test "$fdt" = "git" ; then + if [ "$pwd_is_source_path" != "y" ] ; then + symlink "$source_path/dtc/Makefile" "dtc/Makefile" + fi + fi +fi + # Check that the C++ compiler exists and works with the C compiler. # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. if has $cxx; then From patchwork Wed Sep 2 21:42:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8551722 for ; Wed, 2 Sep 2020 21:44:50 +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 8B4E6207EA for ; Wed, 2 Sep 2020 21:44:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UhzYLV5v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B4E6207EA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:43724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaYj-0001nd-Px for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWe-0006BS-20 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:40 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:43182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWc-0001QT-8J for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:39 -0400 Received: by mail-pf1-x42e.google.com with SMTP id f18so437309pfa.10 for ; Wed, 02 Sep 2020 14:42:37 -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=gXdMGjV38SOiNDEgk4FsmaPwx8AV6p28A6aPTTIcZkk=; b=UhzYLV5vWPiSvSsh9YGdpVHOF5mjM19qoZL0dwmXISwV0dJnNiFd/ot3bqmtW8QIUO cmAfIfPZC9vxR3rht5lZo0tFHkMTsvjFhbPYI0P26PFZKqhude0XpqOwYW0KHAkr+3OC 3my8YMKsAkasmyIq79zu930gHNMkfaMP0k9McZ6gZBpzgqLPcFWzNmn+hQk0QPDh/8rM uczjIPg6fgiUPAqcKNVRzkpqYI/16BZP+YHXE3yIzyVQanfOnah5S01ZB99ku2b9GW9J NguLKkz940mPHJ6P3Arhw24W5N5cJuKerNnbd1YF2ZCkOi0i0iDM0uHdjjjWNd4svm7T 28Mw== 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=gXdMGjV38SOiNDEgk4FsmaPwx8AV6p28A6aPTTIcZkk=; b=WC+TOAQmtQArj8PnSYKGySazankiuBLNLglNjez2Z8Pc1sk+mU4aAiozHeWC5MYLr2 MHvOIERCgbmEU6GD1bkEaJZtDPtBBsBAklNNRYCCNFAHec7lDTMdtx8G4iahTUNlpd5O 5kcsZgEpr65k/Oe1IN+fFdVI5PNjvga81pjwzk8NiG8qxJvTcu0l/XTZE0/MvqQzzPmq i+OHzMqZ6wlR2cYprb5/ZUG8YNfdFFOWwmBquOBmkfqHAwyYleA+BYU3G4JYAF1dQIyh 3MXXPSGwPHYHAdJxFGZ1QbfbgkLpvltIjDXzIKbCdFTwa/6e3xDhZUOlxtc0YOabyUUI Pmkg== X-Gm-Message-State: AOAM532TNwVBRHaJNgT9Kaa9aqqW0eDeRDHLmlTSMCeX55A76MzhTtCJ qD4gUDro8N/YIvFsTrMPKpQSp1nZPpJoNA== X-Google-Smtp-Source: ABdhPJznp2r7Twd6gr2KvHb0Q0Yoc+VuN3M6q2QLlF0sqS1iQEBFRVZDJHkBFnHmFhcNvEE+2HvlQw== X-Received: by 2002:a17:902:a607:: with SMTP id u7mr383155plq.45.1599082956285; Wed, 02 Sep 2020 14:42:36 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:35 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 2/9] meson: Convert undefsym.sh to undefsym.py Date: Thu, 3 Sep 2020 05:42:04 +0800 Message-Id: <20200902214211.337-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42e.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+patchwork-qemu-devel=patchwork.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 Wed Sep 2 21:42:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751845 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A0BA722 for ; Wed, 2 Sep 2020 21:43:51 +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 1CFD3207EA for ; Wed, 2 Sep 2020 21:43:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F2ZYtaPK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CFD3207EA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaXm-0007qY-7Q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:43:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWg-0006F2-17 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:42 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:35984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWe-0001Re-BQ for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:41 -0400 Received: by mail-pf1-x443.google.com with SMTP id m8so462793pfh.3 for ; Wed, 02 Sep 2020 14:42:39 -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=E3tqAQ40jh0sPTD1d9xIkZ9WYrXugWo7nhLWb57uF6Q=; b=F2ZYtaPKfe71R5Q+FDdXjkZ419FMcAJOOoG3iog8RmhaJYP8FzXdw295a2KG0kTXYB Rwb4W1cTab8rQtKomzZbuzfSkzVd4I7ia7GEKZEmPVLAjcGWfJdeydyR07r0cOplDDUV rxgALDJ+SP42d0M9ZraHgb4JZkLg/9VTJ/fqSxy266pgcoErP0PhYEe92Mim/zWntnlq +VGD2QXH/nj2jCX1+M5JqVMYn5v9eN/FQfX6CRx6IofMyNaV1SPIZgCH3JVi1OvsuTAj EBIfsbl82NUm+uDz9QiKhsvldawVjuhhIIW3yiFCmEbQCwM5fLAwqjOU880DqrLpgV2P 8Mrw== 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=E3tqAQ40jh0sPTD1d9xIkZ9WYrXugWo7nhLWb57uF6Q=; b=k26svJNNAPYgqEYjy6fx+vcqnUf+yADOacrsLmIcw/Kvxk7cI8FHepiid17klxPhFJ JkNtnt0h4XS/duB0eFoI3z5PP41xLImIMKtXdBikkIIR38gYLJFSp4ovexWBXLmu1AOl YaE40j72dTE8dmGud7vWbdGiZDvPNtuNAm4Oj4ZsqaGu5oqENN6fdy1omHSbZheI7Dmh Ryy4ri9AG5vQ/v7RuB//bZ0pDrzFQgW7yt3xMlSztLVyiJZsd4dplKXIa8lvYCwfB/ed oOv4DGoWFqFmsNeqpZeqyLrarOV8mrwQ30rzfOcq3MknJKV3ZQvaHTmVGy0JML/BIV+C ccdA== X-Gm-Message-State: AOAM532WMPEg6L3xesaX86fZmnMaH9y78aG4S+18vRGSNp/ho0+xWIRe 1jd01YwY9vorZXYBcO9FLaGE0jD0agCqgg== X-Google-Smtp-Source: ABdhPJyo8EgX7CfA3fvUTPDu9UJBCFaadXXz1uASrLT7g36HFfKeyy8WXER3GscAE4eJI2TuxMo/jw== X-Received: by 2002:a62:4e49:: with SMTP id c70mr447626pfb.100.1599082958535; Wed, 02 Sep 2020 14:42:38 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:37 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 3/9] tcg: Fixes dup_const link error Date: Thu, 3 Sep 2020 05:42:05 +0800 Message-Id: <20200902214211.337-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x443.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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Rename function dup_const to dup_const_eval for avoid confliction with macro dup_const The link error on msys2 Linking target qemu-system-alpha.exe C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: libqemu-alpha-softmmu.fa.p/tcg_optimize.c.obj: in function `tcg_optimize': E:\CI-Cor-Ready\xemu\qemu-build/../qemu.org/tcg/optimize.c:1106: undefined reference to `dup_const' C:/CI-Tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: libqemu-alpha-softmmu.fa.p/tcg_tcg-op-vec.c.obj: in function `tcg_gen_dupi_vec': E:\CI-Cor-Ready\xemu\qemu-build/../qemu.org/tcg/tcg-op-vec.c:283: undefined reference to `dup_const' collect2.exe: error: ld returned 1 exit status Signed-off-by: Yonggang Luo --- include/tcg/tcg.h | 6 +++--- tcg/tcg-op-gvec.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 53ce94c2c5..7f6fe8454b 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1251,15 +1251,15 @@ static inline int tcg_can_emit_vec_op(TCGOpcode o, TCGType t, unsigned ve) void tcg_expand_vec_op(TCGOpcode, TCGType, unsigned, TCGArg, ...); /* Replicate a constant C accoring to the log2 of the element size. */ -uint64_t dup_const(unsigned vece, uint64_t c); +uint64_t dup_const_eval(unsigned vece, uint64_t c); #define dup_const(VECE, C) \ (__builtin_constant_p(VECE) \ ? ( (VECE) == MO_8 ? 0x0101010101010101ull * (uint8_t)(C) \ : (VECE) == MO_16 ? 0x0001000100010001ull * (uint16_t)(C) \ : (VECE) == MO_32 ? 0x0000000100000001ull * (uint32_t)(C) \ - : dup_const(VECE, C)) \ - : dup_const(VECE, C)) + : dup_const_eval(VECE, C)) \ + : dup_const_eval(VECE, C)) /* diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 3707c0effb..cbb6cd04bc 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -359,7 +359,7 @@ static inline bool check_size_impl(uint32_t oprsz, uint32_t lnsz) static void expand_clr(uint32_t dofs, uint32_t maxsz); /* Duplicate C as per VECE. */ -uint64_t (dup_const)(unsigned vece, uint64_t c) +uint64_t dup_const_eval(unsigned vece, uint64_t c) { switch (vece) { case MO_8: From patchwork Wed Sep 2 21:42:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9357E138A for ; Wed, 2 Sep 2020 21:44:54 +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 675AA207EA for ; Wed, 2 Sep 2020 21:44:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nsZFW+6N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 675AA207EA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:43986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaYn-0001u5-Gs for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:44:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWi-0006IQ-DP for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:44 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:36416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWg-0001Rp-VL for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:44 -0400 Received: by mail-pj1-x1044.google.com with SMTP id q1so431403pjd.1 for ; Wed, 02 Sep 2020 14:42:42 -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=u7amQF5+q+U5pyEjmTJks994NcpROaetfXoezQ8sulo=; b=nsZFW+6NFvhRxDTCR9w4RsQMRNpjqR1B9WX+0jsI3LocbOeVvJKET9cPCUjpgzo6mI ar+zzLbrEgyFSWcBnBdgxrq4Mrpe0l1ytMVIW8oLM2Y2gmltIRosG6mtv0KgwwPcj3tm jGmSQbRVTbBf1r4k2/zbcE5dgcwYgtzoNXGCy3Kb+8dYXUDpYklmI+hbaLAi+UlBvG6i BAHhkgtVdPWERuYmoqiPMRNXAeCMMhV4c1rUGHFMZeI2pD+r5XScGrZDoprFnzmcMUoF p4ssAW0iZykc6Yr+yjVOlciYlijFIGQjYeG6TWBOItWOGXzfeZvIPZHdSZq3OZfje5AK i5aA== 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=u7amQF5+q+U5pyEjmTJks994NcpROaetfXoezQ8sulo=; b=OLKy62LfZPBmYD/LD3+3YLaJufk0o/sQ73LNY27PQ0TDxqHXNhThH4/+jmktNUDCi/ UX7KhnqZzJtk6C7US3H5Otvl4ACFDZtq8eP+0/Ri85vyrdvtyNRMzaFMYt7BCHqQIE6t CC2/h7gbQKdMcIbRWM/aDOYu7WIxI7+mrprEjYTksKLCp+zKcwzaXIabPE6Tel/nzzOQ /knmJioL4wLyvYPRpP6iIoJUlm91Chc2xTy95iIa8J72Nmsd0XZmpXVmZq+kJIuFqkBo oBtlE04AHwkV5NXEwDjkv6zOpJwGreGa3kXbWp0Sct3/nHS4oGXERUKqubAzkSyys1Ka 9QKA== X-Gm-Message-State: AOAM531CjOjxCdLVhSyG2iTpdNhgbz7JlT1foYyClYliEE0VK76OjUNq WpYuI1zUDAwv//F3YSGaATDMaBByrt6SQg== X-Google-Smtp-Source: ABdhPJyC1UQu01pFcxLnAH4+34pKid3oy2MW8FqB4/OdeBHE/Gd8y+NKAimT3EMEZ+A4t9pe/1q+4Q== X-Received: by 2002:a17:90a:3948:: with SMTP id n8mr4197824pjf.156.1599082961210; Wed, 02 Sep 2020 14:42:41 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:40 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 4/9] tests: handling signal on win32 properly Date: Thu, 3 Sep 2020 05:42:06 +0800 Message-Id: <20200902214211.337-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" SIGABRT should use signal(SIGABRT, sigabrt_handler) to handle on win32 The error: E:/CI-Cor-Ready/xemu/qemu.org/tests/test-replication.c:559:33: error: invalid use of undefined type 'struct sigaction' 559 | sigact = (struct sigaction) { | ^ Signed-off-by: Yonggang Luo --- tests/test-replication.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-replication.c b/tests/test-replication.c index e0b03dafc2..9ab3666a90 100644 --- a/tests/test-replication.c +++ b/tests/test-replication.c @@ -554,6 +554,9 @@ static void sigabrt_handler(int signo) static void setup_sigabrt_handler(void) { +#ifdef _WIN32 + signal(SIGABRT, sigabrt_handler); +#else struct sigaction sigact; sigact = (struct sigaction) { @@ -562,6 +565,7 @@ static void setup_sigabrt_handler(void) }; sigemptyset(&sigact.sa_mask); sigaction(SIGABRT, &sigact, NULL); +#endif } int main(int argc, char **argv) From patchwork Wed Sep 2 21:42:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C1B113B1 for ; Wed, 2 Sep 2020 21:46:17 +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 D38D420758 for ; Wed, 2 Sep 2020 21:46:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OMlGSe+n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D38D420758 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaa8-0003Zq-16 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:46:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWm-0006Oi-0c for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:48 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:38280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWk-0001Rx-81 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:47 -0400 Received: by mail-pj1-x1041.google.com with SMTP id ls14so424801pjb.3 for ; Wed, 02 Sep 2020 14:42:45 -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=iVIr1leFc3liAehHnInLxU7v1tQQv57KF6dosXo9DWU=; b=OMlGSe+n6l3lCttxyiF02zQWDyp7CQs8bEHY7+yUrxvYVnpjoYT3Mi4wwb041qegtz Q/hASb4FXM2WctQYVIYXoa1psrxScKs0y4vmnsUVoAImSwhtwHZ4qlm7h+MZ/3GTEXT+ /bX9Vz++JdGzZsDLPlQ+6dm7wXw1bnSihQmsqB3Wj7ZAIg5jMqVkTnozifslQJ28uTbP mzvigLag4EI1rZs5M48r0KSoIRZcTzSyJjvaYBngQxag/hT38ANZ0Rww8GgBQAufuYDB R82C6gE68txHSIQhNZJf8lzB5eP5PvI28wDnQi+eff/1Je8ws9okjsLW+1soFLZjmAMq bItQ== 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=iVIr1leFc3liAehHnInLxU7v1tQQv57KF6dosXo9DWU=; b=GqW/fR92KKZwF+IKgFTAOh2o+FC0PXWIvy58CZ+DZsDrcHDo3nFrUBZhHUO9o/hAm8 nN4Y2PQcvkv7Dt9rbOZgKLmmwKK4RjjZSdeSBBv5871RiLkQIxmwY//uCH+DT6AZgbG5 ULhtCgwV0HfDNy+ZjhpZbYKs9YpeKNvtTxY73buXVw7j2zY0qzQ0cH46BFu2g8k9ZoVA ooQSyw/TTLwbHaJEZKvjmjsnOu2BbW906vZsVXVAEU834hdmUwCoahDYvHmneClt5UXf oRwv31wnkx126rLaYhEAi/rpG7i2Pkpc8aq7vYCP+O9I10AQ7B0vXan7ivzqUhF2pzyA o36g== X-Gm-Message-State: AOAM530xmrbbpERox/wnb1wzDQHcYF6sMPrfUd2bk/KSq3dV0L7gocHp PA4vQsVHmMRDWj5Gy1hg9xaxCTz98QmLMQ== X-Google-Smtp-Source: ABdhPJzNjCVtOruU/mcE7TemMbS1qRqDbin/8te9VJRw0yMm9mRvIDTeXVwSR07JfzdxtPjad6I3ig== X-Received: by 2002:a17:90a:5295:: with SMTP id w21mr2255088pjh.45.1599082963883; Wed, 02 Sep 2020 14:42:43 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:43 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 5/9] configure: Fix include and linkage issue on msys2 Date: Thu, 3 Sep 2020 05:42:07 +0800 Message-Id: <20200902214211.337-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1041.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+patchwork-qemu-devel=patchwork.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 Wed Sep 2 21:42:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E878138A for ; Wed, 2 Sep 2020 21:46:21 +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 E44AD20758 for ; Wed, 2 Sep 2020 21:46:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hW6cBlfc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E44AD20758 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaaC-0003fW-3I for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:46:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWn-0006QF-Rv for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:49 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:51354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWm-0001S3-2g for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:49 -0400 Received: by mail-pj1-x1044.google.com with SMTP id ds1so443394pjb.1 for ; Wed, 02 Sep 2020 14:42:47 -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=GpJDUB+NTOpYLTsODXQZZlUf4Fh9xeN4S0uES7H+cp0=; b=hW6cBlfcSLSMGdfxFovxzmlmzEtNMgB6i0hLH37Z9VaOnXYYkBe5TRFazscS/QxL6g MHC7xG6CHPPdf9h3A8rYR9+l7rbDIt8GoNokSTU8cQgoSOjki87AQ7UTXNommOWmyZYy AguT5jbx+Y1VGYihpQZZflP3/i78tJP3Dal46I5eylcfhgCxZZdPvZYsPz+D03CX3SQ7 svVDTgcUn0uVo9ePKaVRwGvOP1xIcWXmxbzD2+N27AkgK436nsUZafZLwf7uW4bIeBtW jFjXczr3AWhWABtwZXZcuSzYo4zi32qs2a/9QhvS80KcQ9bb1alqJs1yaIpCk9ickRs6 CRCw== 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=GpJDUB+NTOpYLTsODXQZZlUf4Fh9xeN4S0uES7H+cp0=; b=iJhdlHWvkFygQo4qUGl/MBbLLq5O8/cEW9Cg/MSfuUf3k8pp7J2f4you7f2YCYCQAt i4HhA+aS3ck8KoAUxxJqMzMYfOw+0iAteRagLXzhRL2S267FbWyDYu1+bVjhgWURHrgU 6eBkuGnIf4i1BkZia2ws0KpqDAkvmZS8UrhyuH+G3S7tlevGuAepV6TOOQjt7vvOnSuV m929JFr6OdoW/j2t/gUh+lb/XAkSflt3tdM9vBOC3HPIugTtQH2Y17Nik+MeI/eNnKfB Y28qORfEUS/C4qe5mRI1C6EQeFhC4qEsxgWLvp+fdNCkI4hpEIQOYqjkydZVcyDJy0Wu ipgA== X-Gm-Message-State: AOAM531HLMDIw+1T7MPWJPIX3CQlPze4iVkyoaxU64EwTqRQ5ljaLzyw VK9uOX/+J9qxzyMJ+s8pI0qiOHJPQv5aVA== X-Google-Smtp-Source: ABdhPJxBcWfRaet6odgvDP77F9rPuTSW2I9k3RJl4qWhhcPRWUtqZIoLewZWNYRw69TVeuyLHHw/JQ== X-Received: by 2002:a17:90b:1988:: with SMTP id mv8mr4042914pjb.23.1599082966242; Wed, 02 Sep 2020 14:42:46 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:45 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 6/9] block: Fixes nfs on msys2/mingw Date: Thu, 3 Sep 2020 05:42:08 +0800 Message-Id: <20200902214211.337-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1044.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+patchwork-qemu-devel=patchwork.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 Wed Sep 2 21:42:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF8EF138A for ; Wed, 2 Sep 2020 21:43:56 +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 C1361207EA for ; Wed, 2 Sep 2020 21:43:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BZYAkrIt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1361207EA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:38396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaXr-000878-SQ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:43:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWr-0006TR-6E for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:53 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:38287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWo-0001SH-Jz for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:52 -0400 Received: by mail-pf1-x434.google.com with SMTP id d22so452787pfn.5 for ; Wed, 02 Sep 2020 14:42:50 -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=ytnCKH3zjpA9j+WbW1oeATTOhg+ZlkmXF4eIToZEPdI=; b=BZYAkrIt3VKBXbFgtmdSPJDa3MjYLicotmA8mYu6CnGNEkXDjr8XhkZHI6I9/PkQsq YQycG5RAMaA/HmIlREWYPWl4KIRjo8Bsi75BTQu8ikx8K2JntTDGZCLD1+3Fzp/7JaPK YjPwKeXd5Y/bCSgfKQSsdik5Ap8x2SexHcqctsYOaiEBYudtDsyQ5Kl0ERsL6OVz85ch f8myIUc7mokb6cK4JmvNsyiJIHJPp1Nv8K7ZmIajeaWvqN4fYmUNnsM30hCuDyi7ixcx u8igzvEtv2XCYIOQepN93RdvCF20M6bNzoIdo29CduJYGNa+d+2NjbHmoG9G85RPuzaa G4cQ== 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=ytnCKH3zjpA9j+WbW1oeATTOhg+ZlkmXF4eIToZEPdI=; b=FmAVQpBklOFJwCU3oPDkSYDoYWozGdxlJDexLbcHB7sYE2N481qFBlzTkUfyweW8WX Mi9WnB8q74gjp0IDC/Tjr2uuK1hnG2naGWaw+ORuBBcKRPK+UgB/6eL+MVn2Jy1MlymP zcyc27eEXdT5Ra8X58yjx+U5PxHd9j335J61XzasHt4rowy3z6Ch+CCnc9cRaO4mJ+s0 HQcfMIu9jeGWhzHwyEUeu3OpUevEID/6PW0+VG5n/xYuFYBRewnzgVcqq/vsTMveF0oQ x7sFsv88bWPZgZr4ski0C6HuPcupTZ7+jpdpp8mTRvpdSpge4NNrNsdiDAt+iZZH+qd+ VxNw== X-Gm-Message-State: AOAM533f5uMfQnWSzNs6KiK6ih3eGXr3yx9l2bAXbOgrnVUAlFY9TwcA j9XKRDkTQEHefKI8AOUVIZ9plbbFmdk5gg== X-Google-Smtp-Source: ABdhPJxanKvL5oYZx1mpPsdYzX4laWN3nZellftQ/w6H2f/8Nc9gDKJV9J4pZguo1TrME0oKtu7eNw== X-Received: by 2002:a17:902:a412:: with SMTP id p18mr375152plq.3.1599082968646; Wed, 02 Sep 2020 14:42:48 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:47 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 7/9] osdep: These function are only available on Non-Win32 system. Date: Thu, 3 Sep 2020 05:42:09 +0800 Message-Id: <20200902214211.337-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x434.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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); Signed-off-by: Yonggang Luo --- include/qemu/osdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 412962d91a..e80fddd1e8 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -502,11 +502,11 @@ int qemu_close(int fd); int qemu_unlink(const char *name); #ifndef _WIN32 int qemu_dup(int fd); -#endif int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); +#endif #if defined(__HAIKU__) && defined(__i386__) #define FMT_pid "%ld" From patchwork Wed Sep 2 21:42:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84E6F13B1 for ; Wed, 2 Sep 2020 21:47:17 +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 535CE20758 for ; Wed, 2 Sep 2020 21:47:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kLHNaPqV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 535CE20758 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDab6-0004vV-IZ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:47:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWt-0006WG-C9 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:55 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:33269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWr-0001SQ-PO for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:55 -0400 Received: by mail-pf1-x435.google.com with SMTP id u20so472812pfn.0 for ; Wed, 02 Sep 2020 14:42:52 -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=Gc5Ac+SIhTGBbDN48ShDt50S5XEQuese4No18vImHG0=; b=kLHNaPqVC4VDpLVoX+sYDv7RwU+3RPgfnajFdYjiN/cjG0yFuhfh3xpOXBfRALdrNr PeiHSs7Pxmpx1RUTjjQSOh6JvgYsjV0oKZ+M7A29BAZUO0L8LgynMBUALpdchmUVxepJ 3UoyADOKVLjQ+UjFms87GX1OOGMiVNo7j+9rGjmrhhRSSzwER2NVwC+K2Am3UgKbMkUa YLREMon2dzdI0etLz4IhLA+62x+Sl3QAePxSewMnI6gOqVKMaAGZdiUHC3z8s5gS9J4Q 3SKLUFNuhiT8cpMl9b39305+LBimNo2O0Op02S64zdLfgk+FkO691yH06IdmnB7qN12j KSJw== 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=Gc5Ac+SIhTGBbDN48ShDt50S5XEQuese4No18vImHG0=; b=ZInBVnOOTkOITmC7TpKIvHlWfspILOokRnPQ022Blh5A2FyViizXRBR7baojkZUX42 FsE9LwsAHFYQYAYGE24QHtMNnE0sVK7W12L0V4MhGeVPgn/vNSMv054pAfAfbPBco5L0 f+bUTqsoN8FLaG9YDMEbboxGs0hWBWjiZcGR/V4nUmAtFBnICA4YQbZuXyuFhukYFo+g Syl2prkgtusDASAJuxuuQqk3pCSjBL8J8upa8bJjSCtdqRbOjqCsUMOwKGy66WRBW6R2 p+tyOSsp6QrJ8/ebce8AQVdEKB84V0OuNP3L1cirkRCNXkrgIZJ3Ep96bSJ8UYtyqiLy DULQ== X-Gm-Message-State: AOAM531PpJsXEgvFqsEkVsFIOpmcjYVGDZkCz/U8qAWdYyN4UZLyM16u UQDLOeiEAQkJUKR0viWOKbEEHdIwS0hHLw== X-Google-Smtp-Source: ABdhPJyh403W32VjNpM7W+gLHYyf+2WzzoO3E/KJP/QGUKqhzITxi6CmQPfxvDBrYgzHmNeBxRP69A== X-Received: by 2002:a63:5c1a:: with SMTP id q26mr3481252pgb.223.1599082971266; Wed, 02 Sep 2020 14:42:51 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:50 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 8/9] ci: fixes msys2 build by upgrading capstone to 4.0.2 Date: Thu, 3 Sep 2020 05:42:10 +0800 Message-Id: <20200902214211.337-9-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x435.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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Yonggang Luo --- capstone | 2 +- configure | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/capstone b/capstone index 22ead3e0bf..1d23053284 160000 --- a/capstone +++ b/capstone @@ -1 +1 @@ -Subproject commit 22ead3e0bfdb87516656453336160e0a37b066bf +Subproject commit 1d230532840a37ac032c6ab80128238fc930c6c1 diff --git a/configure b/configure index 5f2bcc4b57..e42d210e5f 100755 --- a/configure +++ b/configure @@ -5248,14 +5248,14 @@ case "$capstone" in git_submodules="${git_submodules} capstone" fi mkdir -p capstone - QEMU_CFLAGS="$QEMU_CFLAGS -I${source_path}/capstone/include" + QEMU_CFLAGS="$QEMU_CFLAGS -I${source_path}/capstone/include -I${source_path}/capstone/include/capstone" if test "$mingw32" = "yes"; then LIBCAPSTONE=capstone.lib else LIBCAPSTONE=libcapstone.a fi capstone_libs="-L${build_path}/capstone -lcapstone" - capstone_cflags="-I${source_path}/capstone/include" + capstone_cflags="-I${source_path}/capstone/include -I${source_path}/capstone/include/capstone" ;; system) From patchwork Wed Sep 2 21:42:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751859 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D03413B1 for ; Wed, 2 Sep 2020 21:48:23 +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 1CCED20758 for ; Wed, 2 Sep 2020 21:48:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oSNn4UY2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CCED20758 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDacA-0005nV-2q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 17:48:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDaWw-0006YV-GN for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:58 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:35989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDaWt-0001Sf-EC for qemu-devel@nongnu.org; Wed, 02 Sep 2020 17:42:58 -0400 Received: by mail-pf1-x443.google.com with SMTP id m8so463290pfh.3 for ; Wed, 02 Sep 2020 14:42:54 -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=1e4wyddbJTV3qFeK3B7sjoZJPIgCnUhpxu4JoGcSpW8=; b=oSNn4UY2oXrQI4HM+yci6MghNVBnx6ei+i868xkjJgQnImyIBmmDixYvsm/PQDRNbC po3w1vHn3CB8S0CNzZoTxQ71KE+tsApUiQ+pU5dckiGpFPAuOw6Boptssa/BcYpxpLxL 4OeYayITKjWSsXuW2sSD5iW2+wAMW8FPNo/JZue8iLpoOOijtfxdEPVtYD/7bINwJrVG nxY0mROrmu54kW5hqd/j/fSS/pxb/jEYMnPnLWyw5BJti6+FzsdMA45NncWVQDdcatrP Ax6OfNGSeC1K4p6vcCoqEZ4c2wnd79fhSjd7I6cqeGxnAo0RyLsFwc/gNXt5z3unreIP kqIA== 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=1e4wyddbJTV3qFeK3B7sjoZJPIgCnUhpxu4JoGcSpW8=; b=ZQcmVUvuBSF+OveCAoUEOaVuoL1g8hPqo0l2a1bSyvvHuVTePJ87iOu32DqF164GvF eccXHRukfkot22nSwZB5nsHz+5GhJlj9ogPc6L5w26serbG8HEjZt9Yeunqzb67joqFI IuhjBsCEhjz4W+M0DTcSbTraj2ugrXYLNwSEOgjzNjhoOFpzxM/Pxcwa8xXstNqyX31d KShIlHL+VyTbRabn8a+BPckyfI5aYFZASfKa+3oSAQBOSPkRGNtwUSDvKGuyc/tQPvFT isNt6VIhRuh2RLT4kgjGfWN4zWWs0Vob2PAFBiZezXmybYVEYzEO9/wvcXkMiFSg8Q49 m7WA== X-Gm-Message-State: AOAM531ySgnbMmpX10YeiLDuF1XId5adO8TvtykfNN5bMbwUS5xkk7sq auoXHyntYfF6vimdlFnA7phB5Aev4447xA== X-Google-Smtp-Source: ABdhPJwxUCkNI4Kh8RCRXIaOmxqNv8hBe//tQaBK92pWxMEmdbFvuL4k/9+0nF3wgpwlzwdErbFBNA== X-Received: by 2002:a63:174d:: with SMTP id 13mr3407461pgx.231.1599082973451; Wed, 02 Sep 2020 14:42:53 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm328863pjq.43.2020.09.02.14.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 14:42:52 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 9/9] ci: Enable msys2 ci in cirrus Date: Thu, 3 Sep 2020 05:42:11 +0800 Message-Id: <20200902214211.337-10-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902214211.337-1-luoyonggang@gmail.com> References: <20200902214211.337-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x443.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+patchwork-qemu-devel=patchwork.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 | 23 +++++++++++++++++++ scripts/ci/windows/msys2_build.sh | 34 +++++++++++++++++++++++++++++ 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..d377c28412 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -40,3 +40,26 @@ 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..850baccd49 --- /dev/null +++ b/scripts/ci/windows/msys2_build.sh @@ -0,0 +1,34 @@ +export QEMU_DIR=$PWD +mkdir ../qemu-build +cd ../qemu-build +$QEMU_DIR/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 +