blob: dfd957d157a589305b486c8a6e2e3eee2435174e [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7import re
8
9def map_arch(a):
10 if re.match('i.86', a):
11 return '386'
12 elif a == 'x86_64':
13 return 'amd64'
14 elif re.match('arm.*', a):
15 return 'arm'
16 elif re.match('aarch64.*', a):
17 return 'arm64'
18 elif re.match('mips64el.*', a):
19 return 'mips64le'
20 elif re.match('mips64.*', a):
21 return 'mips64'
22 elif a == 'mips':
23 return 'mips'
24 elif a == 'mipsel':
25 return 'mipsle'
26 elif re.match('p(pc|owerpc)(64le)', a):
27 return 'ppc64le'
28 elif re.match('p(pc|owerpc)(64)', a):
29 return 'ppc64'
30 elif a == 'riscv64':
31 return 'riscv64'
32 elif a == 'loongarch64':
33 return 'loong64'
34 return ''