From patchwork Wed Sep 2 17:00:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751397 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 B43AD109B for ; Wed, 2 Sep 2020 17:02:07 +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 88E88207EA for ; Wed, 2 Sep 2020 17:02:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qEZtLshl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88E88207EA 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]:57692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDW98-0001ix-Lu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:02:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8L-0008WN-NB for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:17 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:39299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8J-0000Gt-Pk for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:17 -0400 Received: by mail-pl1-x642.google.com with SMTP id x18so40130pll.6 for ; Wed, 02 Sep 2020 10:01: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=38x0lAOA2AfvsIyHP+ReuB52i8b3LJOhHNpZq8BiwHk=; b=qEZtLshlbaYxYZeA2n1+SfYzq5CEui0yQ8Pqer+EZpYeTt/IGUtC3f4+vEbYdZmuvG WcqHnFQpPfA+EJKdhl6db062f9PVgx8V0XPGrKeIvNOmGnX99/rjpFd3bybtYNBuBQUL pIMAxVgIWpCCnwDls9rKhu0vca7/yimnLhbhpWGvm/+ZAj3o72k5eu8IiAk7pfZ6+18V 1aXcVFIzB9EKU1YspEKe0T8mYER/XbqEtu42G5CTke+5shlIDbcw6KlNwU7x4xkC4JOz YnRclJHjzAIN14OGl4RJN3fqSSWXFeomuwNsn+9RzGz54BUBNJ0IThEo2jSkS7820et0 siyA== 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=sFiPD2FD48gpJJxp88NkTCl89bR9hHSi3uu4DAuPnuAzAFHgOBoWwsME0SXlKaDOvF AM9nwDkytM6CbIdwQWK+KChYBUe3xDWJpzyBQNID+FOIphjffV6e8mQM1zICHwPjJgAN J1biXapJcJc6AF9xhHOyehEh+pepOee7FdKWZn5THIbXAXckWH5Ku0Mnnlx7KF+zS11O qg0tZbcDqrAQiaY6Cpz8d9KDxNBtdUP1qP61wyVtKLXUSOKAeWxsZHzX5bME1odiuI4T jRrgzN+8wf7QY/+CKme4evbbauKePX7tWYqqcwE6jPytTlaZVteSKupvnUeV4JGZ0VFA xGPA== X-Gm-Message-State: AOAM532H+7f59zPVFJuk2Nx1rqQabdp42BdIpioGz4SFT5zbMZ8u/uPw 5PCilrKysN5r5zlw6PU1JrA4LNKsvVI= X-Google-Smtp-Source: ABdhPJzJdvKDp8fqKbceWE4+l/g2etGf7lxfHWl26+9n7bmdUtuefTnn+iofL4QFdFhPWQ4b+uHyLQ== X-Received: by 2002:a17:90a:8d85:: with SMTP id d5mr2849276pjo.45.1599066073897; Wed, 02 Sep 2020 10:01:13 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:13 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 1/6] configure: fixes dtc not cloned when running msys2 CI Date: Thu, 3 Sep 2020 01:00:49 +0800 Message-Id: <20200902170054.810-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x642.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 Reviewed-by: Philippe Mathieu-Daudé --- 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 17:00:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751403 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 75BAC138A for ; Wed, 2 Sep 2020 17:03:19 +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 482FD207EA for ; Wed, 2 Sep 2020 17:03:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uMuBq4Kx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 482FD207EA 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]:35778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDWAI-0004PS-HC for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:03:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8P-0000Ce-DN for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:21 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:53743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8M-0000HT-2g for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:21 -0400 Received: by mail-pj1-x1032.google.com with SMTP id k15so99976pji.3 for ; Wed, 02 Sep 2020 10:01:17 -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=uMuBq4KxTJuXXtE5VTdFDmM5ejiph+4vTByJrfd9GaH8Unb5n+DYqJcugvHg7/EYqq QXXs3+4OqdH61BRTLVS8SimUVf0FrnRUpMSVrBemOCGVOPsqJjpzgUAqi+6capilZO6J Rf2YGEmHF3xvHyvTEP2grZ/I4R7T7omopBcyD3PX+niXsFGzsEaAMtLoZhgCS+VYLQI/ cNK+/6Qy+S+UXOuHCzU2Huf1TNb1LUdVLCq/YE01eNAoayX/0JOAD0Y+qowuPTOuZjQg f0qUlpD1/HagWRAccw+PfQk9Hplls5h3ctt3cx0BEr+CaVkNgiu4vlxgOg/W8tMiPteP FgrQ== 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=RsG1/cBZTPv8z8VD7MHNwA5rWCtFo9aMvDvHbTQ+M2T5Lq9WeJNSqv4JlW9uKKARBV uLXSl5aHE16+hare2wZTFb19i6rABbXxtGwp/g50bWdeVdFM5YktmEqq2VEevPgE6zRo AJAldhRM6GU1joA2XpqyTZ357r3ck09X5ZfMmcGUBY1UVlhd9vNJrWhGiukxcMGyXBFx YPRI3wkp0Jp0TmHaNCPra7Ttq99WgWxdBI0b3dZB9oeRJICboOJ5RNbcR3Lnbkp097LI 7OQsE92qniMMTrmEdljrewnSggWpD1fs/ciICLFxrxAYBrIUBBsHIv0gCtvC2W6XHozm DsDg== X-Gm-Message-State: AOAM531Sr+9ZswHYQl5YEwIXZ9+cufDmP5tw1fDOQOg/lq+7NXgNoO0k jOm9Wz+3mvUP6XvkuZPpKgGpRUHPXUs= X-Google-Smtp-Source: ABdhPJzFrJmSCRQfDLPfyFTlaMpKaq9Vxg9U4sVpM7E/j7wBPsORXwhDBfXtmYH52VG5ZGwpnexiYQ== X-Received: by 2002:a17:90a:29a3:: with SMTP id h32mr874950pjd.135.1599066076175; Wed, 02 Sep 2020 10:01:16 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:15 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 2/6] meson: Convert undefsym.sh to undefsym.py Date: Thu, 3 Sep 2020 01:00:50 +0800 Message-Id: <20200902170054.810-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1032.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 17:00:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751399 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 549CC138A for ; Wed, 2 Sep 2020 17:02: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 2813E2067C for ; Wed, 2 Sep 2020 17:02:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rvkRQQvn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2813E2067C 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]:58290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDW9E-0001yB-8J for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:02:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8Q-0000Ew-Db for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:22 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:42994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8O-0000I3-BS for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:22 -0400 Received: by mail-pl1-x643.google.com with SMTP id j11so31339plk.9 for ; Wed, 02 Sep 2020 10:01:19 -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=gZugdAc0YYQQQMUJH814Yqj9KG0APjmY2BrDJE6YAjA=; b=rvkRQQvnFKYlB9Fk9yNrnqjpzSTP7BNzoPCS7ACQ1zsJigcJytrv4b9rBkKsPRUD2+ 1tsZR9dfiKMnC1FVyJyTAzJVHH6oQsl3epmNZIxSkvL1aIMT4AZWPBniRVIhy1CgP/s6 6N9QO0U84pHwkBSASHBXtk/TWM9LVrrIfZ0zzy9aIjhMGj6r7+zqNzOKPD0hXHN+21f6 vjQmCS3LCBPmYKxlYUtgGomE0cuhI6q5+9SluMxlIhwppPDoofFBojyhz+ED1D/ge2Io oJMHjWJknPaAwOkkaUNhrI9LQrhVFZC7NHCPBNFVug3f2UJGoi7EC8pFY+u+/a2CO96+ XlnA== 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=gZugdAc0YYQQQMUJH814Yqj9KG0APjmY2BrDJE6YAjA=; b=pI7nFviyhvwNbptTWTbiFPplu2heBU0PRCuY335vHhQuDpVZ0xtOJ4RvBoM32BHLMo 1Nk5QehcPiHNeEnZXhwPm4lMgDO0/ceeJ7VEGmR6UV2IQl+JNOCktXysVSvE/yYctz/a 8QA3Uo5ntZSxAge70gEkHMsosQkKTFFv0zmVcspdwC6oRw4eJKM9gwL0933+rXM8M5M1 7F6CB/2Hf4cSQZ2iVAPavE0QNGfW+PiayDLlXRq18fnq8Q3OsgVC7m4VIIfyMrdhy3Nc +11aLy1/pKf3eng/sDjrxDxftl87ncW69aals0Pd+C14jqpn7v6KkNuelwhIgql2dCjq Urnw== X-Gm-Message-State: AOAM530ldhCI54zIm+48XdzmBDSP2d4Z//lSvcR+hLZeFcjN1Zj7RseK CxO2tOUYlxPCtVCFybOGfJOFby3Ny94= X-Google-Smtp-Source: ABdhPJyQaWqgXwZIJUlgmFK8GZFOYxD6y4pov31ZKOfQ5JGByy8/1rKhOZP0s13INLg5aef+VHvpMA== X-Received: by 2002:a17:90b:88d:: with SMTP id bj13mr2981044pjb.80.1599066078441; Wed, 02 Sep 2020 10:01:18 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:17 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 3/6] ci: Install msys2 in a proper way refer to https://github.com/cirruslabs/cirrus-ci-docs/issues/699 Enable msys2 ci in cirrus Date: Thu, 3 Sep 2020 01:00:51 +0800 Message-Id: <20200902170054.810-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x643.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" --- .cirrus.yml | 23 ++++++++++++++++ scripts/ci/windows/msys2_build.sh | 35 ++++++++++++++++++++++++ scripts/ci/windows/msys2_install.sh | 41 +++++++++++++++++++++++++++++ 3 files changed, 99 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..0363ef402a --- /dev/null +++ b/scripts/ci/windows/msys2_build.sh @@ -0,0 +1,35 @@ +export QEMU_DIR=$PWD +mkdir ../qemu-build +cd ../qemu-build +$QEMU_DIR/configure \ + --python=python3 \ + --cross-prefix=x86_64-w64-mingw32- \ + --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 \ + --disable-libnfs \ + --enable-libssh \ + --disable-pie +make -j$NUMBER_OF_PROCESSORS +# make -j$NUMBER_OF_PROCESSORS check diff --git a/scripts/ci/windows/msys2_install.sh b/scripts/ci/windows/msys2_install.sh new file mode 100644 index 0000000000..3a5392cd99 --- /dev/null +++ b/scripts/ci/windows/msys2_install.sh @@ -0,0 +1,41 @@ +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 + +cd /mingw64/bin +cp x86_64-w64-mingw32-gcc-ar.exe x86_64-w64-mingw32-ar.exe +cp x86_64-w64-mingw32-gcc-ranlib.exe x86_64-w64-mingw32-ranlib.exe +cp x86_64-w64-mingw32-gcc-nm.exe x86_64-w64-mingw32-nm.exe +cp windres.exe x86_64-w64-mingw32-windres.exe +cp strip.exe x86_64-w64-mingw32-strip.exe +cp objcopy.exe x86_64-w64-mingw32-objcopy.exe +cp ld x86_64-w64-mingw32-ld.exe +cp as x86_64-w64-mingw32-as.exe +cp sdl2-config x86_64-w64-mingw32-sdl2-config From patchwork Wed Sep 2 17:00:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751405 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 842AF138A for ; Wed, 2 Sep 2020 17:03:25 +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 582612067C for ; Wed, 2 Sep 2020 17:03:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MYpzGK9K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 582612067C 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]:36170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDWAO-0004ZS-I7 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:03:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8W-0000Si-LI for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:28 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:41295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8U-0000Il-M9 for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:28 -0400 Received: by mail-pg1-x541.google.com with SMTP id w186so2837221pgb.8 for ; Wed, 02 Sep 2020 10:01:26 -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=MYpzGK9KlMiUrXXFF850wn8h65J7d8mGHdjaCNe9s6Z3umbJDiz5FKpa9albrVTQZJ TjLYEbUcziIIRoY9B9KMAXMN5BzxD4BHa8S4d17NcR+S34esqStWL+gDdcLbgSCOhor3 fce9twXlIILn18nyByZ+0wzaS/2p8+oU1O3xekBlkDOYkPhOn5ZrclK+e/EOThk0RB5A LXU8fScQa7kjwuSYxISbUoJxvYAzuMigiSLSMuXhPrHqu99vCiyvn7xnIfMijHRzCqBH tjp57A+03oc8q4V+JzpsNtSd/PMBeSOqHX1DcX+Qwr2zajRykN8OOBzh3rX4WJ9+tkPD B9DQ== 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=Qiqos/0pC4SeoQnCT1c8G3HZxsKQ9Q8VitSoy9FXJ6VkPYD1M+U44pI+o5V+XjhnSg Ja6uR19fmr3bmIu2zoIf6gWCjnQ6ESOLl6SrVAKXwOXPsXcTuE/1DDu8ziKL30NWOeiK Mi6qha52K1ydajJUJUgFPYmhho7oHiTblY3mnxzMP7/q0z7cI9S9lipFhaa7OivjjSRA aDQw9cWLLuCzg250ohmLDuI2VgASDYWPR4nwkr1MQ5RmlVBiob0dLIcCinskRQsr6wVO p60ecS3SROKrxZw6i0vyWG51y0l8TUxQuJx5UI07RUubgvh7Ln37IHfaoF2ZTQM+3v6r mYuQ== X-Gm-Message-State: AOAM530mh56lzxKfW+qAAxog/xg1MFojQyuz0UkobRNPKsqviVH3Cx5N wH4yQyhuAW2frIdS7gIgcjrtNqqSHRI= X-Google-Smtp-Source: ABdhPJw/nrFFE2q++6Z+N+Bkp6OL8Li2KvrhrfpqIcZQNu6pFURuIWQTh7jdlku6MPOnmv20zWe1LQ== X-Received: by 2002:a62:2e81:: with SMTP id u123mr3968934pfu.304.1599066080665; Wed, 02 Sep 2020 10:01:20 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:19 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 4/6] tcg: Fixes dup_const link error Date: Thu, 3 Sep 2020 01:00:52 +0800 Message-Id: <20200902170054.810-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x541.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 17:00:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751411 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 37D1A138A for ; Wed, 2 Sep 2020 17:04:44 +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 0B6A32067C for ; Wed, 2 Sep 2020 17:04:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bp3QDYZk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B6A32067C 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]:41608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDWBf-0006tr-6f for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8V-0000Ri-VR for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:28 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:42650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8S-0000IY-SL for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:27 -0400 Received: by mail-pf1-x443.google.com with SMTP id 17so3167908pfw.9 for ; Wed, 02 Sep 2020 10:01: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=u7amQF5+q+U5pyEjmTJks994NcpROaetfXoezQ8sulo=; b=Bp3QDYZkDWAFIC5efp20wcNZ+OgfGQ8P6EY3Hoz+xXikKTAMZO2J7LziiCEVW6BQy1 QABQXpmxofN0ykvY0yQo5mvklix0N0jZGpibP6I4I/UqikUtWGLCnPIPEoyR7QA2CT3G FbaEoTjRBSs2wdnaFq90i8ugkeUMKwX73KYhuuKNhRYFufEzk30s5R5rOwfQZHDHHPvx iJTQWgaDJn04pZvR3JaRGcULBbA/IA3etfDFTp5A59l1O2+uYgmYFhOf0M/RhljOaRBR qlmc7d6eroHTeNCIOpx9ys8oUc4khV6giEeE51XNVW1xyuvy1lDA7R5Lrf9zzaLslNbd TYvQ== 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=APl3rSNKUcEJrD99Ko10QEIDAXMyo28S0xETVUvMUaatVZD0iKTuQ52zp1RfQT/D4I Z1GLSNcdgurbpkleb5v7h5q7Z18Ob9Xs2EljwX/KEvwM71onHlcOfJcSS+yq1mKKYI8k 3tswgCS/SAsocsiMYrZFEEv/H/poIe5rOt1IUPNteILE7mkTS2wjSHHh+VIyOsE5YfSl 75g1LBVxxT06+TMEkqyW71rEUMHxRsb+2YlZ9nCqCMfrjxCFPpX8sZVvLIxcC3g9pFq9 aRyqEQEm0Ytl5A8b8O4Yer65dphRTcT4s2GVjiau5lAxAbbYe103BIcE5IQJttKDkOHK g9oA== X-Gm-Message-State: AOAM533rl9sMh9BcZcNfz9yZwwEpSfbQZXDVVew1cnq0iyJzLU93HUC2 NLyEgf+sFuHmgJeg1YPatXmzpJ0FE/E= X-Google-Smtp-Source: ABdhPJxDw9pl3N5Wby6b52DGngWNm9jBMjySuqs/jE0KWAavhEBacW6L0LsxEeFbbuYH6u4Sgn2+Qg== X-Received: by 2002:a65:4689:: with SMTP id h9mr2566983pgr.50.1599066082825; Wed, 02 Sep 2020 10:01:22 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:22 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 5/6] tests: handling signal on win32 properly Date: Thu, 3 Sep 2020 01:00:53 +0800 Message-Id: <20200902170054.810-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-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" 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 17:00:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11751413 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 0B55B161F for ; Wed, 2 Sep 2020 17:06:27 +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 CE70920709 for ; Wed, 2 Sep 2020 17:06:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e0wloF29" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE70920709 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]:47658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDWDJ-0001T5-R6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 02 Sep 2020 13:06:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDW8X-0000Th-3W for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:29 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:45402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDW8U-0000Ip-Vj for qemu-devel@nongnu.org; Wed, 02 Sep 2020 13:01:28 -0400 Received: by mail-pg1-x541.google.com with SMTP id 67so2830529pgd.12 for ; Wed, 02 Sep 2020 10:01:26 -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=e0wloF29eJMTj3wTueKCAESHD4nyDOm/YMY6FtpSl1xIwHFNTzqJ0X/hZysx9OKSEz 19YkfMWoJMO2Hesn4Jp+mYpZxYO09nqM+FoOjh5hFWWBIujZwx0JvkseQceEBOoHZepk AWPOFGqgVHnY9g8NHm9R+IXUpcvk5jhB5DDzeboQHYH0MDWdCP8XGEnzsE0PSROMj7e+ 0pU4uoGtGBHMaDOHTFOhFg/xGUWYvE2odwLKCAaRgaJCyS2+MHUZ+AWnmNkA4L01LeJC 7Ktk4pBbmIb9l3d/ICkUP3PE4aOWGqVio71QuuMPpGc8oir7It2voWsek1W1VfVYvWc4 +xNA== 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=UwnqWeYFafoWR+h3J/um32q/rxGmBF1XU6121P6GwExQOIX066DStbDJFiLzTC+n2/ 3B2vybYybXxwEmOXxEbgWWJ8LcGxPIwQVVlzuT+7QbiK+bFoII8gse0xSSQxLo1VfT8K JBQVzPEazxApm4Lrcgeyqb5Q76WqtNfTZfMkyB7gb8ictDeKC69fZrY7xo2bmSgVD3DB Pqk/rwQu4YhVEw2mVYp6Q8Ae0j5tJSg/uOBAYMV9OSTe8UgLZg76WTRWddBESFVS2gR4 oSb0HD++a05+R2eg0/qmVw/iujA1wrlGpk6EWstA7ccB6anvS03gcVqpQy6HnBd24nI+ wweg== X-Gm-Message-State: AOAM533JR3sEPtdXN96f6uOQlWuZlgBJgIRFo2aHSO056FVpW6BjGwTW cZLag2esZZpBmZB9Y+7xEyWUJiQ0ft8= X-Google-Smtp-Source: ABdhPJwN5f03lmx6uJjRtRqfTuaSqQI02+hKhCoz1pUPpnIXzm6IQG20poKABb3CfPZk49GDOAuSMw== X-Received: by 2002:a63:fa45:: with SMTP id g5mr2546012pgk.448.1599066085048; Wed, 02 Sep 2020 10:01:25 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x4sm40527pfm.86.2020.09.02.10.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 10:01:24 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH 6/6] configure: Fix include and linkage issue on msys2 Date: Thu, 3 Sep 2020 01:00:54 +0800 Message-Id: <20200902170054.810-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200902170054.810-1-luoyonggang@gmail.com> References: <20200902170054.810-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::541; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x541.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"