]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/helpers/arch.py
1 # Copyright 2021 Oliver Smith
2 # SPDX-License-Identifier: GPL-3.0-or-later
7 machine
= platform
.machine()
16 if machine
in mapping
:
17 return maybe_remap(mapping
[machine
])
18 raise ValueError("platform.machine '" + machine
+ "'"
19 " architecture is not supported")
21 def maybe_remap(target
):
22 if target
.startswith("x86"):
23 with open("/proc/cpuinfo") as f
:
25 if "ssse3" not in cpuinfo
:
26 raise ValueError("x86/x86_64 CPU must support SSSE3!")
27 if target
== "x86_64" and "sse4_2" not in cpuinfo
:
28 logging
.info("x86_64 CPU does not support SSE4.2, falling back to x86...")
30 elif target
== "arm64" and platform
.architecture()[0] == "32bit":