Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tier 1 Support for ARM 64-bit (aarch64) Linux #2443

Open
5 of 6 tasks
andrewrk opened this issue May 7, 2019 · 22 comments
Open
5 of 6 tasks

Tier 1 Support for ARM 64-bit (aarch64) Linux #2443

andrewrk opened this issue May 7, 2019 · 22 comments
Labels
arch-aarch64 64-bit ARM contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-linux standard library This issue involves writing Zig code for the standard library. tier system Issues that track the support tier for a platform.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented May 7, 2019

Once all these items are complete, we can say that Zig has Tier 1 support for 64-bit ARM Linux.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library. os-linux arch-aarch64 64-bit ARM labels May 7, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone May 7, 2019
@sepruitt
Copy link

Hello, I'm interested in this because I'm attempting an Android port of zig. I see that there are at least two free AArch64 linux CI services for OSS projects, Shippable and Drone. One of those can probably be set up once the test suite passes.

@SamTebbs33
Copy link
Contributor

Hello, I'm interested in this because I'm attempting an Android port of zig. I see that there are at least two free AArch64 linux CI services for OSS projects, Shippable and Drone. One of those can probably be set up once the test suite passes.

Thanks for finding those @sepruitt , I'll take a look at them once we have the tests passing, which I'm currently setting up a docker image for.

@shawnl
Copy link
Contributor

shawnl commented Jun 4, 2019

So things have gone backwards with the addition of libuserland.a. Better support of the C ABI is now necessary in order to get things working again. http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf

@andrewrk
Copy link
Member Author

andrewrk commented Jun 4, 2019

@shawnl Thanks for the notice. Looks like doing #661 would serve us well right now.

We do have C ABI tests in test/stage1/c_abi/ but right now the tests are disabled for non x86_64 architectures:

if (builtin.arch == builtin.Arch.x86_64) { // TODO add C ABI support for other architectures
cases.addBuildFile("test/stage1/c_abi/build.zig");
}

So I think the path forward here is

@markfirmware
Copy link
Contributor

FYI https://github.com/WorksOnArm/cluster
I might be able to help.

@SamTebbs33
Copy link
Contributor

FYI https://github.com/WorksOnArm/cluster
I might be able to help.

Thanks @markfirmware, looks like we'll have to submit an access request similar to https://github.com/WorksOnArm/cluster/issues/165

@shawnl
Copy link
Contributor

shawnl commented Jul 30, 2019

The biggest problem I ran into when trying to do this is the high memory requirements of the stage1 compiler, which means a much more expensive VPS.

@markfirmware
Copy link
Contributor

I can see that @shawnl has a ball rolling over at #2978.

@shawnl
Copy link
Contributor

shawnl commented Jul 31, 2019

@markfirmware I am spending 6e/mo however, and it would be nice to be able to use donated time instead.

@daurnimator
Copy link
Contributor

I have access to worksonarm and am setting up a CI runner.

@SamTebbs33
Copy link
Contributor

What's the CI status here? I'd like to help get arm support progressing.

@andrewrk
Copy link
Member Author

Most CI services do not have arm64 support.

I tried SourceHut's arm64 support but it's qemu based and took over 3 hours to even finish compiling. That's too slow. I spoke with Drew DeVault about this and the cost of arm64 server hardware was the main reason native arm64 is not available. He also ran a poll and found that outside of zig nobody really needed arm64 testing.

@daurnimator tried setting up a GitLab CI runner using the docker installation approach and ran into an open GitLab bug for arm64 that was a showstopper.

@shawnl has a shell-based GitLab runner instance running and it's on my to-do list to figure out how to integrate it into the CI.

@daurnimator
Copy link
Contributor

daurnimator commented Aug 19, 2019

@daurnimator tried setting up a GitLab CI runner using the docker installation approach and ran into an open GitLab bug for arm64 that was a showstopper.

I'm waiting for a response from @solidnerd via @vielmetti on a fix for this.

The bug was https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/725#note_198579090 currently assigned to @tmaczukin

@shawnl has a shell-based GitLab runner instance running and it's on my to-do list to figure out how to integrate it into the CI.

