From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 2107F21180F4A for ; Thu, 25 Oct 2018 07:20:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 07:20:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,424,1534834800"; d="scan'208";a="94961693" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2018 07:20:21 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.86]) by FMSMSX108.amr.corp.intel.com ([169.254.9.237]) with mapi id 14.03.0319.002; Thu, 25 Oct 2018 07:20:21 -0700 From: "Carsey, Jaben" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when compiling .nasm files Thread-Index: AQHUbD3moG0f7F8eCU6SnNKXO4kRZKUwAvlA Date: Thu, 25 Oct 2018 14:20:20 +0000 Message-ID: References: <1540453065-18824-1-git-send-email-yonghong.zhu@intel.com> <1540453065-18824-2-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1540453065-18824-2-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzdjMDdiZDctNDI1Yi00NjUyLThhNzItZWVmMGY2OGNmMGZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZDBTeW5oa2dnV0VGaVdKWHhHUlUwVm9IQ0lFZEpNWFZ5SXU3MnBTYlFqNkRoOEp4akFxVk5SNjRaWThTWkN1USJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [Patch 1/2] BaseTools: Add $(INC)-like support when compiling .nasm files 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: Thu, 25 Oct 2018 14:20:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Yonghong Zhu > Sent: Thursday, October 25, 2018 12:38 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when > compiling .nasm files >=20 > From: zhijufan >=20 > current edk2\BaseTools\Conf\build_rule.template, the compile of nasm > source files does not have the $(INC) support. >=20 > The '-I' option only includes the directory of the nasm source file > (${s_path}(+)). Hence, it will be impossible for nasm files to include > files outside of the nasm source file directory. >=20 > As a comparison, the compile of both .s and .asm have $(INC) support > in their compile commands. >=20 > Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1085 > Cc: Liming Gao > Cc: Yonghong Zhu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Zhiju.Fan > --- > BaseTools/Source/Python/AutoGen/GenMake.py | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index d94d8f9..8860d50 100644 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -165,11 +165,11 @@ class BuildFile(object): > _INCLUDE_CMD_ =3D { > "nmake" : '!INCLUDE', > "gmake" : "include" > } >=20 > - _INC_FLAG_ =3D {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-= I", > "RVCT" : "-I"} > + _INC_FLAG_ =3D {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-= I", > "RVCT" : "-I", "NASM" : "-I"} >=20 > ## Constructor of BuildFile > # > # @param AutoGenObject Object of AutoGen class > # > @@ -594,10 +594,22 @@ cleanlib: > "macro_name" : "IN= C", > "source_file" : Incl= udePathList > } > ) > FileMacroList.append(FileMacro) > + for File in self.FileCache.keys(): > + if not str(File).endswith('.nasm'): > + continue > + FileMacro =3D "" > + IncludePathList =3D [] > + for P in MyAgo.IncludePathList: > + IncludePathList.append(self._INC_FLAG_['NASM'] + > self.PlaceMacro(P, self.Macros)) > + if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros: > + > self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(self._INC_FLAG > _['NASM'] + P) > + FileMacro +=3D > self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC", > "source_file": IncludePathList}) Why do we use +=3D on FileMacro here? Seems like =3D will be fine. We can= also skip initializing the FileMacro since it's only ever assigned here. > + FileMacroList.append(FileMacro) > + break >=20 > # Generate macros used to represent files containing list of inp= ut files > for ListFileMacro in self.ListFileMacros: > ListFileName =3D os.path.join(MyAgo.OutputDir, "%s.lst" % > ListFileMacro.lower()[:len(ListFileMacro) - 5]) > FileMacroList.append("%s =3D %s" % (ListFileMacro, ListFileN= ame)) > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel