From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web09.4956.1666687892816411757 for ; Tue, 25 Oct 2022 01:51:32 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=LbugU+gT; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: yuwei.chen@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666687892; x=1698223892; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AdObGANYQx+CUxTrIO/ME6TGWvXm/VdWVMhs1o6N6FI=; b=LbugU+gTv/Jk+tmSTiPKQu/DFWxOFcohfTiurNuLrGQmLK4AJgVlvt8K o7ufQkIYFRrS1Zou5AmATvr7GT7/lJdLbrgQkHrhR+Il/DVCDZoSKbblA BDPPqH+n1GMExIgUXiGrlklcCRCkqScyJWhVEyuptf20NvF2jFlJ0EYtS iECAgMK4aJz6rc3iim1L2DNGCxSRU/tOmSNESr5vf0JIdlTDCGDkjDiKl WjQDzQ6O4hPgVuzhwptdbB+YB0sibhcr2KOaYpsESPlyT7Hx3a1R5eQBQ TEe4x9Z6YaPp5jPRFTrnbzV30mrZvdJqfH0KL16BAVZ6a4vutYKhKJ2uT w==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="393940543" X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="393940543" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 01:51:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="631561775" X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="631561775" Received: from yuweipc.ccr.corp.intel.com ([10.239.158.38]) by orsmga002.jf.intel.com with ESMTP; 25 Oct 2022 01:51:31 -0700 From: "Yuwei Chen" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue Date: Tue, 25 Oct 2022 16:51:28 +0800 Message-Id: <20221025085128.1760-1-yuwei.chen@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4081 INF [Sources] section Feature Flag Expressions do not use override values from build --pcd option currently. This patch fix this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- edk2basetools/Workspace/InfBuildData.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/edk2basetools/Workspace/InfBuildData.py b/edk2basetools/Workspace/InfBuildData.py index c97a70e..8631373 100644 --- a/edk2basetools/Workspace/InfBuildData.py +++ b/edk2basetools/Workspace/InfBuildData.py @@ -1055,6 +1055,7 @@ def IsBinaryModule(self): return False def CheckFeatureFlagPcd(self,Instance): Pcds = GlobalData.gPlatformFinalPcds.copy() + BuildOptionPcds = GlobalData.BuildOptionPcd if PcdPattern.search(Instance): PcdTuple = tuple(Instance.split('.')[::-1]) if PcdTuple in self.Pcds: @@ -1062,6 +1063,14 @@ def CheckFeatureFlagPcd(self,Instance): EdkLogger.error('build', FORMAT_INVALID, "\nFeatureFlagPcd must be defined in a [PcdsFeatureFlag] or [PcdsFixedAtBuild] section of Dsc or Dec file", File=str(self), ExtraData=Instance) + for item in BuildOptionPcds: + if self.Pcds[PcdTuple].TokenCName in item: + if type(item) == type(()): + # ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled', '', '1', ('build command options', 1) + Pcds[Instance] = list(item)[3] + elif type(item) == type(''): + # gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 + Pcds[Instance] = item.split('=')[1] if not Instance in Pcds: Pcds[Instance] = self.Pcds[PcdTuple].DefaultValue else: #if PcdTuple not in self.Pcds: @@ -1085,6 +1094,14 @@ def CheckFeatureFlagPcd(self,Instance): for Name, Guid in self.Pcds: if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name, Guid)].Type == 'FixedAtBuild': PcdFullName = '%s.%s' % (Guid, Name); + for item in BuildOptionPcds: + if Name in item: + if type(item) == type(()): + # ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled', '', '1', ('build command options', 1) + Pcds[PcdFullName] = list(item)[3] + elif type(item) == type(''): + # gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1 + Pcds[PcdFullName] = item.split('=')[1] if not PcdFullName in Pcds: Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue try: -- 2.27.0.windows.1