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: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F6DCC433E7 for ; Wed, 2 Sep 2020 21:44:59 +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 C9232207EA for ; Wed, 2 Sep 2020 21:44:58 +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 C9232207EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaYs-0001nd-0c for qemu-devel@archiver.kernel.org; Wed, 02 Sep 2020 17:44:58 -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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" undefsym.sh are not msys2 compatible, convert it to python script Signed-off-by: Yonggang Luo --- meson.build | 2 +- scripts/undefsym.py | 57 +++++++++++++++++++++++++++++++++++++++++++++ scripts/undefsym.sh | 20 ---------------- 3 files changed, 58 insertions(+), 21 deletions(-) create mode 100644 scripts/undefsym.py delete mode 100755 scripts/undefsym.sh diff --git a/meson.build b/meson.build index 55c7d2318c..c9f5d05664 100644 --- a/meson.build +++ b/meson.build @@ -863,7 +863,7 @@ foreach d, list : modules endforeach nm = find_program('nm') -undefsym = find_program('scripts/undefsym.sh') +undefsym = find_program('scripts/undefsym.py') block_syms = custom_target('block.syms', output: 'block.syms', input: [libqemuutil, block_mods], capture: true, diff --git a/scripts/undefsym.py b/scripts/undefsym.py new file mode 100644 index 0000000000..c690f88c7a --- /dev/null +++ b/scripts/undefsym.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Before a shared module's DSO is produced, a static library is built for it +# and passed to this script. The script generates -Wl,-u options to force +# the inclusion of symbol from libqemuutil.a if the shared modules need them, +# This is necessary because the modules may use functions not needed by the +# executable itself, which would cause the function to not be linked in. +# Then the DSO loading would fail because of the missing symbol. + + +""" +Compare the static library with the shared module for compute the symbol duplication +""" + +import sys +import subprocess + +def filter_lines_set(stdout, is_static = True): + linesSet = set() + for line in stdout.splitlines(): + tokens = line.split(b' ') + if len(tokens) >= 1: + if len(tokens) > 1: + if is_static and tokens[1] == b'U': + continue + if not is_static and tokens[1] != b'U': + continue + new_line = b'-Wl,-u,' + tokens[0] + if not new_line in linesSet: + linesSet.add(new_line) + return linesSet + +def main(args): + if len(args) <= 3: + sys.exit(0) + + nm = args[1] + staticlib = args[2] + pc = subprocess.run([nm, "-P", "-g", staticlib], stdout=subprocess.PIPE) + if pc.returncode != 0: + sys.exit(-1) + lines_set_left = filter_lines_set(pc.stdout) + + shared_modules = args[3:] + pc = subprocess.run([nm, "-P", "-g"] + shared_modules, stdout=subprocess.PIPE) + if pc.returncode != 0: + sys.exit(-1) + lines_set_right = filter_lines_set(pc.stdout, False) + lines = [] + for line in sorted(list(lines_set_right)): + if line in lines_set_left: + lines.append(line) + sys.stdout.write(b'\n'.join(lines).decode()) + +if __name__ == "__main__": + main(sys.argv) diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh deleted file mode 100755 index b9ec332e95..0000000000 --- a/scripts/undefsym.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env bash - -# Before a shared module's DSO is produced, a static library is built for it -# and passed to this script. The script generates -Wl,-u options to force -# the inclusion of symbol from libqemuutil.a if the shared modules need them, -# This is necessary because the modules may use functions not needed by the -# executable itself, which would cause the function to not be linked in. -# Then the DSO loading would fail because of the missing symbol. - -if test $# -le 2; then - exit 0 -fi - -NM=$1 -staticlib=$2 -shift 2 -# Find symbols defined in static libraries and undefined in shared modules -comm -12 \ - <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \ - <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u) From patchwork 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: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274784 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1A66C433E7 for ; Wed, 2 Sep 2020 21:44:00 +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 B65A1207EA for ; Wed, 2 Sep 2020 21:44:00 +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 B65A1207EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaXv-0007qY-SH for qemu-devel@archiver.kernel.org; Wed, 02 Sep 2020 17:43:59 -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+qemu-devel=archiver.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:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37BA4C433E7 for ; Wed, 2 Sep 2020 21:46:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFA4F20758 for ; Wed, 2 Sep 2020 21:46:25 +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 DFA4F20758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDaaH-0003Zq-3w for qemu-devel@archiver.kernel.org; Wed, 02 Sep 2020 17:46:25 -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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by the compiler Cause $PWD are result posix style path such as /e/path/to/qemu that can not be recognized by mingw gcc, and `pwd -W` are result Windows style path such as E:/path/to/qemu that can be recognized by the mingw gcc. So we replace all $PWD with $build_path that can building qemu under msys2/mingw environment. Signed-off-by: Yonggang Luo --- configure | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 30f8c4db29..5f2bcc4b57 100755 --- a/configure +++ b/configure @@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes # make source path absolute source_path=$(cd "$(dirname -- "$0")"; pwd) +build_path=$PWD +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then +source_path=$(cd "$(dirname -- "$0")"; pwd -W) +build_path=`pwd -W` +fi -if test "$PWD" = "$source_path" +if test "$build_path" = "$source_path" then echo "Using './build' as the directory for build output" @@ -346,7 +351,12 @@ ld_has() { $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 } -if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; +check_valid_build_path="[[:space:]:]" +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then +check_valid_build_path="[[:space:]]" +fi + +if printf %s\\n "$source_path" "$build_path" | grep -q "$check_valid_build_path"; then error_exit "main directory cannot contain spaces nor colons" fi @@ -943,7 +953,7 @@ Linux) linux="yes" linux_user="yes" kvm="yes" - QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES" + QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I${build_path}/linux-headers $QEMU_INCLUDES" libudev="yes" ;; esac @@ -4259,7 +4269,7 @@ EOF fdt=git mkdir -p dtc fdt_cflags="-I${source_path}/dtc/libfdt" - fdt_ldflags="-L$PWD/dtc/libfdt" + fdt_ldflags="-L${build_path}/dtc/libfdt" fdt_libs="$fdt_libs" elif test "$fdt" = "yes" ; then # Not a git build & no libfdt found, prompt for system install @@ -5244,7 +5254,7 @@ case "$capstone" in else LIBCAPSTONE=libcapstone.a fi - capstone_libs="-L$PWD/capstone -lcapstone" + capstone_libs="-L${build_path}/capstone -lcapstone" capstone_cflags="-I${source_path}/capstone/include" ;; @@ -6244,8 +6254,8 @@ case "$slirp" in git_submodules="${git_submodules} slirp" fi mkdir -p slirp - slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src" - slirp_libs="-L$PWD/slirp -lslirp" + slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src" + slirp_libs="-L${build_path}/slirp -lslirp" if test "$mingw32" = "yes" ; then slirp_libs="$slirp_libs -lws2_32 -liphlpapi" fi @@ -8190,7 +8200,7 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -NINJA=${ninja:-$PWD/ninjatool} $meson setup \ +NINJA=${ninja:-${build_path}/ninjatool} $meson setup \ --prefix "${pre_prefix}$prefix" \ --libdir "${pre_prefix}$libdir" \ --libexecdir "${pre_prefix}$libexecdir" \ @@ -8212,7 +8222,7 @@ NINJA=${ninja:-$PWD/ninjatool} $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\ $cross_arg \ - "$PWD" "$source_path" + "$build_path" "$source_path" if test "$?" -ne 0 ; then error_exit "meson setup failed" From patchwork 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: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 274781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5812CC43461 for ; Wed, 2 Sep 2020 21:47: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 1F68220758 for ; Wed, 2 Sep 2020 21:47:25 +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 1F68220758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDabE-0004vV-AL for qemu-devel@archiver.kernel.org; Wed, 02 Sep 2020 17:47:24 -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+qemu-devel=archiver.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)