From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com []) by mx.groups.io with SMTP id smtpd.web10.8064.1618370888171322791 for ; Tue, 13 Apr 2021 20:28:08 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@intel.com) IronPort-SDR: dovu8CFP0GNZJgAMB/CT5BlLKomFeO5ef/k+t3NZiJ7ljSe3+NGhUmujmTcPPm2BOsv8wkhPcq 6dn/V6H8lAtw== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="181679512" X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="181679512" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 20:28:07 -0700 IronPort-SDR: e7f/y2nBhAsjlLiSofUBHPlicuP8MB/R/S1DTs1cyKw7GOPBHKZuhi9oPEvvGlIue1ukAM67vh EpQ10NpMnOdg== X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="418124859" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.255.231.15]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 20:28:07 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen , Andrew Fish , Abner Chang Subject: [Patch v2 4/4] BaseTools/Source/Python: Remove CPU architecture assumptions Date: Tue, 13 Apr 2021 20:27:58 -0700 Message-Id: <20210414032758.1818-5-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20210414032758.1818-1-michael.d.kinney@intel.com> References: <20210414032758.1818-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3308 The EDK II Build Specifications do not restrict the set of CPU architectures that can be supported. Remove places in the EDK II that assume a fixed set of CPU architectures. Remove build breaks in the following tools when a check against a fixed set of CPU architectures is made. * Build * GenFds * TargetTool Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Andrew Fish Cc: Abner Chang Signed-off-by: Michael D Kinney --- BaseTools/Source/Python/GenFds/FdfParser.py | 4 +--- BaseTools/Source/Python/TargetTool/TargetTool.py | 4 ++-- BaseTools/Source/Python/build/buildoptions.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index ea2401b0e4fc..5c8263f9bcc9 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1,7 +1,7 @@ ## @file # parse FDF file # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -3504,8 +3504,6 @@ class FdfParser: raise Warning.Expected("'.'", self.FileName, self.CurrentLineNumber) Arch = self._SkippedChars.rstrip(TAB_SPLIT) - if Arch.upper() not in ARCH_SET_FULL: - raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber) ModuleType = self._GetModuleType() diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/Source/Python/TargetTool/TargetTool.py index 8e0ca387c356..71222e3cc899 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -1,7 +1,7 @@ ## @file # Target Tool Parser # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -197,7 +197,7 @@ def RangeCheckCallback(option, opt_str, value, parser): def MyOptionParser(): parser = OptionParser(version=__version__, prog="TargetTool.exe", usage=__usage__, description=__copyright__) - parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', '0'], dest="TARGET_ARCH", + parser.add_option("-a", "--arch", action="append", dest="TARGET_ARCH", help="ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option. 0 will clear this setting in target.txt and can't combine with other value.") parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback, help="Specify a DSC file, which replace target.txt's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and can't combine with other value.") diff --git a/BaseTools/Source/Python/build/buildoptions.py b/BaseTools/Source/Python/build/buildoptions.py index 094af4e2a8dd..39d92cff209d 100644 --- a/BaseTools/Source/Python/build/buildoptions.py +++ b/BaseTools/Source/Python/build/buildoptions.py @@ -2,7 +2,7 @@ # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) 2018 - 2020, Hewlett Packard Enterprise Development, L.P.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -40,7 +40,7 @@ class MyOptionParser(): def GetOption(self): Parser = OptionParser(description=__copyright__, version=__version__, prog="build.exe", usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]") - Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', 'RISCV64'], dest="TargetArch", + Parser.add_option("-a", "--arch", action="append", dest="TargetArch", help="ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.") Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback, help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.") -- 2.31.1.windows.1