-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
No rustc or cargo for aarch64-pc-windows-msvc #72881
Comments
I've managed to cross-compile rustc, cargo and most of the default components now after fixing a build issue in a dependency (psm), but unfortunately the built compiler doesn't work. Trying to compile the default "hello world" project fails silently when using rustc directly, and cargo fails with a "STATUS_ACCESS_VIOLATION" error, which seems to be a memory-related issue. |
I have also been experimenting with this on our side! I had successfully built a rustc using older source code (April 30th nightly comes to mind), but the STATUS_ACCESS_VIOLATION errors started happening after the stacker/psm dependency got added, so I investigated that for a bit and just raised this: I think that just adding a dummy area name might solve that. I haven't tested this properly for rustc, yet, though. The latest I got to last was getting problems with my stage0 being too old to compile current head-of-trunk-nightly. I also had issues with compiling RLS due to the use of the old winapi 0.2.8, through mio 0.6.X and tokio, but this should fix itself when tokio fully updates to mio 0.7 instead of mio 0.6.X (see tokio-rs/tokio#1190 ) |
@Stammark Thanks for the tip! Adding a dummy area name in Compilation times are greatly improved in my limited testing (I've seen 40-50% reductions so far, I'll compile a few popular projects to get some accurate numbers which I'll post here). One issue that I've noticed is that it fails to find
I noticed the same issue myself when doing an extended build, fortunately rust-analyzer works well on ARM64 when built from source and the rest of the tools (cargo, clippy, rustfmt, rust-src and rustdoc) compile fine, although I haven't tested them yet. |
Regarding psm: rust-lang/stacker#37 (and our PR), so that should be good when the next deps bump happens! Agreed on link.exe, I'm basically still doing the same thing as you by using the vcvarsx86_arm64 script to set up environment variables. For changes in Also, massive thank you for the contributions! |
Yep, I'd just seen those fixes on
That sounds great, I'll have a look into adding support for this target to the release builders.
Thanks for all your help! I'd have been lost without you pointing out that silent assembly error! |
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
I've been working on getting the cross-build of aarch64 working so we can add it to the CI builders. rust-lang/cc-rs#524 fixes the failure to run the aarch64 https://reviews.llvm.org/D83022 resolves an issue where the LLVM cross build recurses and tries to do a native build of arlosi/rust@7b73704 has the updates to the Rust build to use the new LLVM_NM option and set the With all that in place, I can cross-build for aarch64-pc-windows-msvc from x86_64-pc-windows-msvc from a normal command prompt with |
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
Update psm version This new version includes a fix for building on aarch64 windows. cc rust-lang#72881
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Fix cross compilation of LLVM to aarch64 Windows targets When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for each cross-compilation target. Related issue: rust-lang#72881 Requires LLVM change: rust-lang/llvm-project#67
Hi, what's the status of this so far? I've recently bought a Surface Pro X so I would be happy to help out if I can. There are two things that I've found recently:
Would it make sense to try to build the compiler on an Arm64 machine? Also, I see there is a tracking issue to Use lld by default on x64 msvc windows. Would it make sense to create a similar issue for aarch64 msvc windows? Additionally, would it probably make sense to try and use Given this, plus the fact that the latest Visual Studio Code runs natively on Arm64, the full development toolchain could be successfully used on Windows on Arm64. |
Hi Alexander! Things are much better now that Arlo's changes have all been merged. We can easily cross-compile a native compiler and then use that in a fully-aarch64-native-build, but the MSVC toolchain (which is not aarch64-native) is still needed for the linker and the libraries.
Yes it would! Especially if you plan on using the Surface as a host machine (compile on it), not just a target (compile on some x86 machine to
I'm not very familiar enough with how this works to comment, but I'd guess that there's nothing wrong with creating a similar issue for aarch64 or commenting there for added aarch64 support. Maybe one of the MS folks or @JamieCunliffe have more insight :D
Yes it does! I had only tried an x86_32 clang-cl at the time but native should be just as possible. This also gets around some intermittent failures when compiling LLVM with MSVC's cl.exe (but this was a while back and may have been fixed now).
No idea! But I want to try this now. I always relied on the x86_32 version. I'll paste here the ./configure options I used last time I looked at this (these generate a config.toml). Note that an MSVC installation with all ARM64 workloads is needed for this (the installation gets auto-detected) and I was running in MSYS2-32bit (Mingw-w64 32 bit command line) with the following packages:
Step 1: Cross-compile (this will take FOREVER):
(that was a x86_32 clang-cl from the LLVM releases but a native one should work fine, too) and then Step 2: Fully native build:
and then EDIT: To update on the second one, I realised that this one won't work out-of-the-box with the MSVC auto-detection in cc-rs. Instead, it can be run in cmd in a vcvarsall environment (e.g. by running (in both cases RLS will fail btw) |
Promote aarch64-pc-windows-msvc to Tier 2 Development Platform Adds a GitHub Actions CI build for `aarch64-pc-windows-msvc` via cross-compilation on an x86_64 host. This promotes `aarch64-pc-windows-msvc` from a Tier 2 Compilation Target (std) to a Tier 2 Development Platform (std+rustc+cargo+tools). Fixes rust-lang#72881 r? `@pietroalbini`
@arlosi Nice to see that it has been promoted to Tier 2 Development Platform! However, how can it be used? 🙃 When I try to install it using rustup-init.exe, I get an error that there is no such platform:
|
I can submit that now 👍 |
Oh, logged in to do just that 😅 Please go ahead @arlosi 🙂 |
Include aarch64-pc-windows-msvc in the dist manifests r? @ehuss /cc @pietroalbini @Mark-Simulacrum rust-lang#72881
Currently there are no native rustc or cargo binaries for Windows on ARM64. The 32-bit x86 binaries (i686-pc-windows-msvc) work correctly, but suffer a noticeable performance and battery life penalty.
I've tried to build rustc myself, but have had quite a few issues trying to cross-compile it since there are no pre-built bootstrap binaries for aarch64-pc-windows-msvc. Cargo builds without issue, but doesn't make much sense without a native rustc.
What would it take to get this working and available via rustup? I'm happy to keep working on this myself but am slightly lost as to how to proceed.
The text was updated successfully, but these errors were encountered: