Skip to content

Commit 2ff173a

Browse files
os-dmergify[bot]
authored andcommitted
BaseTools: Remove ARM32 Support
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 code from BaseTools. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
1 parent bc31103 commit 2ff173a

33 files changed

Lines changed: 57 additions & 1143 deletions

File tree

BaseTools/Bin/GccLto/liblto-arm.a

-2.05 KB
Binary file not shown.

BaseTools/Bin/GccLto/liblto-arm.s

Lines changed: 0 additions & 55 deletions
This file was deleted.

BaseTools/Conf/build_rule.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<Command.XCODE>
153153
"$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) $(CXX_FLAGS) -o ${dst} $(INC) ${src}
154154

155-
[C-Code-File.BASE.AARCH64,C-Code-File.SEC.AARCH64,C-Code-File.PEI_CORE.AARCH64,C-Code-File.PEIM.AARCH64,C-Code-File.BASE.ARM,C-Code-File.SEC.ARM,C-Code-File.PEI_CORE.ARM,C-Code-File.PEIM.ARM]
155+
[C-Code-File.BASE.AARCH64,C-Code-File.SEC.AARCH64,C-Code-File.PEI_CORE.AARCH64,C-Code-File.PEIM.AARCH64]
156156
<InputFile>
157157
?.c
158158

@@ -198,7 +198,7 @@
198198
Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iiii ${d_path}(+)${s_base}.ii
199199
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iiii
200200

201-
[Assembly-Code-File.COMMON.ARM,Assembly-Code-File.COMMON.AARCH64]
201+
[Assembly-Code-File.COMMON.AARCH64]
202202
# Remove --convert-hex for ARM as it breaks MSFT assemblers
203203
<InputFile.MSFT, InputFile.INTEL>
204204
?.asm, ?.Asm, ?.ASM

BaseTools/Conf/target.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ACTIVE_PLATFORM = EmulatorPkg/EmulatorPkg.dsc
2828
TARGET = DEBUG
2929

3030
# TARGET_ARCH List Optional What kind of architecture is the binary being target for.
31-
# One, or more, of the following, IA32, X64, EBC, ARM, AARCH64,
31+
# One, or more, of the following, IA32, X64, EBC, AARCH64,
3232
# RISCV64 or LOONGARCH64.
3333
# Multiple values can be specified on a single line, using
3434
# space characters to separate the values. These are used

BaseTools/Conf/tools_def.template

Lines changed: 11 additions & 325 deletions
Large diffs are not rendered by default.

BaseTools/Edk2ToolsBuild.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def ParseCommandLineOptions(self):
2727
ParserObj = argparse.ArgumentParser()
2828
ParserObj.add_argument("-t", "--tool_chain_tag", dest="tct", default="VS2022",
2929
help="Set the toolchain used to compile the build tools")
30-
ParserObj.add_argument("-a", "--target_arch", dest="arch", default=None, choices=[None, 'IA32', 'X64', 'ARM', 'AARCH64'],
30+
ParserObj.add_argument("-a", "--target_arch", dest="arch", default=None, choices=[None, 'IA32', 'X64', 'AARCH64'],
3131
help="Specify the architecture of the built base tools. Not specifying this will fall back to the default "
3232
"behavior, for Windows builds, IA32 target will be built, for Linux builds, target arch will be the same as host arch.")
3333
args = ParserObj.parse_args()
@@ -43,15 +43,13 @@ def GetWorkspaceRoot(self):
4343
def GetActiveScopes(self):
4444
''' return tuple containing scopes that should be active for this process '''
4545

46-
# Adding scope for cross compilers when building for ARM/AARCH64
46+
# Adding scope for cross compilers when building for AARCH64
4747
scopes = ('global',)
4848
if GetHostInfo().os == "Linux" and self.tool_chain_tag.lower().startswith("gcc"):
4949
if self.target_arch is None:
5050
return scopes
5151
if "AARCH64" in self.target_arch:
5252
scopes += ("gcc_aarch64_linux",)
53-
if "ARM" in self.target_arch:
54-
scopes += ("gcc_arm_linux",)
5553
return scopes
5654

5755
def GetLoggingLevel(self, loggerType):
@@ -131,10 +129,6 @@ def Go(self):
131129
VcToolChainArch = "x86"
132130
TargetInfoArch = "x86"
133131
OutputDir = "Win32"
134-
elif self.target_arch == "ARM":
135-
VcToolChainArch = "x86_arm"
136-
TargetInfoArch = "ARM"
137-
OutputDir = "Win32"
138132
elif self.target_arch == "X64":
139133
VcToolChainArch = "amd64"
140134
TargetInfoArch = "x86"
@@ -172,10 +166,6 @@ def Go(self):
172166
host_arch = "AARCH64"
173167
host_toolchain_arch = "amd64_arm64"
174168
TempOutputDir = os.path.join(shell_env.get_shell_var("EDK_TOOLS_PATH"), "Bin", "Win64")
175-
elif HostInfo.arch == "ARM" and HostInfo.bit == "32":
176-
host_arch = "ARM"
177-
host_toolchain_arch = "x86_arm"
178-
TempOutputDir = os.path.join(shell_env.get_shell_var("EDK_TOOLS_PATH"), "Bin", "Win32")
179169
else:
180170
raise Exception("Unsupported host system. %s %s" % (HostInfo.arch, HostInfo.bit))
181171

@@ -275,18 +265,6 @@ def Go(self):
275265
shell_environment.GetEnvironment().set_shell_var("GCC_PREFIX", prefix)
276266
TargetInfoArch = "ARM"
277267

278-
elif "ARM" in self.target_arch:
279-
prefix = shell_env.get_shell_var("GCC5_ARM_PREFIX")
280-
if prefix == None:
281-
# now check for install dir. If set then set the Prefix
282-
install_path = shell_environment.GetEnvironment().get_shell_var("GCC5_ARM_INSTALL")
283-
284-
# make GCC5_ARM_PREFIX to align with tools_def.txt
285-
prefix = os.path.join(install_path, "bin", "arm-none-linux-gnueabihf-")
286-
287-
shell_environment.GetEnvironment().set_shell_var("GCC_PREFIX", prefix)
288-
TargetInfoArch = "ARM"
289-
290268
else:
291269
TargetInfoArch = "x86"
292270
else:
@@ -320,8 +298,6 @@ def Go(self):
320298
pack_name = f"util-linux-{ver}"
321299
if "AARCH64" in self.target_arch:
322300
ret = RunCmd("sh", f"./configure --host=aarch64-linux -disable-all-programs --enable-libuuid CC={prefix}gcc", workingdir=unzip_dir)
323-
elif "ARM" in self.target_arch:
324-
ret = RunCmd("sh", f"./configure --host=arm-linux -disable-all-programs --enable-libuuid CC={prefix}gcc", workingdir=unzip_dir)
325301
if ret != 0:
326302
raise Exception(f"Failed to configure the util-linux to build with our gcc {ret}")
327303

BaseTools/Plugin/LinuxGccToolChain/LinuxGccToolChain.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# @file LinuxGccToolChain.py
2-
# Plugin to configures paths for GCC/GCC5 ARM/AARCH64/RISCV/LOONGARCH64 Toolchain
2+
# Plugin to configures paths for GCC/GCC5 AARCH64/RISCV/LOONGARCH64 Toolchain
33
##
44
# This plugin sets environment variables used in tools_def.template to specify the GCC compiler
55
# for the requested build architecture.
@@ -43,12 +43,6 @@ def do_pre_build(self, thebuilder):
4343
self.Logger.critical("Failed in check aarch64")
4444
return ret
4545

46-
# Check arm compiler
47-
ret = self._check_arm(toolchain)
48-
if ret != 0:
49-
self.Logger.critical("Failed in check arm")
50-
return ret
51-
5246
# Check RISCV64 compiler
5347
ret = self._check_riscv64(toolchain)
5448
if ret != 0:
@@ -63,28 +57,6 @@ def do_pre_build(self, thebuilder):
6357

6458
return 0
6559

66-
def _check_arm(self, toolchain):
67-
# check to see if full path already configured
68-
if shell_environment.GetEnvironment().get_shell_var(toolchain + "_ARM_PREFIX") is not None:
69-
self.Logger.info(toolchain + "_ARM_PREFIX is already set.")
70-
71-
else:
72-
# now check for install dir. If set then set the Prefix
73-
install_path = shell_environment.GetEnvironment().get_shell_var(toolchain + "_ARM_INSTALL")
74-
if install_path is None:
75-
return 0
76-
77-
# make the PREFIX to align with tools_def.txt
78-
prefix = os.path.join(install_path, "bin", "arm-none-linux-gnueabihf-")
79-
shell_environment.GetEnvironment().set_shell_var(toolchain + "_ARM_PREFIX", prefix)
80-
81-
# now confirm it exists
82-
if not os.path.exists(shell_environment.GetEnvironment().get_shell_var(toolchain + "_ARM_PREFIX") + "gcc"):
83-
self.Logger.error("Path for " + toolchain + "_ARM_PREFIX toolchain is invalid")
84-
return -2
85-
86-
return 0
87-
8860
def _check_aarch64(self, toolchain):
8961
# check to see if full path already configured
9062
if shell_environment.GetEnvironment().get_shell_var(toolchain + "_AARCH64_PREFIX") is not None:

BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def do_pre_build(self, thebuilder):
4343
# HostType for VS2017 should be (defined in tools_def):
4444
# x86 == 32bit Intel
4545
# x64 == 64bit Intel
46-
# arm == 32bit Arm
4746
# arm64 == 64bit Arm
4847
#
4948
HostType = shell_environment.GetEnvironment().get_shell_var("VS2017_HOST")
@@ -63,7 +62,7 @@ def do_pre_build(self, thebuilder):
6362

6463
# VS2017_HOST options are not exactly the same as QueryVcVariables. This translates.
6564
VC_HOST_ARCH_TRANSLATOR = {
66-
"x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
65+
"x86": "x86", "x64": "AMD64", "arm64": "not supported"}
6766

6867
# check to see if full path already configured
6968
if shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX") != None:
@@ -116,7 +115,6 @@ def do_pre_build(self, thebuilder):
116115
# HostType for VS2019 should be (defined in tools_def):
117116
# x86 == 32bit Intel
118117
# x64 == 64bit Intel
119-
# arm == 32bit Arm
120118
# arm64 == 64bit Arm
121119
#
122120
HostType = shell_environment.GetEnvironment().get_shell_var("VS2019_HOST")
@@ -136,7 +134,7 @@ def do_pre_build(self, thebuilder):
136134

137135
# VS2019_HOST options are not exactly the same as QueryVcVariables. This translates.
138136
VC_HOST_ARCH_TRANSLATOR = {
139-
"x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
137+
"x86": "x86", "x64": "AMD64", "arm64": "not supported"}
140138

141139
# check to see if full path already configured
142140
if shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX") != None:
@@ -189,7 +187,6 @@ def do_pre_build(self, thebuilder):
189187
# HostType for VS2022 should be (defined in tools_def):
190188
# x86 == 32bit Intel
191189
# x64 == 64bit Intel
192-
# arm == 32bit Arm
193190
# arm64 == 64bit Arm
194191
#
195192
HostType = shell_environment.GetEnvironment().get_shell_var("VS2022_HOST")
@@ -209,7 +206,7 @@ def do_pre_build(self, thebuilder):
209206

210207
# VS2022_HOST options are not exactly the same as QueryVcVariables. This translates.
211208
VC_HOST_ARCH_TRANSLATOR = {
212-
"x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
209+
"x86": "x86", "x64": "AMD64", "arm64": "not supported"}
213210

214211
# check to see if full path already configured
215212
if shell_environment.GetEnvironment().get_shell_var("VS2022_PREFIX") is not None:
@@ -265,7 +262,6 @@ def do_pre_build(self, thebuilder):
265262
# HostType for VS tools should be (defined in tools_def):
266263
# x86 == 32bit Intel
267264
# x64 == 64bit Intel
268-
# arm == 32bit Arm
269265
# arm64 == 64bit Arm
270266
#
271267
HostType = shell_environment.GetEnvironment().get_shell_var("CLANG_VS_HOST")
@@ -286,7 +282,7 @@ def do_pre_build(self, thebuilder):
286282

287283
# CLANG_VS_HOST options are not exactly the same as QueryVcVariables. This translates.
288284
VC_HOST_ARCH_TRANSLATOR = {
289-
"x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
285+
"x86": "x86", "x64": "AMD64", "arm64": "not supported"}
290286

291287
# now get the environment variables for the platform
292288
shell_env = shell_environment.GetEnvironment()

BaseTools/Scripts/ConvertMasmToNasm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class NoSourceFile(Exception):
2828

2929

3030
class UnsupportedArch(Exception):
31-
unsupported = ('aarch64', 'arm', 'ebc', 'ipf')
31+
unsupported = ('aarch64', 'ebc', 'ipf')
3232

3333

3434
class CommonUtils:

BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def InitializeConfigFile(self):
157157
self._configFile.AddPreDefined('MDE_CPU_X64')
158158
self._configFile.AddPreDefined('MDE_CPU_IPF')
159159
self._configFile.AddPreDefined('MDE_CPU_EBC')
160-
self._configFile.AddPreDefined('MDE_CPU_ARM')
161160

162161
namestr = self._pObj.GetName()
163162
if self._arch is not None:
@@ -271,7 +270,7 @@ def GenerateIncludesSubPage(self, pObj, configFile):
271270
self.ProcessSourceFileForInclude(fullpath, pObj, configFile)
272271
topPage.AddDescription('<li> \link %s\endlink </li>\n' % self._ConvertPathToDoxygen(fullpath, pObj))
273272
else:
274-
if file.lower() in ['library', 'protocol', 'guid', 'ppi', 'ia32', 'x64', 'ipf', 'ebc', 'arm', 'pi', 'uefi', 'aarch64']:
273+
if file.lower() in ['library', 'protocol', 'guid', 'ppi', 'ia32', 'x64', 'ipf', 'ebc', 'pi', 'uefi', 'aarch64']:
275274
continue
276275
bNeedAddSubPage = False
277276
subpage = doxygen.Page(self._ConvertPathToDoxygen(fullpath, pObj), 'public_include_%s' % file)

0 commit comments

Comments
 (0)