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

Aarch64-Windows: Cannot build libcore with exception handling enabled #54291

Open
michaelwoerister opened this issue Sep 17, 2018 · 1 comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-AArch64 Armv8-A or later processors in AArch64 mode O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@michaelwoerister
Copy link
Member

Trying to cross-compile libcore for aarch64-pc-windows-msvc fails with (see also #54190 (comment)):

Building stage2 test artifacts (x86_64-pc-windows-msvc -> aarch64-pc-windows-msvc)
   Compiling term v0.0.0 (file:///C:/msys64/home/mw/2-rust/src/libterm)
   Compiling getopts v0.2.17
   Compiling test v0.0.0 (file:///C:/msys64/home/mw/2-rust/src/libtest)
error: cannot link together two panic runtimes: panic_abort and panic_unwind

error: aborting due to previous error

error: Could not compile `test`.

(Note, one has to use link.exe instead of LLD as the linker (see #54290) in order to get that far.)

The underlying problem is (probably) that aarch64-pc-windows-msvc defaults to panic_abort, while libstd is unconditionally compiled with panic_unwind. All other targets that hard-code panic_abort are probably #[no_std]?

Making aarch64-pc-windows-msvc use panic_unwind like the other non-embedded platforms leads to LLVM running into an error while trying to compile libcore:

   Compiling core v0.0.0 (file:///C:/msys64/home/mw/2-rust/src/libcore)
LLVM ERROR: Cannot select: t10: ch = cleanupret t9, libcore\str\mod.rs:3734 @[ libcore\str\mod.rs:3563 ]
In function: _ZN4core3str21_$LT$impl$u20$str$GT$4trim17hd88bcddf6e49abc8E
error: Could not compile `core`.
@csmoe csmoe added the O-windows-msvc Toolchain: MSVC, Operating system: Windows label Sep 18, 2018
@michaelwoerister
Copy link
Member Author

It looks like there's already an LLVM upstream bug report here: https://bugs.llvm.org/show_bug.cgi?id=38341. It looks like exception handling for WinARM64 will land soon: https://bugs.llvm.org/show_bug.cgi?id=38341#c5

@jonas-schievink jonas-schievink added O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 9, 2019
@workingjubilee workingjubilee added O-AArch64 Armv8-A or later processors in AArch64 mode and removed O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-AArch64 Armv8-A or later processors in AArch64 mode O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants