From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.6754.1575593280166356608 for ; Thu, 05 Dec 2019 16:48:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2019 16:47:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,282,1571727600"; d="scan'208";a="214285640" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga006.jf.intel.com with ESMTP; 05 Dec 2019 16:47:59 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Dec 2019 16:47:57 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 5 Dec 2019 16:47:56 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.29]) with mapi id 14.03.0439.000; Fri, 6 Dec 2019 08:47:55 +0800 From: "Bob Feng" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: "Feng, Bob C" Subject: Re: [edk2-devel] [Patch 0/4 V4] Enhance Incremental Build Thread-Topic: [edk2-devel] [Patch 0/4 V4] Enhance Incremental Build Thread-Index: AQHVq0SzRKC9shfWm0CFv7ymuGfIPKerwLgggACAdgA= Date: Fri, 6 Dec 2019 00:47:54 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16157C357@SHSMSX104.ccr.corp.intel.com> References: <20191205081807.15092-1-bob.c.feng@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Mike, A tool chain enable this feature by defining the *__*_DEP= S_FLAGS in tools_def and applying $(DEPS_FLAGS) in build_rule.txt. I have added those setting for MSVC, GCC, CLANG tool chain in tools_def.te= mplate and build_rule.template. Those exist tool chains are all enable this= feature by default. Only RVCT tool chain does not support this feature, but according to https= ://bugzilla.tianocore.org/show_bug.cgi?id=3D1750, RVCT will be dropped from= our support tool chains. So is it fine to add comments for each tool chain to document this tool ch= ain is enabled to generate dependency files in build_rule.template? Thanks, Bob -----Original Message----- From: Kinney, Michael D=20 Sent: Friday, December 6, 2019 12:49 AM To: devel@edk2.groups.io; Feng, Bob C ; Kinney, Mich= ael D Subject: RE: [edk2-devel] [Patch 0/4 V4] Enhance Incremental Build Hi Bob, How does a tool chain opt-in or opt-out of this feature? As you point out, not all tool chains provide the information needed to su= pport this feature. We need to make sure the use of this feature or not is= clearly documented in the profile for each tool chain. Thanks, Mike > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Bob=20 > Feng > Sent: Thursday, December 5, 2019 12:18 AM > To: devel@edk2.groups.io > Subject: [edk2-devel] [Patch 0/4 V4] Enhance Incremental Build >=20 > V4: Move .deps files to where corresponding .obj file locate > V3: Change CLANG9 to CLANGPDB according to commit 14672c34bd > V2: Fixed a bug in patch 4/4. >=20 > Incremental build reduces the build time by only building the module=20 > that need to update. Edk2 Build system is a Makefile based build=20 > system. The incrememtal build ability is provided by the Make program.= =20 > But Edk2 build tool need to generate correct makefile to have Make=20 > program do incremental build correctly. >=20 > The current solution in build tool to support incremental build is=20 > that build tool find out the include file list for each source file of= =20 > a module, and in module's makefile, build tool add the include file=20 > list as the source file's dependency. > In this way Make program can decide if it need to rebuild a source=20 > code by checking its dependency. This solution has 2 shortcommings,=20 > one is the process of finding include list is slow, the other is this=20 > method can't handle case that a MACRO in #include statement so the=20 > related source file is always built. >=20 > This patch provides another method to support incremental build. That=20 > is to use c preprocessor and trim tool to generate dependency files=20 > for the source file. > This method will save much time in AutoGen phase and handle MACRO in=20 > #include correctly. >=20 > For C files: > 1. MSVS. > cl.exe has a build option /showIncludes to display include=20 > files on stdout. Build tool captures > that messages and generate dependency files, .deps files. > 2. CLANG and GCC > -MMD -MF build option are used to generate dependency files by= =20 > preprocessor. Build tool updates the > .deps files. >=20 > For ASL files: > 1. Trim find out all the included files, which are asl specific=20 > include format, and generate .trim.deps file. > 2. ASL PP use c preprocessor to find out all included files with=20 > #include format and generate a .deps file > 3. build tool updates the .deps file >=20 > For ASM files (.asm, .s or .nasm): > 1. Trim find out all the included files, which are asm specific=20 > include format, and generate .trim.deps file. > 2. ASM PP use c preprocessor to find out all included files with=20 > #include format and generate a deps file > 3. build tool updates the .deps file >=20 > Build tool add "include" instruction for those deps files in the=20 > Makefile. >=20 > This patch does not support RVCT tool chain for the BZ > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1750 >=20 > Feng, Bob C (4): > BaseTools: Add build option for dependency file generation > BaseTools: Generate dependent files for ASL and ASM files > BaseTools: Update build_rule.txt to generate dependent files. > BaseTools: Enhance Basetool for incremental build >=20 > BaseTools/Conf/build_rule.template | 94 > ++++--- > BaseTools/Conf/tools_def.template | 173 > ++++++------ > BaseTools/Source/Python/AutoGen/GenMake.py | 83 > ++---- > .../Source/Python/AutoGen/IncludesAutoGen.py | 255 > ++++++++++++++++++ > .../Source/Python/AutoGen/ModuleAutoGen.py | 23 ++ > BaseTools/Source/Python/Trim/Trim.py | 115 > ++++++-- > BaseTools/Source/Python/build/build.py | 63 > ++++- > 7 files changed, 588 insertions(+), 218 deletions(-) create mode=20 > 100644 BaseTools/Source/Python/AutoGen/IncludesAutoGen.py >=20 > -- > 2.20.1.windows.1 >=20 >=20 >=20