diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6fcb2d1c129..b3bc0f22652 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,10 +52,11 @@ jobs: vmImage: "ubuntu-latest" container: "quay.io/pypa/manylinux2014_x86_64:latest" steps: - - script: curl -L -o /tmp/arm-toolchain.tar.xz 'https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz?rev=22c39fc25e5541818967b4ff5a09ef3e&hash=E7676169CE35FC2AAECF4C121E426083871CA6E5' + - script: curl -L -o /tmp/arm-toolchain.tar.xz 'https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz?rev=33c6e30e5ac64e6dba8f0431f2c35f1b&hash=9918A05BF47621B632C7A5C8D2BB438FB80A4480' - script: mkdir -p /tmp/arm-toolchain/ - script: tar xf /tmp/arm-toolchain.tar.xz -C /tmp/arm-toolchain/ --strip-components=1 - script: echo '##vso[task.prependpath]/tmp/arm-toolchain/bin' + - script: echo '##vso[task.prependpath]/tmp/arm-toolchain/aarch64-none-linux-gnu/libc/usr/bin' - script: echo $PATH - script: stat /tmp/arm-toolchain/bin/aarch64-none-linux-gnu-gcc - task: PythonScript@0 @@ -65,15 +66,6 @@ jobs: scriptPath: scripts/mk_unix_dist.py arguments: --nodotnet --nojava --arch=arm64 pythonInterpreter: $(python) - - script: git clone https://github.com/z3prover/z3test z3test - displayName: 'Clone z3test' - - task: PythonScript@0 - displayName: Test - inputs: - scriptSource: 'filepath' - scriptPath: z3test/scripts/test_benchmarks.py - arguments: build-dist/z3 z3test/regressions/smt2 - pythonInterpreter: $(python) - task: CopyFiles@2 inputs: sourceFolder: dist diff --git a/scripts/mk_unix_dist.py b/scripts/mk_unix_dist.py index 55c8ccf3145..d967e91098a 100644 --- a/scripts/mk_unix_dist.py +++ b/scripts/mk_unix_dist.py @@ -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" diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 294f4f947ab..51533dd8e2b 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -203,10 +203,11 @@ stages: vmImage: "ubuntu-latest" container: "quay.io/pypa/manylinux2014_x86_64:latest" steps: - - script: curl -L -o /tmp/arm-toolchain.tar.xz 'https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz?rev=22c39fc25e5541818967b4ff5a09ef3e&hash=E7676169CE35FC2AAECF4C121E426083871CA6E5' + - script: curl -L -o /tmp/arm-toolchain.tar.xz 'https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz?rev=33c6e30e5ac64e6dba8f0431f2c35f1b&hash=9918A05BF47621B632C7A5C8D2BB438FB80A4480' - script: mkdir -p /tmp/arm-toolchain/ - script: tar xf /tmp/arm-toolchain.tar.xz -C /tmp/arm-toolchain/ --strip-components=1 - script: echo '##vso[task.prependpath]/tmp/arm-toolchain/bin' + - script: echo '##vso[task.prependpath]/tmp/arm-toolchain/aarch64-none-linux-gnu/libc/usr/bin' - script: echo $PATH - script: stat /tmp/arm-toolchain/bin/aarch64-none-linux-gnu-gcc - task: PythonScript@0