]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Source/Python: Remove CPU architecture assumptions
authorMichael D Kinney <michael.d.kinney@intel.com>
Wed, 14 Apr 2021 03:11:48 +0000 (20:11 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 15 Apr 2021 15:58:44 +0000 (15:58 +0000)
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 <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/TargetTool/TargetTool.py
BaseTools/Source/Python/build/buildoptions.py

index ea2401b0e4fc4cde1dfcf8131b194bd06e73b7b5..5c8263f9bcc984e1d05d20b5b2db1560c00cae65 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # parse FDF file\r
 #\r
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -3504,8 +3504,6 @@ class FdfParser:
             raise Warning.Expected("'.'", self.FileName, self.CurrentLineNumber)\r
 \r
         Arch = self._SkippedChars.rstrip(TAB_SPLIT)\r
-        if Arch.upper() not in ARCH_SET_FULL:\r
-            raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)\r
 \r
         ModuleType = self._GetModuleType()\r
 \r
index 8e0ca387c356c3879845720b47a7fe2407ff5e70..71222e3cc89997fcff82608ee536e08d8b78a7ac 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Target Tool Parser\r
 #\r
-#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -197,7 +197,7 @@ def RangeCheckCallback(option, opt_str, value, parser):
 \r
 def MyOptionParser():\r
     parser = OptionParser(version=__version__, prog="TargetTool.exe", usage=__usage__, description=__copyright__)\r
-    parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', '0'], dest="TARGET_ARCH",\r
+    parser.add_option("-a", "--arch", action="append", dest="TARGET_ARCH",\r
         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.")\r
     parser.add_option("-p", "--platform", action="callback", type="string", dest="DSCFILE", callback=SingleCheckCallback,\r
         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.")\r
index 094af4e2a8dd5cf577e2b19d03e267cfd7b591c6..39d92cff209d9bf2d2afeb985d745c2874e4f408 100644 (file)
@@ -2,7 +2,7 @@
 # build a platform or a module\r
 #\r
 #  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
-#  Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2018 - 2020, Hewlett Packard Enterprise Development, L.P.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -40,7 +40,7 @@ class MyOptionParser():
 \r
     def GetOption(self):\r
         Parser = OptionParser(description=__copyright__, version=__version__, prog="build.exe", usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")\r
-        Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32', 'X64', 'EBC', 'ARM', 'AARCH64', 'RISCV64'], dest="TargetArch",\r
+        Parser.add_option("-a", "--arch", action="append", dest="TargetArch",\r
             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.")\r
         Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,\r
             help="Build the platform specified by the DSC file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")\r