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

"undefined reference to" ld returned 1 exit status #107345

Closed
Antiarchitect opened this issue Jan 27, 2023 · 3 comments
Closed

"undefined reference to" ld returned 1 exit status #107345

Antiarchitect opened this issue Jan 27, 2023 · 3 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-linux Operating system: Linux S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress.

Comments

@Antiarchitect
Copy link

Antiarchitect commented Jan 27, 2023

Original issue: ntex-rs/ntex#168

I tried to upgrade my project to new versions of crates from ntex ecosystem and getting this during the build (tried dev/release and lto on/off) in rust 1.67.0 1.66.1 and 1.65.0:

Cargo.toml:

[profile.dev]
lto = "off"
uname -a
Linux workstation 6.0.17-300.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 4 15:58:35 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
rustc --version --verbose
rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: x86_64-unknown-linux-gnu
release: 1.67.0
LLVM version: 15.0.6
RUST_BACKTRACE=1 cargo build

...

  = note: /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-50505dd9d683691b.4mlovlv0amp3wbkb.rcgu.o: in function `mqtt_proxy::mqtt::server::run_internal::{{closure}}':
          /home/andrey/PROJECTS/ENAPTER/RUST/mqtt-proxy/src/mqtt/server.rs:407: undefined reference to `ntex::server::builder::ServerBuilder::bind'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/src/mqtt/server.rs:437: undefined reference to `ntex::server::builder::ServerBuilder::bind'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-50505dd9d683691b: hidden symbol `_ZN4ntex6server7builder13ServerBuilder4bind17h11f83fcdff21e860E' isn't defined
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status
rustc --version --verbose
rustc 1.66.1 (90743e729 2023-01-10)
binary: rustc
commit-hash: 90743e7298aca107ddaa0c202a4d3604e29bfeb6
commit-date: 2023-01-10
host: x86_64-unknown-linux-gnu
release: 1.66.1
LLVM version: 15.0.2
RUST_BACKTRACE=1 cargo build

...

  = note: /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-8e95ce83ad692d11.36165ln4drfwzbwp.rcgu.o: in function `ntex_mqtt::v3::dispatcher::factory::{{closure}}':
          /home/andrey/.cargo/registry/src/github.com-1ecc6299db9ec823/ntex-mqtt-0.10.0/src/v3/dispatcher.rs:45: undefined reference to `core::future::from_generator'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-8e95ce83ad692d11.36165ln4drfwzbwp.rcgu.o: in function `ntex_mqtt::v3::dispatcher::factory::{{closure}}':
          /home/andrey/.cargo/registry/src/github.com-1ecc6299db9ec823/ntex-mqtt-0.10.0/src/v3/dispatcher.rs:45: undefined reference to `core::future::from_generator'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-8e95ce83ad692d11: hidden symbol `_ZN4core6future14from_generator17h41325a862bdd1022E' isn't defined
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status
rustc --version --verbose
rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0
RUST_BACKTRACE=1 cargo build

...

  = note: /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-63921c4d21993a93.1v857ri3nn1m6ced.rcgu.o: in function `ntex_mqtt::v3::dispatcher::factory::{{closure}}':
          /home/andrey/.cargo/registry/src/github.com-1ecc6299db9ec823/ntex-mqtt-0.10.0/src/v3/dispatcher.rs:45: undefined reference to `core::future::from_generator'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-63921c4d21993a93.1v857ri3nn1m6ced.rcgu.o: in function `ntex_mqtt::v3::dispatcher::factory::{{closure}}':
          /home/andrey/.cargo/registry/src/github.com-1ecc6299db9ec823/ntex-mqtt-0.10.0/src/v3/dispatcher.rs:45: undefined reference to `core::future::from_generator'
          /usr/bin/ld: /home/andrey/PROJECTS/mqtt-proxy/target/debug/deps/mqtt_proxy-63921c4d21993a93: hidden symbol `_ZN4core6future14from_generator17hbc6ad46c704acbb0E' isn't defined
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status

Any help is welcome :)

@Antiarchitect
Copy link
Author

Updated Rust to 1.68.2 - still facing the issue.

@watchpoints
Copy link

me to

@fmease fmease added A-linkage Area: linking into static, shared libraries and binaries S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. O-linux Operating system: Linux and removed needs-triage-legacy labels Jan 25, 2024
@saethlin
Copy link
Member

I know it's been a while, but the linked crate now seems to build fine. So I'm going to close this, but if anyone has a reproducer for this problem please do share.

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. O-linux Operating system: Linux S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress.
Projects
None yet
Development

No branches or pull requests

5 participants