-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
This bug can be reproduced only by using two crates, nothing else worked so far
A
├── B
│ ├── Cargo.toml
│ └── src
│ └── lib.rs
├── Cargo.toml
└── src
└── main.rs
A::Cargo.toml
[package]
name = "A"
version = "0.1.0"
[profile.dev]
lto = "fat"
[dependencies]
B = { path = "./B" }
A::main.rs is empty (or just a plain fn main() {}
, doesn't matter).
B::Cargo.toml
[package]
name = "B"
version = "0.1.0"
[lib]
crate_type = ["rlib", "cdylib"]
B::src/lib.rs is empty as well (or any public function, doesn't matter as well)
When compiling this with cargo build
, it errors:
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,-plugin-opt=O0" "-Wl,-plugin-opt=mcpu=x86-64" "-L" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/tmp.DW07BccpbK/A/target/debug/deps/B.42q3kclfyl99cg7w.rcgu.o" "-o" "/tmp/tmp.DW07BccpbK/A/target/debug/deps/libB.so" "-Wl,--version-script=/tmp/rustcS2Vx8P/list" "/tmp/tmp.DW07BccpbK/A/target/debug/deps/B.4c2aglkwgm7gduii.rcgu.o" "-Wl,--gc-sections" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/tmp/tmp.DW07BccpbK/A/target/debug/deps" "-L" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-0126adaa107032a6.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-57961a3692c39401.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-9fa9e50746f44a4c.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-251012178f8196c3.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-cafd612ee1b4bf88.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-140b53dc81f0d53c.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-cbaa12f3d93cc54c.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-a5bcc2d112e5a391.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-5ada18586d2652e2.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ac41f78688451395.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b1966f66603f91b6.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-428d15b56101bdc7.rlib" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-941f7f6bc622e313.rlib" "-Wl,--end-group" "/home/marcel/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e915d31ab7edbbd4.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil" "-shared"
= note: /tmp/tmp.DW07BccpbK/A/target/debug/deps/B.42q3kclfyl99cg7w.rcgu.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Meta
rustc --version --verbose
:
rustc 1.45.0-nightly (a74d1862d 2020-05-14)
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.