Skip to content

Commit 191e366

Browse files
committed
reintroduce arch_name map
1 parent 42c739f commit 191e366

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/penguin/config_patchers.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,25 @@ def set_arch_info(self, arch_identified):
373373
if arch is None:
374374
raise NotImplementedError(f"Architecture {arch_identified} not supported ({arch}, {endian})")
375375

376-
# We use 'powerpc64le' for now. TODO: consider 'powerpc64el'
377-
self.arch_name = arch_identified.replace("powerpc64el", "powerpc64le")
376+
# Map architecture names to config schema valid names
377+
if arch == "aarch64":
378+
self.arch_name = "aarch64"
379+
elif arch == "intel64":
380+
self.arch_name = "intel64"
381+
elif arch == "loongarch64":
382+
self.arch_name = "loongarch64"
383+
elif arch == "riscv64":
384+
self.arch_name = "riscv64"
385+
elif arch == "powerpc":
386+
self.arch_name = "powerpc"
387+
elif arch == "powerpc64":
388+
if endian == "el":
389+
self.arch_name = "powerpc64le" # powerpc64el -> powerpc64le for config schema
390+
else:
391+
self.arch_name = "powerpc64" # powerpc64eb -> powerpc64
392+
else:
393+
# For architectures like mips with endianness, construct the name
394+
self.arch_name = arch + endian
378395

379396
mock_config = {"core": {"arch": self.arch_name}}
380397
self.arch_dir = get_arch_subdir(mock_config)

0 commit comments

Comments
 (0)