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.115; helo=mga14.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 5552621180F48 for ; Thu, 25 Oct 2018 08:33:46 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 08:33:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,424,1534834800"; d="scan'208";a="100644687" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 25 Oct 2018 08:33:45 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Oct 2018 08:33:45 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.86]) by fmsmsx117.amr.corp.intel.com ([169.254.3.34]) with mapi id 14.03.0319.002; Thu, 25 Oct 2018 08:33:45 -0700 From: "Carsey, Jaben" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [edk2] [Patch 1/2 V2] BaseTools: Add $(INC)-like support when compiling .nasm files Thread-Index: AQHUbHQ0hLS77qG71EGzbaHvz3NNl6UwF0yA Date: Thu, 25 Oct 2018 15:33:45 +0000 Message-ID: References: <1540479913-9828-1-git-send-email-yonghong.zhu@intel.com> <1540479913-9828-2-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1540479913-9828-2-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTI5MzU0NjQtNGFiMy00NmM2LWI4M2MtYzU4NDM1Nzc1OTc4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZkhlOURiS3BUTWZZVDVtZjRVMmZ4a1VoM3NhSjFZb3NQRXdqQkNmYWhYbHZJVVhQeVczTWF6eEN0MTRldzV6SiJ9 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 V2] 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 15:33:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Yonghong Zhu > Sent: Thursday, October 25, 2018 8:05 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch 1/2 V2] 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 | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index b4377ee..f754f03 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,21 @@ 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 > + IncludePathList =3D [] > + for P in MyAgo.IncludePathList: > + IncludePath =3D self._INC_FLAG_['NASM'] + self.PlaceMacr= o(P, > self.Macros) > + if not P.endswith('\\'): > + IncludePath +=3D '\\' > + IncludePathList.append(IncludePath) > + > FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro_nam > e": "NASM_INC", "source_file": IncludePathList})) > + 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