From patchwork Wed Aug 26 15:10:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11738931 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 3302D1731 for ; Wed, 26 Aug 2020 15:14: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 09FAA20825 for ; Wed, 26 Aug 2020 15:14:00 +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="GdoECw0e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09FAA20825 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]:37442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAx7f-0000rH-8N for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:13:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx6e-0007gi-Sy for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:12:57 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:35540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6c-0003ye-Rh for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:12:56 -0400 Received: by mail-pj1-x1041.google.com with SMTP id g6so1008224pjl.0 for ; Wed, 26 Aug 2020 08:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nHEmWVZQoKiBv31d0b1nWAUGSiNgf5i9gDUSz3OTqd8=; b=GdoECw0e5YKinLb4cEj/ymQxqf/zFPj/c5UIrH1q8owDrW+r6z5MLq4F3F9WSCXizg VTOGuBAWp9ns+tR0kntL8g+wtAebs3picSb1VZwmtmr3bPrJixaLtrw7vgBxDKJPX+/X /0OydXANKJXperaS5SbTfyE8pFAtc02x9PKwZZqThV2/RSIvKlkaH/XhY9H7LzOkY4y9 0OKyyFAeaF8WHEYMz6VM/JkLcN7A6v5nY7M7tfRGueJJA2eA61BiLiIbmDz+WgA+KMJK /4GrFgSQIvCPzi7+99ByxA3ASJ9CVDbWfN0h/fVuDt2SvjPBLSHYJ/2ZWMNxL8Zqy21m FScA== 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:mime-version :content-transfer-encoding; bh=nHEmWVZQoKiBv31d0b1nWAUGSiNgf5i9gDUSz3OTqd8=; b=IiBrDwvao6TglNBXPA6B0nYJwJmuHAspZ3VsAracRacnPhkoq45DXHNsI1dbyV8ovx ymbKFuaPA0xfqUlH5Wh8FK4Q+YP4EeVqmcDQR72fOo/X98ltWdNvIWHDY/1qRStOfQoz Cd8X9WTpARqGrHZ4VAxaoihiN/Pn8gjSF35VwJkWaGv6KMe862KQoqGz96KVxWI3gOwA o9SM1O7Ep6pE28+u4otM8turBMbztUPXFo9vrf1WS86iLf3gb/dqZ4XLOtSQDr62yOuo 6vAzZYhxl+4DPCgpdu39uVRv8/S3499WXU2pmMpYz1S/pwsg5YqFyPtzHimIPRDvxv+h 9EbQ== X-Gm-Message-State: AOAM532SwTVjKZP8LexWGrWj3uEczbiFxW07GQ1w+/8YfRAt22qctMqc 5Bch4xt4Sw9yYEdQbKOHsYMt85hbWAd5wQNk X-Google-Smtp-Source: ABdhPJwgto4tcYkZ5LksKK7qnwVO1X4jKzO+5Qo9STqU6NDJ/kCkPzEw9wuPn20TrVL2al08H5g8tw== X-Received: by 2002:a17:902:8690:: with SMTP id g16mr10552773plo.257.1598454772839; Wed, 26 Aug 2020 08:12:52 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:12:51 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja Date: Wed, 26 Aug 2020 23:10:01 +0800 Message-Id: <20200826151006.80-1-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 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 , =?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 Wed Aug 26 15:10:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11738933 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 8CBCB722 for ; Wed, 26 Aug 2020 15:14:03 +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 6487720707 for ; Wed, 26 Aug 2020 15:14:02 +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="f4xtKclO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6487720707 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]:37762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAx7h-0000yw-RL for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx6l-0007iB-W7 for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:04 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:39353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6g-0003yw-BL for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:02 -0400 Received: by mail-pg1-x544.google.com with SMTP id v15so1170285pgh.6 for ; Wed, 26 Aug 2020 08:12:57 -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=f4xtKclOiCLcv+sCFFhbwanX01YzyvKkfYKiilgrl8OdP3KnLl8OTLv54YGxBgMdV6 aeFbSPdoZWT6veu8mlCcv5P/ug3pLcJemL4mtpqMsbbm86kt7pNgeVB3YtStbyzvkFa6 nHrRptqD2Q514lnadg7Cs1LWilUyTKtFUDvxZkIgC3G6wuIdXnZWTpl1IyK22b1H68Hv ab1rY5qtp3Y0Unv1HI3UF16A2d8Lavpnx/DiHntZEaHPBbQqFyuGZFUTYl1txYjTN71w L1n7am8wFerTL9LOhMMlWD5bF6ujypVV8fY7bPCItevZfRr5AXfrVvJH6iWbQ8OSfB0W n8GA== 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=jHE7et2b2WdMJKKKql5VJEi1Ox3bJ1eeDB7gQ8dEAsGpDKaL5xbJJdQmJ/BB/5ZU2F lyxkwTDPktQ11m8FK9SK1V//e84yJ7LdJRzTZWRX2p9+4vG70wBD4cyWRaXCVyotdcmK siBlRjTb11ul43JvZ8U0NRDabn31W964xcq0F0mgsGfl+1lC150ub6oNpaxOsBJtgzzD MXq/6GoraMNYKhxWA0Y69DCRfwUjH7kbAB/tttGbmBIFtxkKFdws0nwcJHn5fy/DhNm6 s6l8gwE7GcFvM9rmcaDbDN8lWl4VKC8AKF1PisEZp6OpzwAImHSvd0JZrVmF1L5jEusH r/uA== X-Gm-Message-State: AOAM533JPkS778T0htUau4SfEAjm7hmyblnLEuBrxHxdF08sKmyzpUTV oJOrWr3DCs74SygR73TsZGnRKkMQzlUEKxPu X-Google-Smtp-Source: ABdhPJx23u/MEvog3du3zKXK2Km44BSDbvghLU6FvgS6AzPMwoeilYwi4CYMunCAZqj9AoxD91CuAw== X-Received: by 2002:a65:4787:: with SMTP id e7mr10076394pgs.402.1598454776476; Wed, 26 Aug 2020 08:12:56 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:12:55 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 2/6] meson: fixes relpath may fail on win32. Date: Wed, 26 Aug 2020 23:10:02 +0800 Message-Id: <20200826151006.80-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200826151006.80-1-luoyonggang@gmail.com> References: <20200826151006.80-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 Wed Aug 26 15:10:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11738935 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 A85441731 for ; Wed, 26 Aug 2020 15:14:04 +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 7FA5620707 for ; Wed, 26 Aug 2020 15:14:04 +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="WOEvVFLi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FA5620707 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]:37958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAx7j-00013v-OA for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx6m-0007iE-G9 for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:04 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:37572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6k-0003zB-1L for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:03 -0400 Received: by mail-pf1-x441.google.com with SMTP id x143so1144731pfc.4 for ; Wed, 26 Aug 2020 08:13:01 -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=WOEvVFLidXO8E65VFUzB5RxnMyoX//AIKATtsLFoqBGyHyCMS+Ky1u31LnqYz1Ngx3 jkZdTul3UZlqFnBfaQUZXIyNcu9xiKSHEPgkmA+4EIeegjosPrc+RQDbojYVktwxQ96O UI0fONVJ/p8vkFns1lfMFnQA3tB1+Tk6M4BAzX0cfWI5MwlytRcqGIMeu8Dk/4xawkOh bqBizOgLCVkYfByKRvijZSLC62TYDnmC1zEHryupi1IByuwd8/izwrmGZ86XDjgUNu+C P1WxvPlSwpNL2R2Mn4Sdj/V5SlHLAO2GucUe17dJ1jD4DA7UDbgft4SyS+ja72VOAk4M tJwg== 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=c5x8ft6RIHsvqvO9L0CWxtjsg8fZIiuVYWurRBCmNXaq2bwX2YJn7oXS7Rjod5IzFY aUbTCY4a2dTZtVpujb5nT+fZJqYTmYEEhDqyu02hkPV2TUxAO7PY2tUcouwBLMPzxfQ1 2aO0/mSQ0FZNaHYg4fDR0tz0JtlMg0MFBE/KefOCEKn0aw2IaZNYVbgYwd8ra0e37KOh aVip1NXs7uPz/3BuFpOyut8xqAp4Ska2wgeATal1FmUWYdt4X7CWJArV5CgPvsRm+F7y x14dLJiS9mgEeQcK24Lwi+/LnMOjICPGmpRY2rKkh48N5JS9/2rDStwUZPkru+Nee585 29jg== X-Gm-Message-State: AOAM532nyWpElX1CNHOobGS2HFY3oALilZcFeIzShL48y8ZCbyILHOQy j6f5pV0n0/EIoAGLkGUF6AaOkW3PkKfSUhl6 X-Google-Smtp-Source: ABdhPJwt11R9etjBkG4loJ3X/m/Zv/NSKYVe/4qBTVs8k51Z90SOlQtS9DjkqAeK8PTDQiz9fQOZ9Q== X-Received: by 2002:a63:1a0c:: with SMTP id a12mr10777133pga.24.1598454780273; Wed, 26 Aug 2020 08:13:00 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:12:59 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2 Date: Wed, 26 Aug 2020 23:10:03 +0800 Message-Id: <20200826151006.80-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200826151006.80-1-luoyonggang@gmail.com> References: <20200826151006.80-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Yonggang Luo , =?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 Wed Aug 26 15:10:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11738975 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 911A21731 for ; Wed, 26 Aug 2020 15:16:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6516C2075E for ; Wed, 26 Aug 2020 15:16:46 +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="HD5My3h6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6516C2075E 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]:44414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAxAL-0003kj-MX for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:16:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx6q-0007mJ-0H for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:08 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:43500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6o-0003za-0U for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:07 -0400 Received: by mail-pg1-x543.google.com with SMTP id d19so1162374pgl.10 for ; Wed, 26 Aug 2020 08:13:05 -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=HD5My3h6zg+jOnQAv4pauAgdBk9GXjTDv+UwSk/YLAYPvQrNuS9DOri1Cn7qtL/pd/ M5oQMU8S1bo/iqdnEPq3ZLc41tocrTPHEl/P8LsfXXPKxXR4P+ThDI5WgIFndm1Lu8db UgkbFF/56W5KCMJtpv9oCXgqiphd2mUdSILlxni9Bd4mnzwk1tZFdVV38cYeDNYeUgfw 2Tfn4O8pAV3EIcNs+7t67vHB7Ca8f/M/37H88XiFbw+olHxlJpVyCh+AL4JBJR/yqroH LuiN0QUxwMQM1KNCq81Ff+NQ72yXqAanipdbjTidy5/xp6thRfb/M1ZL1IUu6uNN3tYQ DBYA== 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=dOF0AoytflS4iUWujPiioTGlGszcRkjAudYvQMn85s1YxXQGS0yeEP95gnTqqvLfJ8 eztlW3CEzpAzF6XmpCP+UE83s6zSZ3et/s3BoD/KZPCrLDv4weRZ1UGKVeeWZFqOh8A/ jwE4QNwELxONQSGPWMqHakUedBhf8LaNcSdcBIl7YUYtk0lMDfTV0Cr3dnZXjaVXFPGT 9impnGaKvvQqhRi6Fwhfs1iJvZS0RqSxe0iOIGGTDNoRlYWKkaqdhW5o3WW+RLsocZbz 4njT0F/FOEXCQfRjHlQ2yqg+c6W27uUh3aehW9uJUyv9eQ7c/uj5zsfOGqZopGSeE6qc 3ELw== X-Gm-Message-State: AOAM532grrdd4a/wkqPcXEAwpby5NPA5lweae3QV7is4fUkh5cOacDHA ujxJn5YyMmDwHMtEtHaeiGSfGZl1L/ukX/1k X-Google-Smtp-Source: ABdhPJxaXvCT9V9gcZ5LrI0irt40SkapCEQjMIFFTddgn13mruK3QlTcFHDQf3+6+t8L5+5EEG0aNw== X-Received: by 2002:aa7:83cf:: with SMTP id j15mr12387717pfn.251.1598454783937; Wed, 26 Aug 2020 08:13:03 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:13:02 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2 Date: Wed, 26 Aug 2020 23:10:04 +0800 Message-Id: <20200826151006.80-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200826151006.80-1-luoyonggang@gmail.com> References: <20200826151006.80-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.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 Wed Aug 26 15:10:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11739001 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 643D71731 for ; Wed, 26 Aug 2020 15:18: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 393B32075E for ; Wed, 26 Aug 2020 15:18: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="GDPnH5sV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 393B32075E 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]:48694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAxC8-0005VZ-QV for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:18:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx6s-0007uq-RE for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:10 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6r-0003zt-7M for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:10 -0400 Received: by mail-pl1-x635.google.com with SMTP id k13so1034186plk.13 for ; Wed, 26 Aug 2020 08:13:08 -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=GDPnH5sV94MI8EJqD4/T2+aIBbV5g+4hzb4yzFy/Z/E1zaFWtbXlq+o//Hwy1cqfIb CxcroJi+QFvbXkPfvK3QLDQr7oGV/bVelm987SRP3CvZERTyl3n9FrEDaV8oZYQVJ6CZ ykQH0JxOEYzYyyLvkKeYstJqsD+THNmJGltYoEt8dBv6W7R7QNfMrSivLT7jojSbv0kh FcznwodFuT57opUTcxdu54LI+lcdk9uG78DHRwZVH+lf1tucH+8tiA9RAsu+Smodccy/ V39ytlUnbdzSZQkXxI7vqUH87Ucq2zXNf6LEJEBPpkGM6V0siQFhN58PkAuoFetbdb/x eGZg== 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=NXRpKG7heA3qIXlZxQC7fS/eqZZ7xXOK1o8nIpn+G+6x2xe8O5aFWjBp3jGiM2sSi1 EkoXTIf/Oi7T5xwYTKiGwagiBEId96Gy6y2KoxDAQWlKLac8Z8SDRtXQnG2qnK6prMxa 1xc1vOQPsGdIM6+BThFzYaT2T6IPT5/vvlOiFFFWNO4pM0BObELo2xe0JDywCut1ovmF em865a2pdUB8STBsFfFwdXDFnXT092/IcILMZ7jwM5/vUbSr3izoDUxCeGUotMFLUGfM jBGsQ3EXCRqh6IsLkckHfggc3sXsYcu6oUTBBtw4sI8D6IYND/LQzSLWnRA4QBrt8ex9 Y9Ug== X-Gm-Message-State: AOAM5309JqUPVXbOTqbSx2HTcAQjBhPsAcGdA+m4CyJrok5RMeP5tRcU xMa/R9xnKJleeT3OhaPEI6fGXOrw9om17/pb X-Google-Smtp-Source: ABdhPJyxFMS8rAJP/vb9AlHEpvzrULsThT0SjL+mT4HFo9kSoiBAtcmE/Ngik4IL5EN58gva+ddT1w== X-Received: by 2002:a17:90b:4b81:: with SMTP id lr1mr6705837pjb.71.1598454787394; Wed, 26 Aug 2020 08:13:07 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:13:06 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2 Date: Wed, 26 Aug 2020 23:10:05 +0800 Message-Id: <20200826151006.80-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200826151006.80-1-luoyonggang@gmail.com> References: <20200826151006.80-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x635.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 Wed Aug 26 15:10:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 11738977 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 1B8EF109B for ; Wed, 26 Aug 2020 15:16:48 +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 E70B52075E for ; Wed, 26 Aug 2020 15:16:47 +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="buxL7o2g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E70B52075E 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]:44530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAxAN-0003nk-8c for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Aug 2020 11:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAx72-0008AN-Jq for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:20 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:46585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAx6x-00040O-L5 for qemu-devel@nongnu.org; Wed, 26 Aug 2020 11:13:20 -0400 Received: by mail-pl1-x62e.google.com with SMTP id k13so1034343plk.13 for ; Wed, 26 Aug 2020 08:13: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=0MHaD6z1pFAFDf/EBlzuj/2Fpp3Ey6jqJZfY5kTLTeE=; b=buxL7o2gl2rq1DrzBrFoWhNVe6jsUr5bTGprR8+VbdW/q7UNjQNzwJrVAbcvYJ2/2c mhp9+87j8/5DKsv2dlEOH+UnWJzmIjuKq7k9kzuvG2xKbe69GPe+MEbx47lFbA8RRprx Ebmd2aZoQ5c2umLoRGV8H+D0u2dbN83hilcnoa1doEoH5WB2g5IXjjJDeqUccIsvT7Fj pgQcjADV7n1kTzhrB0aH4cTU72mEu/iY4RWjLp8PTUwBBbo71+aJg6usWTlwX7de8gze 0Lw8xp4OFaOGFYd9EQ0SBZn43PUg1lscjGmekzWD4wOMLYOCkt8O+jpBxJB69MAImMZJ jRaw== 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=0MHaD6z1pFAFDf/EBlzuj/2Fpp3Ey6jqJZfY5kTLTeE=; b=JsDuajdCtFSkW9uU7nisoEhRMr9H2LXTuIjhuWNrxGKG5rsA3sSAl2ax3NNBRr+M++ Ts//LfxdS50llyHSgQEaMSxnVzARAx8Yz1c90r/mNu6ePIkAm9J4MMJia4k7Fpb1aNiU lFDL1tb05/EYWw7iUAcG6QTf4U7o3rq8mVwRLNrV5BleZRlrf3FCtYjYCDK6m4bXyvLu PYva+A+FwU/ttOAFrEodl5HEKG9b8hecX4Y4F72lx5HeZUdABKZJImVP0PBnKdCAt2tN HM5gF0fyq0Z59eFtmMwRsPdT//gdtB3LzhwcJ55vp/l5q8ZWuCw8u4DluLa38rVwRmni BkAg== X-Gm-Message-State: AOAM5335DsBUFIMxwBY6bzMLM6Td+NTdQLAJ6PuV3ShlvL2rxjow4Niw qw7ok/A8wOgCMuGXdff0DfJJOkEMk7ox1reI X-Google-Smtp-Source: ABdhPJytdbx54KPrz4yfPZP9CRm8X6ZpVXgP+X2YUedrI1cUPqHWv33iI4O9pk70yxZWKZicJzzu8g== X-Received: by 2002:a17:902:bb87:: with SMTP id m7mr12211235pls.61.1598454793119; Wed, 26 Aug 2020 08:13:13 -0700 (PDT) Received: from localhost.localdomain ([2401:c080:1c01:4fe:5400:2ff:fef1:b056]) by smtp.googlemail.com with ESMTPSA id 27sm2423169pgk.89.2020.08.26.08.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 08:13:12 -0700 (PDT) From: luoyonggang@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py Date: Wed, 26 Aug 2020 23:10:06 +0800 Message-Id: <20200826151006.80-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200826151006.80-1-luoyonggang@gmail.com> References: <20200826151006.80-1-luoyonggang@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x62e.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 | 56 +++++++++++++++++++++++++++++++++++++++++++++ scripts/undefsym.sh | 20 ---------------- 3 files changed, 57 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..ebc009fb24 --- /dev/null +++ b/scripts/undefsym.py @@ -0,0 +1,56 @@ +#!/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 for compute the symbol duplication +""" + +import sys +import subprocess + +def filter_lines_set(stdout): + linesSet = set() + for line in stdout.splitlines(): + tokens = line.split(b' ') + if len(tokens) >= 1: + if len(tokens) > 1 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): + global _SCRIPT + print(" ".join(args), file=sys.stderr) + 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) + 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)