Closed
Description
λ cargo new test-linkage
λ cd test-linkage
λ cat src/lib.rs
#![feature(linkage)]
#[linkage = "extern_weak"]
pub static TEST: bool = false;
λ env RUST_BACKTRACE=1 cargo build --verbose # OR
λ env RUST_BACKTRACE=1 cargo build --verbose --target x86_64-unknown-linux-gnu
Compiling test-linkage v0.1.0 (file:///C:/Users/Matt%20Ickstadt/Code/Rust/test-linkage)
Running `rustc src\lib.rs --crate-name test_linkage --crate-type lib -g --out-dir "C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug" --emit=dep-info,link --target x86_64-unknown-linux-gnu -L "dependency=C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug" -L "dependency=C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug\deps"`
Don't know how to emit these
UNREACHABLE executed at C:/bot/slave/nightly-dist-rustc-win-gnu-32/build/src/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:336!
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
error: Could not compile `test-linkage`.
Caused by:
Process didn't exit successfully: `rustc src\lib.rs --crate-name test_linkage --crate-type lib -g --out-dir C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug --emit=dep-info,link --target x86_64-unknown-linux-gnu -L dependency=C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug -L dependency=C:\Users\Matt Ickstadt\Code\Rust\test-linkage\target\x86_64-unknown-linux-gnu\debug\deps` (exit code: 3)
Nothing too unexpected, since most targets don't support weak linkage. The error message could be a bit better though, rather than panicing in LLVM.
I was a bit surprised that this problem persists when cross compiling to supported targets, but I suppose that its an LLVM limitation, and a very niche one at that.
cc #29603
Metadata
Metadata
Assignees
Labels
No labels