From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: bob.c.feng@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Mon, 01 Jul 2019 03:20:37 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2019 02:48:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,438,1557212400"; d="scan'208";a="168412396" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 01 Jul 2019 02:48:55 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Bob Feng Subject: [Patch 1/1] BaseTools: Fixed the issue of the CFlag for compile PcdValueInit.c Date: Mon, 1 Jul 2019 17:48:51 +0800 Message-Id: <20190701094851.19940-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This issue happens when using Structured PCD. Build tool use set to store the cflags for compile PcdValueInit.c, that is the order of cflags is disorder. This patch make -U, /U flags appear before -D, /D Cc: Liming Gao Signed-off-by: Bob Feng --- BaseTools/Source/Python/Workspace/DscBuildData.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 9f65ad54257d..985f8775259d 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2666,11 +2666,12 @@ class DscBuildData(PlatformBuildClassObject): if len(ArchBuildOptions.keys()) == 1: BuildOptions['COMMON'] |= (list(ArchBuildOptions.values())[0]) elif len(ArchBuildOptions.keys()) > 1: CommonBuildOptions = reduce(lambda x,y: x&y, ArchBuildOptions.values()) BuildOptions['COMMON'] |= CommonBuildOptions - ValueList = list(BuildOptions['COMMON']) + ValueList = [item for item in BuildOptions['COMMON'] if item.startswith((r"/U","-U"))] + ValueList.extend([item for item in BuildOptions['COMMON'] if item.startswith((r"/D", "-D"))]) CC_FLAGS += " ".join(ValueList) MakeApp += CC_FLAGS if sys.platform == "win32": MakeApp = MakeApp + PcdMakefileEnd -- 2.20.1.windows.1