Skip to content

undefined reference link error regression  #34796

Closed
@alexcrichton

Description

@alexcrichton

This looks to be a regression from stable to beta unfortunately, compiling rust-lang/futures-rs@6ae0345 succeeds on stable but fails on beta:

$ rustup run stable cargo build --manifest-path http/Cargo.toml
...
$ rustup run beta cargo build --manifest-path http/Cargo.toml
...
   Compiling http v0.1.0 (file:///home/alex/code/futures/http)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/alex/code/futures/http/target/debug/http.0.o" "-o" "/home/alex/code/futures/http/target/debug/http" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/alex/code/futures/http/target/debug" "-L" "/home/alex/code/futures/http/target/debug/deps" "-L" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/alex/code/futures/http/target/debug/libhttp.rlib" "/home/alex/code/futures/http/target/debug/deps/libhttparse-36b96d90ffbce562.rlib" "/home/alex/code/futures/http/target/debug/deps/libfuturemio-986c91cdeb491b00.rlib" "/home/alex/code/futures/http/target/debug/deps/libslab-45f4a226259c4869.rlib" "/home/alex/code/futures/http/target/debug/deps/libfutures-1a55edc1e7c129de.rlib" "/home/alex/code/futures/http/target/debug/deps/libmio-a89f84904d772c54.rlib" "/home/alex/code/futures/http/target/debug/deps/libnet2-b2390925f9bbf4a2.rlib" "/home/alex/code/futures/http/target/debug/deps/libcfg_if-72c1f992b13d5087.rlib" "/home/alex/code/futures/http/target/debug/deps/libmiow-b827bf6129dcd844.rlib" "/home/alex/code/futures/http/target/debug/deps/libwinapi-0889532d327ff4e2.rlib" "/home/alex/code/futures/http/target/debug/deps/libnix-f8d033ce6354dacb.rlib" "/home/alex/code/futures/http/target/debug/deps/libbytes-f9fbfc75eb2416e0.rlib" "/home/alex/code/futures/http/target/debug/deps/libscoped_tls-53036341d2dbbe26.rlib" "/home/alex/code/futures/http/target/debug/deps/libtime-750bfdd52feafcb7.rlib" "/home/alex/code/futures/http/target/debug/deps/liblibc-1f3392fe1afd1313.rlib" "/home/alex/code/futures/http/target/debug/deps/liblog-bf16bb9a4912b11d.rlib" "/home/alex/code/futures/http/target/debug/deps/libbitflags-e61ad67c3301e77d.rlib" "/home/alex/code/futures/http/target/debug/deps/libslab-4f8b9e9b6e35857c.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-411fd48b.rlib" "/home/alex/.multirust/toolchains/beta-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-411fd48b.rlib" "-l" "util" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /home/alex/code/futures/http/target/debug/http.0.o: In function `http::serve<http::request::Request,http::response::Response,closure>':
/home/alex/code/futures/http/src/lib.rs:55: undefined reference to `futuremio::tcp::_$LT$impl$u20$futuremio..event_loop..LoopHandle$GT$::tcp_listen::h9a7258751896fb30'
/home/alex/code/futures/http/target/debug/http.0.o: In function `http::serve::_$u7b$$u7b$closure$u7d$$u7d$::hed42a806f41e1837':
http.0.rs:(.text._ZN4http5serve28_$u7b$$u7b$closure$u7d$$u7d$17hed42a806f41e1837E+0xa2): undefined reference to `futuremio::tcp::TcpListener::incoming::h7aae24690b0d3a8d'
/home/alex/code/futures/http/target/debug/http.0.o: In function `futures::forget::forget<futures::then::Then<Box<Future>, core::result::Result<(), std::sync::mpsc::SendError<core::result::Result<(), std::io::error::Error>>>, closure>>':
/home/alex/code/futures/src/forget.rs:23: undefined reference to `futures::forget::_forget::h4301ad1ba69f01dc'
collect2: error: ld returned 1 exit status


error: aborting due to previous error
error: Could not compile `http`.

cc @michaelwoerister, does this look familiar?

I'll try to reduce down as well, but wanted to file an issue nonetheless.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions