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

add Linux/ARM64 cross-compilation support #425

Closed
wants to merge 2 commits into from

Commits on Jun 10, 2024

  1. add Linux/ARM64 cross-compilation support

    Currently, the Makefile assumes the LLVM toolchain it builds can be executed
    natively to build `wasi-libc` etc., which isn't true when cross-compiling for
    another platform, but we can work around that by:
    
    1. Building the native LLVM toolchain and using it to build everything else, as usual
    2. Deleting that LLVM build and rebuilding (and reinstalling) it with `LLVM_CMAKE_FLAGS` set to cross compile
    3. Rebuilding and reinstalling a cross-compiled `wasm-component-ld`
    4. Building deb and tar files from the above
    
    Note that we now label the tarfiles `linux-amd64` and `linux-arm64`,
    respectively for clarity.
    
    The whole approach is a bit hacky, but GitHub is planning to roll out ARM64
    runner support for open source projects later this year, at which point we can
    start building natively, so I don't think we need to invest a lot of effort into
    this.
    
    I've run CI in my fork and verified the artifact produced there works on my
    Ubuntu 24.04 ARM64 machine (Asahi Linux on an Apple M2 Pro).
    
    Fixes WebAssembly#236
    Fixes WebAssembly#347
    
    Signed-off-by: Joel Dice <[email protected]>
    dicej committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    946b725 View commit details
    Browse the repository at this point in the history
  2. derive Linux tar suffix based on uname -m

    Signed-off-by: Joel Dice <[email protected]>
    dicej committed Jun 10, 2024
    Configuration menu
    Copy the full SHA
    aa8cc1c View commit details
    Browse the repository at this point in the history