From nobody Sun Apr 28 22:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+49053+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49053+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1571206664; cv=none; d=zoho.com; s=zohoarc; b=DJb9dBJZmCQ7cb4GFR1CV4uloDkFW3hvgIcsJ72GKyTSCFHkOg5Z/EgaKb24qBz0MdK5wFe82/ntDhganPRfDtsjJrpmDO4O/v+AQRWJNs0zjnDp1wF+3A5mMSFK1cCPH5yUkAg1WZOrPckstoyuzBcZ8y08mYB0Ks3C861kyvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571206664; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=cWDdrv5R7+IBzpvWB57p3wn4cXJV3UqBsVlAUBMHL3E=; b=JRjTSLM4NvcR3jWcj1jI3VN07VVMDMqH6DdXtJ5oIv2O3/dU3cuqGq9SGI8+j/ESkz5bOKxMfAYbzo6d6OfM2bLEWEDnl0e9wHmnayP2byOU+Hpg7PXvGT/7zgdulf1R7x8fWQPGwfxn0GdtYozyxgT12McWCLJT1iD+KNLfeWE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+49053+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1571206664812738.8621540967582; Tue, 15 Oct 2019 23:17:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fdlaYY1788612xZW5hONXHVI; Tue, 15 Oct 2019 23:17:44 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.2317.1571206663291974008 for ; Tue, 15 Oct 2019 23:17:43 -0700 X-Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9G6BSiT016380; Wed, 16 Oct 2019 06:17:42 GMT X-Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2vn9b11m8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Oct 2019 06:17:42 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 727C455; Wed, 16 Oct 2019 06:17:41 +0000 (UTC) X-Received: from SZC0PA4FXD.asiapacific.hpqcorp.net (szc0pa4fxd.asiapacific.hpqcorp.net [10.43.42.135]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 8D17648; Wed, 16 Oct 2019 06:17:39 +0000 (UTC) From: "Lin, Derek (HPS SW)" To: devel@edk2.groups.io Cc: derek.lin2@hpe.com, bob.c.feng@intel.com, liming.gao@intel.com, zhijux.fan@intel.com Subject: [edk2-devel] [PATCH] BaseTools: Fix an incremental build issue caused by macro in #include Date: Wed, 16 Oct 2019 14:17:26 +0800 Message-Id: <20191016061726.122168-1-derek.lin2@hpe.com> MIME-Version: 1.0 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,derek.lin2@hpe.com X-Gm-Message-State: N7y50QT1odQ1JyJ0mFXqvo6ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1571206664; bh=a4sNOg6T21lfSzqnL1UB1akpIwg32voJLp4KjUFyYGw=; h=Cc:Date:From:Reply-To:Subject:To; b=Uap36hTQc2qfY6tywik3oFuzv/hIQ9RZq+k2bmUKvKS44eJEzlQibrDVarypHoh1g/h PSlLnqK7cUdvt4ffdvtNaCCJAJxR14cSblExw7trfWZiRT7qeLh7lmeUtH4OUtSrxygOt usOrfjwHmytrWbCMrwYaPCKRn21GzT1ZqJE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" When c/h file use macro after #include, for example, In this case, GenMake is not able to create a healthy dependency for the c file. GenMake used to add $(FORCE_REBUILD) dependency in the c file, this guarantee the c file is always compiled in incremental build. But, this function is broken since 05217d210e8da37b47d0be58ec363f7af2fa1c18 which enable /MP for MSVC compiler, in order to compile multiple c files in one command multi-processing. The fix here is adding '$(FORCE_REBUILD)' back to retain the original function. Line number 1728 and 978 are the code pieces which handle this logic. Signed-off-by: Derek Lin Reviewed-by: Bob Feng --- BaseTools/Source/Python/AutoGen/GenMake.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index 97ba158ff2..59a01a7f24 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1080,13 +1080,17 @@ cleanlib: else: CmdCppDict[item.Target.SubDir] =3D ['$(MAKE_FILE)'= , Path] if CppPath.Path in DependencyDict: - for Temp in DependencyDict[CppPath.Path]: - try: - Path =3D self.PlaceMacro(Temp.Path, self.M= acros) - except: - continue - if Path not in (self.CommonFileDependency + Cm= dCppDict[item.Target.SubDir]): - CmdCppDict[item.Target.SubDir].append(Path) + if '$(FORCE_REBUILD)' in DependencyDict[CppPath.Pa= th]: + if '$(FORCE_REBUILD)' not in (self.CommonFileD= ependency + CmdCppDict[item.Target.SubDir]): + CmdCppDict[item.Target.SubDir].append('$(F= ORCE_REBUILD)') + else: + for Temp in DependencyDict[CppPath.Path]: + try: + Path =3D self.PlaceMacro(Temp.Path, se= lf.Macros) + except: + continue + if Path not in (self.CommonFileDependency = + CmdCppDict[item.Target.SubDir]): + CmdCppDict[item.Target.SubDir].append(= Path) if T.Commands: CommandList =3D T.Commands[:] for Item in CommandList[:]: --=20 2.20.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49053): https://edk2.groups.io/g/devel/message/49053 Mute This Topic: https://groups.io/mt/34557472/1787277 Mute #include: https://groups.io/mk?hashtag=3Dinclude&subid=3D3901457 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-