From nobody Tue Apr 30 20:31:45 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+39390+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+39390+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1555989702; cv=none; d=zoho.com; s=zohoarc; b=k+aLrMc0S49F+GRsmfyig4DF0UvF4b/Z5DWai4NbCxCQT4HDHzTvCqO1hNRSUl0kSrWW+dt2X0Pp7+d0U8tOrQKtv2zxOhZ4cczaH4qkTAjQth0zKEZWDRPQn3E9DHKUn+c/j7Y6XKjbUbi3LN5NlZBK3N11RqK1Lmh23jT+4Kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555989702; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=BML0XkeWVT+WjHYsQDha/ktl+dHEXsJ4vydJZ/F6+/M=; b=mdYhXfn8edqVGSFZ/Lgs33ne5CxmzLuXKvefQZDltl32zmmNJv20r5uBRqCcB9PRe+b4ekWSFTkTLtDKYN73tmz5LEhKAduuZgHUG25dQ1glJz6sL4uyBxwOQo9A7OSDaaNK+8addUM0mjJGI3AD7axK9wP2erMc1FL3mjFrFwo= 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+39390+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 1555989702004411.7341529507729; Mon, 22 Apr 2019 20:21:42 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 22 Apr 2019 20:21:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Apr 2019 20:21:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,384,1549958400"; d="scan'208";a="137954948" X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 22 Apr 2019 20:21:39 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch] BaseTools: Support customized compiling command Date: Tue, 23 Apr 2019 11:21:22 +0800 Message-Id: <20190423032122.29868-1-bob.c.feng@intel.com> MIME-Version: 1.0 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,bob.c.feng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1555989701; bh=fNjZU2hyeN8gNPQTkUkxC5SYmUtL1LrN4m0jdCJeFJ4=; h=Cc:Date:From:Reply-To:Subject:To; b=BcyJKYigCGugqfE8Kdp1xA5D1AcwuW3HBl+BgyHegGYqNxDKGvzQrNlEJkVxeKTGHYj EC6ncH3Mnia92mXtbKZDm9amBzXItHEFHjlui01P1IWFMy79GYNxL9ptzplF2m62o0j+O Gmcp154Ut0ZAufxj1YZxhdPS7cShIEE9tr8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1737 User may add other commands before CC command from build_rule.txt for specific purpose. It worked fine before commit 05217d210e. This patch is going to fix the bug in commit 05217d210e to support customized CC command. Signed-off-by: Bob Feng Cc: Liming Gao Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/GenMake.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index 7562dc68b3..0513807f4f 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1022,11 +1022,11 @@ cleanlib: CmdCppDict[item.Target.SubDir].append(Path) if T.Commands: CommandList =3D T.Commands[:] for Item in CommandList[:]: SingleCommandList =3D Item.split() - if len(SingleCommandList) > 0 and '$(CC)' in SingleCommand= List[0]: + if len(SingleCommandList) > 0 and self.CheckCCCmd(SingleCo= mmandList): for Temp in SingleCommandList: if Temp.startswith('/Fo'): CmdSign =3D '%s%s' % (Temp.rsplit(TAB_SLASH, 1= )[0], TAB_SLASH) break else: continue @@ -1042,10 +1042,15 @@ cleanlib: T.Commands[Index] =3D '%s\n\t%s' % (' \\\n\t'.join= (Cpplist), CmdTargetDict[CmdSign]) else: T.Commands.pop(Index) return T, CmdSumDict, CmdTargetDict, CmdCppDict =20 + def CheckCCCmd(self, CommandList): + for cmd in CommandList: + if '$(CC)' in cmd: + return True + return False ## For creating makefile targets for dependent libraries def ProcessDependentLibrary(self): for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList: if not LibraryAutoGen.IsBinaryModule and not LibraryAutoGen.Ca= nSkipbyHash(): self.LibraryBuildDirectoryList.append(self.PlaceMacro(Libr= aryAutoGen.BuildDir, self.Macros)) --=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 (#39390): https://edk2.groups.io/g/devel/message/39390 Mute This Topic: https://groups.io/mt/31305514/1787277 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-