The issue with that approach is that it becomes very hard to "reset" the machine between runs. IMO it would be suitable for testing master, but not PRs from arbitrary users.
If you do have a solution to this, I've got the hardware (donated by WorksOnArm)

@SamTebbs33
Copy link
Contributor

SamTebbs33 commented Aug 22, 2019

Since we have the hardware, all we theoretically need is the build server that will interface with GitHub to build PRs. We discussed a few options on IRC and I suggested TeamCity, but Jenkins could be the best solution.

You can make it run for PRs and there's a docker image available that could run on the arm hardware. Running in docker could solve the "resetting" problem. I haven't experimented with this at all since I don't have my own arm hardware to run it on at the moment.

@andrewrk
Copy link
Member Author

andrewrk commented Sep 23, 2019

Good news -

With the merge of #3290, we are much closer to tier 1 support for Arm-64 bit linux. We now have userland qemu-based Continuous Integration test coverage for:

  • behavior, std lib, and compiler-rt tests for aarch64v8_5a-linux-none
  • behavior, std lib, and compiler-rt tests for aarch64v8_5a-linux-musl, statically linking against a zig-built musl
  • behavior, std lib, and compiler-rt tests for aarch64v8_5a-linux-gnu, dynamically linking against a zig-built glibc

However, some tests are disabled. The remaining issues to solve are:

Once these are solved, and we add test coverage for stack traces on aarch64 linux, 64-bit ARM linux can be promoted to a Tier 1 Supported target.

@vielmetti
Copy link

A couple of recently announced CI resources that might be of use here for arm64 builds:

Drone Cloud has arm64 native support available, announced at https://blog.drone.io/drone-announces-official-support-for-arm/

Travis CI now has arm64 support available as well, with an announcement at https://blog.travis-ci.com/2019-10-07-multi-cpu-architecture-support

In both cases you can connect this Github project codebase to these CI systems and test PRs as they happen - that might be a very suitable path to explore.

@andrewrk
Copy link
Member Author

Drone Cloud is working great. We now have binaries for ARM 64 bit available on the download page: https://ziglang.org/download/, and CI is hooked up.

So now it's down to getting all the tests passing. See the issues labeled "arch-arm64". When these are all solved, we should be able to run the full test suite in the CI script instead of only the behavior tests:

./zig build test-behavior
# TODO figure out why running docs is causing EBADF on dup2 in the child
# ./zig build docs
# TODO full test suite:
#./zig build test

@vielmetti
Copy link

It's been a few months since I checked in here; I see in #4457 there is at least one issue. How is it going for aarch64 Tier 1 support and what can I do to help?

@andrewrk
Copy link
Member Author

We are quite close. It will be time to re-evaluate this when the llvm10 branch is merged, which should solve most of the remaining issues. LLVM is about to cut rc4 and I expect that one to actually get released. Likely within 1-2 weeks.

@andrewrk
Copy link
Member Author

There are still some open issues for aarch64, which you can find by searching for the corresponding label, but even so, I think it's clear that this target now qualifies for Tier 1 Support.

I've updated ziglang.org accordingly.

Big thanks to Drone CI for the CI service and WorksOnARM for the beefy test box that we've been using to troubleshoot aarch64 issues. For example, I believe @LemonBoy took advantage of that machine in a heroic effort to solve #4832.

@andrewrk
Copy link
Member Author

andrewrk commented Apr 10, 2020

Sorry, I'm going to have to walk this back a little bit.

Tier 2 says:

Some tests may be disabled for these targets as we work toward Tier 1 support.

This is correct, and not planned to change the definitions of tiers. So it remains to get the disabled tests passing before we can claim Tier 1 support.

@andrewrk andrewrk reopened this Apr 10, 2020
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Apr 10, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 14, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@matu3ba
Copy link
Contributor

matu3ba commented Feb 9, 2023

Labels have changed, search for is:open is:issue label:arch-aarch64 -label:os-windows -label:os-macos (removing windows and macos as os) which returns as of writing 20 issues.

@alexrp alexrp added the tier system Issues that track the support tier for a platform. label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-aarch64 64-bit ARM contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. os-linux standard library This issue involves writing Zig code for the standard library. tier system Issues that track the support tier for a platform.
Projects
None yet
Development

No branches or pull requests

9 participants