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

-Z linker-flavor=ld.lld broken since nightly-2018-06-29 #52501

Closed
alecmocatta opened this issue Jul 18, 2018 · 2 comments
Closed

-Z linker-flavor=ld.lld broken since nightly-2018-06-29 #52501

alecmocatta opened this issue Jul 18, 2018 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug.

Comments

@alecmocatta
Copy link
Contributor

Per #39915, I've been using RUSTFLAGS=-Zlinker-flavor=ld.lld cargo build --target x86_64-unknown-linux-musl to, on my mac, compile for Linux. This broke when I upgraded recently.

alec$ RUSTFLAGS="-Z linker-flavor=ld.lld" cargo +nightly-2018-06-29 build --tests --verbose --target x86_64-unknown-linux-musl
       Fresh unicode-xid v0.1.0
       Fresh byteorder v1.2.3
       Fresh dtoa v0.4.3
       Fresh itoa v0.4.2
       Fresh proc-macro2 v0.4.6
       Fresh quote v0.6.3
       Fresh serde v1.0.70
       Fresh syn v0.14.4
       Fresh serde_json v1.0.22
       Fresh bincode v1.0.1
       Fresh serde_derive v1.0.70
       Fresh serde_closure v0.1.0 (file:///Users/alec/Documents/serde_closure)
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
alec$ RUSTFLAGS="-Z linker-flavor=ld.lld" cargo +nightly-2018-07-07 build --tests --verbose --target x86_64-unknown-linux-musl
       Fresh unicode-xid v0.1.0
       Fresh itoa v0.4.2
       Fresh byteorder v1.2.3
       Fresh dtoa v0.4.3
       Fresh proc-macro2 v0.4.6
       Fresh quote v0.6.3
       Fresh serde v1.0.70
       Fresh syn v0.14.4
       Fresh bincode v1.0.1
       Fresh serde_json v1.0.22
       Fresh serde_derive v1.0.70
   Compiling serde_closure v0.1.0 (file:///Users/alec/Documents/serde_closure)
     Running `rustc --crate-name serde_closure src/lib.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=da15495a1895345a -C extra-filename=-da15495a1895345a --out-dir /Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -C incremental=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/incremental -L dependency=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/Users/alec/Documents/serde_closure/target/debug/deps --extern bincode=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libbincode-25bfa2b23c4e50a1.rlib --extern serde=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libserde-863b31fb6448209f.rlib --extern serde_derive=/Users/alec/Documents/serde_closure/target/debug/deps/libserde_derive-fd090e5ae132a20a.dylib --extern serde_json=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libserde_json-f6c22624175f963f.rlib -Z linker-flavor=ld.lld`
error: linker `lld` not found====================================>     ] 13/14: serde_closure
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: Could not compile `serde_closure`.

Caused by:
  process didn't exit successfully: `rustc --crate-name serde_closure src/lib.rs --emit=dep-info,link -C debuginfo=2 --test -C metadata=da15495a1895345a -C extra-filename=-da15495a1895345a --out-dir /Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -C incremental=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/incremental -L dependency=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/Users/alec/Documents/serde_closure/target/debug/deps --extern bincode=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libbincode-25bfa2b23c4e50a1.rlib --extern serde=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libserde-863b31fb6448209f.rlib --extern serde_derive=/Users/alec/Documents/serde_closure/target/debug/deps/libserde_derive-fd090e5ae132a20a.dylib --extern serde_json=/Users/alec/Documents/serde_closure/target/x86_64-unknown-linux-musl/debug/deps/libserde_json-f6c22624175f963f.rlib -Z linker-flavor=ld.lld` (exit code: 101)
@kennytm kennytm added A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. A-cross Area: Cross compilation labels Jul 18, 2018
@alexcrichton
Copy link
Member

I believe this was caused by #51936 (cc @japaric) and can probably be fixed with -C linker=rust-lld

@kennytm kennytm removed the A-cross Area: Cross compilation label Jul 18, 2018
@alecmocatta
Copy link
Contributor Author

@alexcrichton You're spot on, thank you! Apologies for missing that.

I'm now seeing a different error (rust-lld: error: unknown -z value: ,relro,-z,now) but I'll look further into it and create a new issue if appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants