3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 22:23:22 +00:00

Downgrade arm cross compile toolchain to glibc 2.34 (#7153)

This commit is contained in:
Steven Moy 2024-03-06 20:14:06 -08:00 committed by GitHub
parent 364da19122
commit e873664fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 13 deletions

View file

@ -171,12 +171,22 @@ def mk_z3():
return 1
def get_os_name():
global LINUX_X64
if OS_NAME is not None:
return OS_NAME
import platform
basic = os.uname()[0].lower()
if basic == 'linux':
dist = platform.libc_ver()
if mk_util.IS_ARCH_ARM64 and LINUX_X64:
# handle cross compiling
# example: 'ldd (GNU) 2.34'
lines = subprocess.check_output(["ldd", "--version"]).decode('ascii')
first_line = lines.split("\n")[0]
ldd_version = first_line.split()[-1]
# coerce the format to platform.libc_ver() return type
dist = ('glibc', ldd_version)
else:
dist = platform.libc_ver()
if len(dist) == 2 and len(dist[0]) > 0 and len(dist[1]) > 0:
return '%s-%s' % (dist[0].lower(), dist[1].lower())
else:
@ -199,8 +209,14 @@ def get_os_name():
return basic
def get_z3_name():
import platform as platform_module
# Note that the platform name this function return
# has to work together with setup.py
# It's not the typical output from platform.machine()
major, minor, build, revision = get_version()
if mk_util.IS_ARCH_ARM64:
if mk_util.IS_ARCH_ARM64 or platform_module.machine() == "aarch64":
# the second case handle native build on aarch64
# TODO: we don't handle cross compile on host aarch64 to target x64
platform = "arm64"
elif sys.maxsize >= 2**32:
platform = "x64"