From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 11AAF21959CB2 for ; Sun, 10 Mar 2019 19:44:25 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2019 19:44:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,466,1544515200"; d="scan'208";a="139656939" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 10 Mar 2019 19:44:25 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 10 Mar 2019 19:44:25 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 10 Mar 2019 19:44:24 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.74]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.121]) with mapi id 14.03.0415.000; Mon, 11 Mar 2019 10:44:22 +0800 From: "Gao, Liming" To: "Shi, Steven" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools: Enable compiler cache support in edk2 build Thread-Index: AQHUuFLaFv98QXOlaE2oG/61reBEkKYF96dg Date: Mon, 11 Mar 2019 02:44:22 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3FFD5F@SHSMSX104.ccr.corp.intel.com> References: <20190130041802.26216-1-steven.shi@intel.com> In-Reply-To: <20190130041802.26216-1-steven.shi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools: Enable compiler cache support in edk2 build X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Mar 2019 02:44:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Shi, Steven >Sent: Wednesday, January 30, 2019 12:18 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >Subject: [PATCH] BaseTools: Enable compiler cache support in edk2 build > >https://bugzilla.tianocore.org/show_bug.cgi?id=3D1499 >Compiler cache can greatly improve the build performance and >guarantee the build result safe. In our testing, the compiler >cache can improve the overall clean build time usually by 30+% >in linux and 10+% in windows. The compiler cache are very fit >to improve the Continuous Integration (CI) build performance. > >For linux compiler cache (ccache) enabling, there is no need >to update edk2 code. >Below link has the ccache enabling referencd steps: >https://github.com/shijunjing/edk2/wiki/ >Edk2-compiler-cache-enabling-steps-on-Linux > >For windows compiler cache (clcache) enabling, we need update >the .PDB debugging file producing option from /Zi to /Z7, >which is to let the C object file contain its full symbolic >debugging information rather than produces a separated PDB file >for all obj files per folder. "PDB files are generated by a different >process (mspdbsrv). They arrive or are updated on disk after >cl completes a compilation or linking operation. One huge problem >with caching them is that the pdb files are input files as well as >outputs. mspdbsrv updates the file with new debug information if >the file exists beforehand. If there are several compilations going >on at once targetting the same pdb then the order the pdb gets >updated is unpredictable. All this makes caching very hard." >The /Zi issue more detail disccusion can be found: >https://github.com/frerich/clcache/issues/30 >Please be aware that this change has no any impact to edk2 module >level PDB file generation, and we still can get the PDB debug file >for a .efi module. The /Z7 only impact intermediate obj files level >PDB file, which is current one PDB file (vc140.pdb) per obj folder. > >Below link has the clcache enabling referencd steps: >https://github.com/shijunjing/edk2/wiki/ >Edk2-compiler-cache-enabling-steps-on-Windows > >Have tested below tools which consume the .PDB file: >*Edk2 source code debugger >*Various hardware and software debuggers >*Uefi code coverage tools > >Only update and test below most commonly used four msvc toolchains: >VS2012x86 VS2013x86 VS2015x86 VS2017 > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Steven Shi >Cc: Liming Gao >--- > BaseTools/Conf/tools_def.template | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > >diff --git a/BaseTools/Conf/tools_def.template >b/BaseTools/Conf/tools_def.template >index 2bd0982872..7d04b3efd2 100755 >--- a/BaseTools/Conf/tools_def.template >+++ b/BaseTools/Conf/tools_def.template >@@ -2589,9 +2589,9 @@ NOOPT_VS2012xASL_X64_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE > *_VS2012x86_IA32_ASM_PATH =3D DEF(VS2012x86_BIN)\ml.exe > > *_VS2012x86_IA32_MAKE_FLAGS =3D /nologo >- DEBUG_VS2012x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm >+ DEBUG_VS2012x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 > RELEASE_VS2012x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF >-NOOPT_VS2012x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od >+NOOPT_VS2012x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od > > DEBUG_VS2012x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >/Zi > RELEASE_VS2012x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >@@ -2621,9 +2621,9 @@ NOOPT_VS2012x86_IA32_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > *_VS2012x86_X64_DLINK_PATH =3D DEF(VS2012x86_BINX64)\link.exe > *_VS2012x86_X64_ASLDLINK_PATH =3D DEF(VS2012x86_BINX64)\link.exe > >- DEBUG_VS2012x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm >+ DEBUG_VS2012x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 > RELEASE_VS2012x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF >-NOOPT_VS2012x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od >+NOOPT_VS2012x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od > > DEBUG_VS2012x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd /Zi > RELEASE_VS2012x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd >@@ -3055,9 +3055,9 @@ NOOPT_VS2013xASL_X64_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE > *_VS2013x86_IA32_ASM_PATH =3D DEF(VS2013x86_BIN)\ml.exe > > *_VS2013x86_IA32_MAKE_FLAGS =3D /nologo >- DEBUG_VS2013x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm >/Gw >+ DEBUG_VS2013x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 >/Gw > RELEASE_VS2013x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2013x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od >+NOOPT_VS2013x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od > > DEBUG_VS2013x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >/Zi > RELEASE_VS2013x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >@@ -3087,9 +3087,9 @@ NOOPT_VS2013x86_IA32_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > *_VS2013x86_X64_DLINK_PATH =3D DEF(VS2013x86_BINX64)\link.exe > *_VS2013x86_X64_ASLDLINK_PATH =3D DEF(VS2013x86_BINX64)\link.exe > >- DEBUG_VS2013x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Gw >+ DEBUG_VS2013x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw > RELEASE_VS2013x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2013x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od >+NOOPT_VS2013x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od > > DEBUG_VS2013x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd /Zi > RELEASE_VS2013x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd >@@ -3525,9 +3525,9 @@ NOOPT_VS2015xASL_X64_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:RE > *_VS2015x86_IA32_ASM_PATH =3D DEF(VS2015x86_BIN)\ml.exe > > *_VS2015x86_IA32_MAKE_FLAGS =3D /nologo >- DEBUG_VS2015x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm >/Gw >+ DEBUG_VS2015x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 >/Gw > RELEASE_VS2015x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2015x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od >+NOOPT_VS2015x86_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- >/W4 /Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od > > DEBUG_VS2015x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >/Zi > RELEASE_VS2015x86_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >@@ -3557,9 +3557,9 @@ NOOPT_VS2015x86_IA32_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF > *_VS2015x86_X64_DLINK_PATH =3D DEF(VS2015x86_BINX64)\link.exe > *_VS2015x86_X64_ASLDLINK_PATH =3D DEF(VS2015x86_BINX64)\link.exe > >- DEBUG_VS2015x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Gw >+ DEBUG_VS2015x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw > RELEASE_VS2015x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2015x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od >+NOOPT_VS2015x86_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 >/D UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od > > DEBUG_VS2015x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd /Zi > RELEASE_VS2015x86_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd >@@ -3755,9 +3755,9 @@ NOOPT_VS2015x86xASL_X64_DLINK_FLAGS =3D >/NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT > *_VS2017_IA32_ASM_PATH =3D DEF(VS2017_BIN_IA32)\ml.exe > > *_VS2017_IA32_MAKE_FLAGS =3D /nologo >- DEBUG_VS2017_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm >/Gw >+ DEBUG_VS2017_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Gw > RELEASE_VS2017_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /O1b2 /GL /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2017_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Zi /Gm /Od >+NOOPT_VS2017_IA32_CC_FLAGS =3D /nologo /arch:IA32 /c /WX /GS- /W4 >/Gs32768 /D UNICODE /FIAutoGen.h /EHs-c- /GR- /GF /Gy /Z7 /Od > > DEBUG_VS2017_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd /Zi > RELEASE_VS2017_IA32_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /coff /Zd >@@ -3785,9 +3785,9 @@ NOOPT_VS2017_IA32_DLINK_FLAGS =3D /NOLOGO >/NODEFAULTLIB /IGNORE:4001 /OPT:REF /O > *_VS2017_X64_DLINK_PATH =3D DEF(VS2017_BIN_X64)\link.exe > *_VS2017_X64_ASLDLINK_PATH =3D DEF(VS2017_BIN_X64)\link.exe > >- DEBUG_VS2017_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D >UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Gw >+ DEBUG_VS2017_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D >UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Gw > RELEASE_VS2017_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D >UNICODE /O1b2s /GL /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Gw >-NOOPT_VS2017_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D >UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Zi /Gm /Od >+NOOPT_VS2017_X64_CC_FLAGS =3D /nologo /c /WX /GS- /W4 /Gs32768 /D >UNICODE /Gy /FIAutoGen.h /EHs-c- /GR- /GF /Z7 /Od > > DEBUG_VS2017_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd /Zi > RELEASE_VS2017_X64_ASM_FLAGS =3D /nologo /c /WX /W3 /Cx /Zd >-- >2.17.1.windows.2