From patchwork Thu Aug 27 04:49:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739915 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 8BA811575 for ; Thu, 27 Aug 2020 04:50:16 +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 62A592078A for ; Thu, 27 Aug 2020 04:50:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ayl8lTK3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62A592078A 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]:52828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9rb-00046y-E9 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:50:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9r3-0002lA-5h for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:41 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:40556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9r1-0003gR-O1 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:40 -0400 Received: by mail-pf1-x442.google.com with SMTP id k18so2525174pfp.7 for ; Wed, 26 Aug 2020 21:49: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=nHEmWVZQoKiBv31d0b1nWAUGSiNgf5i9gDUSz3OTqd8=; b=ayl8lTK3HbdJ2w5DMD+s7vbhyF3kQHWt1OBC459fFYkfQPYtsOiHlWp/hXFOC5j1Uu Fr02t7HNRgfk2N/uqDb5M+joMjkIujQcjDpdhrm5qSnU/PJa7b2srjwhTksrE6kpV2y3 UJdtE9bPL4Vx8D5LlLpQUhAj5rhQp+8kZv/tqBTPpMTngWNwmllzGk8r8deRLM65WxND svlvWWEK11i1HCBXEynEjJ8578mC8nbMTMwuoIBzMQhWT9ZZ0JERR12hvzATlW2aJJwM o+hYfVgsMF+FCxGYnTrkX7eWKHomMi7NFgDaEvneZFOaHNMnLZDXd87BAa/5sJ/LRQMb Ur+A== 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=nHEmWVZQoKiBv31d0b1nWAUGSiNgf5i9gDUSz3OTqd8=; b=f+VI+LSf7o/c+qO7zNyxTWfU6fsHnpLWG5MKmhmIiCIvxXtFN9kY49ltGthRTDzmEO /1R8DZPTrb8guflF3bQmFV8vFxsRmasHIARTVMgNa4BRP03u7aKXY2GLD62T6ZZ1rCY4 uyXQiM2w2Xrc1nsUAP0A/1QjbB6mSkLN2fbirlXkU0b2aPvJFXA1vX1DodbOttY8SMc7 3zH//UZH6NlIYHAMakQJJ8aGeobmXuM6T2eLvsRKmBwfWnesCF1GghpquxKTESblogCs mJglJF8t392TPTDxsSYwNo/76rRZCBqTPxpGYOBrRPX3bgXT4tWgaMrY+tq6oU5bNk30 1T0g== X-Gm-Message-State: AOAM531JsFqWCM0tSPGsF8leZvsjGTs+Gyc7tvvbFXUNhHMnopUxsZeF 0/tdnS17O135RKwwbGbEU2yuHldtrx4YMNOuJ3I= X-Google-Smtp-Source: ABdhPJxWICLA5u99WN3jePmnSqiPn33OehnwvNlzu4tur4+OyFe+CR2prFe2L0ugNvlauI12MA9AKg== X-Received: by 2002:a63:6e01:: with SMTP id j1mr13037528pgc.147.1598503777962; Wed, 26 Aug 2020 21:49:37 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:37 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja Date: Thu, 27 Aug 2020 12:49:12 +0800 Message-Id: <20200827044917.1356-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Yonggang Luo , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo SIMPLE_PATH_RE should match the full path token. Or the $ and : contained in path would not matched if the path are start with C:/ and E:/ Signed-off-by: Yonggang Luo --- scripts/ninjatool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ninjatool.py b/scripts/ninjatool.py index cc77d51aa8..6ca8be6f10 100755 --- a/scripts/ninjatool.py +++ b/scripts/ninjatool.py @@ -55,7 +55,7 @@ else: PATH_RE = r"[^$\s:|]+|\$[$ :]|\$[a-zA-Z0-9_-]+|\$\{[a-zA-Z0-9_.-]+\}" -SIMPLE_PATH_RE = re.compile(r"[^$\s:|]+") +SIMPLE_PATH_RE = re.compile(r"^[^$\s:|]+$") IDENT_RE = re.compile(r"[a-zA-Z0-9_.-]+$") STRING_RE = re.compile(r"(" + PATH_RE + r"|[\s:|])(?:\r?\n)?|.") TOPLEVEL_RE = re.compile(r"([=:#]|\|\|?|^ +|(?:" + PATH_RE + r")+)\s*|.") From patchwork Thu Aug 27 04:49:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739931 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 3A479739 for ; Thu, 27 Aug 2020 04:51:40 +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 0FE262078A for ; Thu, 27 Aug 2020 04:51:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C0m1ka4n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FE262078A 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]:60730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9sx-0007KZ-Bs for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:51:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9r8-0002uj-Di for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:46 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:46108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9r5-0003gk-Qs for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:46 -0400 Received: by mail-pg1-x544.google.com with SMTP id 31so2446534pgy.13 for ; Wed, 26 Aug 2020 21:49:43 -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=7+MsaJjYLlKc/kuo4dhCFuDpn67NQClb7RmuHL3RlA8=; b=C0m1ka4nMOIT8pbURzi32/XLZXhAAVj/llq5s7GnnlYPsVjBuzyUf647/wcrQxfECB shePWwDQBmS9T3WJhd3Oq9/vck9BCmcJvp1sTaf01DHOxtpBF0P1IO6jvf0d6bsux1Wz J8yCj6YDPQl+fmfH5Xssk7FVqq20ijww/51e7SDGo3I80VD3/DNgmSXk4v8wlhP4WFV/ RKJKucHsUr96aQRn9GIPjJwZgSt+lZ88nQEAI7cCFi3FD4c7Tnz3C98iWsvhCBpESsDR zOgK/ILy4yogUhy5sJPpxSzZ/D/3tLjTUFco4n7bIGkbpL22jzdZXtJR6Yoq5R2kYZYc j5sA== 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=7+MsaJjYLlKc/kuo4dhCFuDpn67NQClb7RmuHL3RlA8=; b=GPSvHtbkBDJcN6uN2pvaOSMr1eblAa6s5+dRtmfAxHoqGzhcWsnI1Yuciog6knM394 czgKzd6oWOklVQ+owWdP6VMSr7gyS6dHWjtiv1xqhW4bedyClwDojE3Pdy2zHwrBzQyL S629NtGwF9nAesk3/FftdXQ/5mx7i5CzmHrRFmXrMlq/fu4r1SmaZJF4BPQlCscMABYF AGt1l3sZOhZbfV8+tgMDZZmVo0kaUZwxbXVgVHchp9/YD2hzQR5NryR/o2ak5n8FV0jx PK8uBA9clX99DU3a9WlxKzicjwL+Q3s0CPf6gOpXdL1Xw0P29gHNfzT5w788wLKqxOUy otFQ== X-Gm-Message-State: AOAM532PKUT76WjOUs6BjwL3X5SeEJ8yNP9hKjqa+m/AzwaNL0mrTjKt HiwbbOZXjXjtxG7KuCzwcZduF50wzeNdXb7VZiU= X-Google-Smtp-Source: ABdhPJygoErTZpcYOEEZIwnw2ndhPQz3lOJ5nJTBI3YErIW/Z5+AEZKvx+BSQtXWbF/NPceT0FmMFw== X-Received: by 2002:a17:902:bf01:: with SMTP id bi1mr14688209plb.118.1598503781986; Wed, 26 Aug 2020 21:49:41 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:41 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 2/6] meson: fixes relpath may fail on win32. Date: Thu, 27 Aug 2020 12:49:13 +0800 Message-Id: <20200827044917.1356-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x544.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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo On win32, os.path.relpath would raise exception when do the following relpath: C:/msys64/mingw64/x.exe relative to E:/path/qemu-build would fail. So we try catch it for stopping it from raise exception on msys2 Signed-off-by: Yonggang Luo --- scripts/mtest2make.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index bdb257bbd9..d7a51bf97e 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -53,9 +53,16 @@ i = 0 for test in json.load(sys.stdin): env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v)) for k, v in test['env'].items())) - executable = os.path.relpath(test['cmd'][0]) + executable = test['cmd'][0] + try: + executable = os.path.relpath(executable) + except: + pass if test['workdir'] is not None: - test['cmd'][0] = os.path.relpath(test['cmd'][0], test['workdir']) + try: + test['cmd'][0] = os.path.relpath(executable, test['workdir']) + except: + test['cmd'][0] = executable else: test['cmd'][0] = executable cmd = '$(.test.env) %s %s' % (env, ' '.join((shlex.quote(x) for x in test['cmd']))) From patchwork Thu Aug 27 04:49:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739917 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 3AD5C739 for ; Thu, 27 Aug 2020 04:50:28 +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 1080B2078A for ; Thu, 27 Aug 2020 04:50:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lj+7e+M3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1080B2078A 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]:54132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9rn-0004hG-80 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:50:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9rC-00031R-2O for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:50 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:36941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9rA-0003hF-Eb for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:49 -0400 Received: by mail-pf1-x443.google.com with SMTP id x143so2535425pfc.4 for ; Wed, 26 Aug 2020 21:49:48 -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=rIP9TCfc3oqvA8Vp/R/E5MTUabOcrCowAJuIfVAgJrs=; b=Lj+7e+M31Jh9HGfacgwlvuk2cowjBdBkec7wQbrdIuxNlLoOXE+zVBSqfHBSGkXP+Y 0kpdipUVzCQkhiSMsr0XYg0loio89MY1CSR5uE3oleWcHX0tUzZAfr5WArCQXocXG+BQ faglqAGKhF31GYN2LA2AUcpwFll0R9EYHHMVfilL+N2lteX5hdH3y2qsT6iwcTo5z7gB ydmpBA165fyvGUEB7oUhUGMXAbVHrX7N/OihHtOrap/OtVPwDystEHGND+IaSflqBC/1 q1w9tUSuRs6/l3pcGUkM7dEMCpQswATCCUpqV+yLM7pQJ/Ok+ddu6erkyKVaPtumH2sV VRRw== 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=rIP9TCfc3oqvA8Vp/R/E5MTUabOcrCowAJuIfVAgJrs=; b=HGIEsKSucQAL3Os+O3TUzQTgQH5E3VgvRwIE3FnT1KfhAySuoO7oj9iK4LGVf9/EYd 1EqbUkPVUUcWXSAnK5/5uEvInMGXQuehHvA3/y39DXj2NtEdlUBqS1V1uJc6EcSpMKN3 dsvS0ZRwwe1MgLZO2lv4dc5lqw4tP7llxgYJ7tFQ38Nrws01IWXoXZPK/UhTbczqIUUO VFYzHEXr7AiGVgvzj2QNmWN2JaqLhYXJ+PCk3LiZc3lQCOCLOLP4BH+FghkCgz4X2026 cxGZQOocrdfNnJpQWvmfr2AhxYP/JHX/U9kVXSaAZ8MB4ZQ6cGnxIWHodd1QaQPxP995 NJmQ== X-Gm-Message-State: AOAM5328/7BnK/C/wOd5PMNUNUCP9xWDTrO7tes/W+fExhp66iDFj+// Oe08aBjif/EOFcapSnJ1ruNdlDffwT+v7aLy1kI= X-Google-Smtp-Source: ABdhPJxTfljYwgIutZFgXEfn4gT7GzzEUplBwHPhXaSX6LSFv+N0UibHi/EAGJbMiBuWLM3MeEB+WA== X-Received: by 2002:a63:2482:: with SMTP id k124mr13780529pgk.251.1598503786704; Wed, 26 Aug 2020 21:49:46 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:45 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2 Date: Thu, 27 Aug 2020 12:49:14 +0800 Message-Id: <20200827044917.1356-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo Fixes this for msys2/mingw64 by remove the include_type for sdl2 discovery in meson Signed-off-by: Yonggang Luo --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index f0fe5f8799..1644bbd83c 100644 --- a/meson.build +++ b/meson.build @@ -224,8 +224,7 @@ if 'CONFIG_BRLAPI' in config_host brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split()) endif -sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static, - include_type: 'system') +sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static) sdl_image = not_found if sdl.found() # work around 2.0.8 bug From patchwork Thu Aug 27 04:49:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739919 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 06198739 for ; Thu, 27 Aug 2020 04:50:35 +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 D07F22078A for ; Thu, 27 Aug 2020 04:50:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YVv1Ib07" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D07F22078A 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]:54914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9ru-00050N-34 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:50:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9rH-0003FT-W1 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:56 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:45501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9rG-0003hS-A8 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:49:55 -0400 Received: by mail-pf1-x443.google.com with SMTP id k15so2518721pfc.12 for ; Wed, 26 Aug 2020 21:49:53 -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=bzrUXWXJ2P4FPb4Z7Y3jIG7wAqzpJKqykSmKTUKfTsk=; b=YVv1Ib07Z5BTFZThHFHO2eZY+ETSoZrunGRE5EJ8SgvSfL/u0L3ciZCksSgfzhbpIg YGRRrppnI4uH+6vIY6R6nSzfubPnv/73FAgnFTUfzV7YZBkyagHHh9+6I51pgAcUuA5X 3vGm75JBIfozTPJSBJYlQz9k7qHsnicGrsnfj93viXutHgdyuo9IzWpwggZ3dug5GaRd VqH1y9qMmKzzsjjd8ZuCV52JaHlw9H8zQm4E4rinypZzi6bzoa8ImszE0M4z1m9Ue6om I8rzyPY4gFc2FBdAZUj24iXrd1jrrOPt7LYcqjyc+M8apSECJt2exNGrNtzS3NSBlBKn nx0w== 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=bzrUXWXJ2P4FPb4Z7Y3jIG7wAqzpJKqykSmKTUKfTsk=; b=SewAPc+o7rcEP5IEL2UUDsxob7txb1UYveoIEg/tbXn0WW0xddRUvIwjk/ZIcoJyRB pT7v2cI+xfa5Wo6pgFkd7C3NfqQ69cDhOt2Ri3s3L3duwuGTmgCtp28SGXZcpbBtUvfW doWuq5tJAZbIit94GuedPsrcS6mTgB/TmfyL1i9Qya2kvsJAu/Nzoby6MjcyAaA4JEFA jvvMCtfSjqJ+/n7h0odip9xYbeLDXJ+Clelj2uQj+8TLnU5pJ0jytq+02WAyUoOzeHhX pB5J3lj93RpA0oUBkHJHbJC5bZiFOXf+uN3aEuWVeSDlIR2OQRoc0F9KjObDAXQF0bZW ds7A== X-Gm-Message-State: AOAM532OlCRFgM1Op+NpZ8VPl45AA4mdCHvsmnfl34YwknF36/9+c6FC AXYtegAQ5X2obeD/iUzRca7bHeqqvtRe599Ny48= X-Google-Smtp-Source: ABdhPJxETKaIFGGGLmLy5aBLaWScG0C/uhnbHYz370MQkTrKXkelKfoRM+Ah+4vnIa0cFyGqcUakZQ== X-Received: by 2002:a65:6554:: with SMTP id a20mr11985299pgw.301.1598503792549; Wed, 26 Aug 2020 21:49:52 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:51 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 4/6] configure: Fix include and linkage issue on msys2 Date: Thu, 27 Aug 2020 12:49:15 +0800 Message-Id: <20200827044917.1356-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo 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 b1e11397a8..3b9e79923d 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 @@ -942,7 +952,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 @@ -4283,7 +4293,7 @@ EOF symlink "$source_path/dtc/Makefile" "dtc/Makefile" fi 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 @@ -5268,7 +5278,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" ;; @@ -6268,8 +6278,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 @@ -8212,7 +8222,7 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -NINJA=$PWD/ninjatool $meson setup \ +NINJA="${build_path}/ninjatool" $meson setup \ --prefix "${pre_prefix}$prefix" \ --libdir "${pre_prefix}$libdir" \ --libexecdir "${pre_prefix}$libexecdir" \ @@ -8232,7 +8242,7 @@ NINJA=$PWD/ninjatool $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon \ $cross_arg \ - "$PWD" "$source_path" + "$build_path" "$source_path" if test "$?" -ne 0 ; then error_exit "meson setup failed" From patchwork Thu Aug 27 04:49:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739933 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 3DE3C739 for ; Thu, 27 Aug 2020 04:51:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 157B62078A for ; Thu, 27 Aug 2020 04:51:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mnYqXqsK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 157B62078A 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]:33494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9tC-0007jS-Bc for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:51:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9rM-0003SB-D2 for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:50:00 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:41134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9rK-0003if-TC for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:50:00 -0400 Received: by mail-pf1-x431.google.com with SMTP id t9so2524262pfq.8 for ; Wed, 26 Aug 2020 21:49:58 -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=kZmgaDEBNjpxaFbsHI9krVOWSzauPOV79k08lIpZd10=; b=mnYqXqsKTtbQIH6/GS/xi23dYMopeW/QeA0sIyy+n9jIMxPIcAgdtMDb1Ik4JSaeKv 0KsI1ywEcNzYst2JHICcrBt5tqLyAkzFKD21TDQYx5BPQcY+0HDcle9HszXAiEQtzpC8 gGPtUeVl9Es7bc44JlhHnCBq3B70TO5Wix8NcSGYrmKT8MpnfUzlkhj7FIrdmaNXIxOJ 1CmMW1fTIbm6pOZ+0OiLJW+eRTwgvhM2wCiFTw8MuqQexI8T6quSpeRlRMnRYbBZ4PDA KiUvFXDs04sj46TR9zP1LuD7cJ76zXrLW61GsVu2/TiGCquiydD1GYnEtgeUw78PgYE3 gw8w== 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=kZmgaDEBNjpxaFbsHI9krVOWSzauPOV79k08lIpZd10=; b=sudiQBUAeGcZsyJlnwUlzNKRBe6uW75DiI1Ie8EqA8T5PB1KCTUBYGm55l89JO1TYF zVw7IEhEp1LembyNqz36jORxjN3qT6KDq475hUPKj6KXayFjvAuEsGDWvqISAuEEHH7X 6c0iILKuOu1gNh6xohBfFPI9fdo6+1jY4doiO0GrfAoVCQwHPmTxktTNPndZsnWPiOuj dy8Xg6Z9LJQplsX/ri49tz5FpQQ6dBe12Sv1J0rwbIv+HhFo+XwDhMpB+bJD3yu5t44P OXbq03cDJxAFTLMvJTHcqVZleFHEIlKeCP7HDFHSs8eUEwKBxuArl3jQHaLyatZ2ArSH Wyew== X-Gm-Message-State: AOAM530mg602/qQgLnUQ3sMFN8zvCIj1gdSf1rtzkNNlZYplZwxP3KSX iBGc819oz1mzxFYa71WipkSJUgl30AL0SLtBFxU= X-Google-Smtp-Source: ABdhPJyB7jUpg2txTcOAjfkTu1Uhd106g3LZjOCTGz3xYHrZZhAVdzUlj1GjfLUNLrEEEdQNzpowrQ== X-Received: by 2002:a17:902:9690:: with SMTP id n16mr11900274plp.305.1598503797093; Wed, 26 Aug 2020 21:49:57 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:56 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2 Date: Thu, 27 Aug 2020 12:49:16 +0800 Message-Id: <20200827044917.1356-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x431.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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo use ninja instead ${build_path}/ninjatool Signed-off-by: Yonggang Luo --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 3b9e79923d..2ad0c58492 100755 --- a/configure +++ b/configure @@ -8222,7 +8222,7 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -NINJA="${build_path}/ninjatool" $meson setup \ +NINJA="ninja" $meson setup \ --prefix "${pre_prefix}$prefix" \ --libdir "${pre_prefix}$libdir" \ --libexecdir "${pre_prefix}$libexecdir" \ From patchwork Thu Aug 27 04:49:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739929 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 C449C739 for ; Thu, 27 Aug 2020 04:51:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BFA02078A for ; Thu, 27 Aug 2020 04:51:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H6OSlufe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BFA02078A 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]:60012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kB9sm-00072e-VD for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Aug 2020 00:51:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB9rQ-0003dh-NY for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:50:04 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:33454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB9rO-0003is-QR for qemu-devel@nongnu.org; Thu, 27 Aug 2020 00:50:04 -0400 Received: by mail-pg1-x52c.google.com with SMTP id o13so2478185pgf.0 for ; Wed, 26 Aug 2020 21:50:02 -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=hAIHaNoFAufwAGE6KbRmUZ0ExbibwWjhonjd/BMqxdQ=; b=H6OSlufeVe70sUyXpUiMZIh+/E9q3jJGFxgmBsSFtgWd/z9QNkwjELY8U6DjAqEUoz NrSCrB+dqnZVvnyR/OTJe4BnnxYPPSqfOsu+DMrk26O3vLAD4w3Xxk3zariVBEZrkMwO UHpnVqTEjunnYwdAdcbVArmW7NIMEPIG3eY2SPAS5aTbzBp3B549yK6TojvS0dn8jEpj tWXnrttZZgmWaMljl8qK7m6VRIMzxuiJg48AumIMwxzPQdMN0LKufhj6BHGfu+xuC9ba bMc09ZqcmxfNmv3fW1qTrFppdvsnE3mUZ5kkw4MYRvA4k8uK+gdyOxK6kDbhGN3e38av BXow== 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=hAIHaNoFAufwAGE6KbRmUZ0ExbibwWjhonjd/BMqxdQ=; b=hQE/hqTjoOoVWQMz/AbuyROizeSt2uWroe1NyHUoTnwbrg3vZMZ/mygZu3zzKQ1Bwc U4K9lEtCuAMwqmc94rt1kjOMvLEPZJ8xtc4veFTKLv34dB5f08mvW2WkwpQNaAF1AcL4 2S25ZGtCJtop08wpgXhIAIQQvSQxkbmLPoEEF7+lj8VYkwxbd391DbWcY1xYpmZJpVEY Ohtrtn+pQYuC5jleK+3TIsYxHIrUI8+hKsgIRQkbtD53jfBkHHcHH20BPsDJ+Bz+VvY6 dV2mNvPikSkZLRzUL35EZIuxCvsk21H1HXZXzaJiH4dyHmJlEOa5OgDdoSsanFCyoIm3 zwtQ== X-Gm-Message-State: AOAM530FppUAl7zWE4KwRV9+rh321VLXDyCI8RfuvKBG+GgP+jhVBFH6 p9yQ8bhq7AOTst9P/qNDXHUpZHaRK8u9CrfNL3Q= X-Google-Smtp-Source: ABdhPJztqGONx5q3IWhvve9gq6nFnqL/m+pwhe9FZcGDz9YhMBw5T55zSdREXE71U722+RnDijo/Cg== X-Received: by 2002:aa7:854f:: with SMTP id y15mr14843926pfn.298.1598503800706; Wed, 26 Aug 2020 21:50:00 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id n26sm902296pff.30.2020.08.26.21.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 21:49:59 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH 6/6] meson: Convert undefsym.sh to undefsym.py Date: Thu, 27 Aug 2020 12:49:17 +0800 Message-Id: <20200827044917.1356-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200827044917.1356-1-luoyonggang@gmail.com> References: <20200827044917.1356-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x52c.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 , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo 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 1644bbd83c..d6e3bcea7e 100644 --- a/meson.build +++ b/meson.build @@ -845,7 +845,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)