-Z gcc-ld=lld fails again · Issue #101653 · rust-lang/rust (original) (raw)

I tried this code:

RUSTFLAGS='-Z gcc-ld=lld' cargo +nightly build --release

I expected to see this happen: it builds my crate.

Instead, this happened:

= note: rust-lld: error: library not found for -lcrt1.10.6.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

Meta

rustc --version --verbose:

rustc +nightly --version --verbose rustc 1.65.0-nightly (1120c5e01 2022-09-08) binary: rustc commit-hash: 1120c5e01df508de64fe6642f22fadeb574afd6d commit-date: 2022-09-08 host: x86_64-apple-darwin release: 1.65.0-nightly LLVM version: 15.0.0

I found in the invocation of cc

nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/gcc-ld" "-fuse-ld=lld" "--target=x86_64-apple-macosx10.7.0"

clang --version Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: x86_64-apple-darwin21.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin xcrun --sdk macosx --show-sdk-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk cc --print-target-triple x86_64-apple-darwin21.6.0

Backtrace

See #101504 (comment).