rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.21k stars 12.56k forks source link

warning: could not find referenced DIE when compiling on macOS #82005

Open djc opened 3 years ago

djc commented 3 years ago

I just did some of my first compiles with 1.50.0 and I'm getting these warnings:

  = note: warning: could not find referenced DIE
          note: while processing /Users/djc/src/bolt/rust/target/release/deps/build_index.build_index.cf635v6f-cgu.15.rcgu.o
          warning: could not find referenced DIE
          note: while processing /Users/djc/src/bolt/rust/target/release/deps/build_index.build_index.cf635v6f-cgu.15.rcgu.o
          warning: could not find referenced DIE
          note: while processing /Users/djc/src/bolt/rust/target/release/deps/build_index.build_index.cf635v6f-cgu.15.rcgu.o
          warning: could not find referenced DIE
          note: while processing /Users/djc/src/bolt/rust/target/release/deps/build_index.build_index.cf635v6f-cgu.15.rcgu.o

This was after running cargo run --release --bin build-index -- version in my (proprietary) project on macOS (Big Sur 11.2.1).

djc-2019 IDS-326/build-index-version rust $ cargo version
cargo 1.50.0 (f04e7fab7 2021-02-04)

I suspect this may have something to do with the split debuginfo stuff?

djc commented 3 years ago

For what it's worth, this workspace has the following configuration:

[profile.release]
debug = true
lto = true

I also see warnings like this:

          warning: inconsistent range data.
          note: while processing emitting debug_ranges
          warning: inconsistent range data.
          note: while processing emitting debug_ranges
          warning: inconsistent range data.
          note: while processing emitting debug_ranges
          warning: inconsistent range data.
          note: while processing emitting debug_ranges
          warning: inconsistent range data.
          note: while processing emitting debug_ranges
          warning: no mapping for range.
ehuss commented 3 years ago

Transferring to rust-lang/rust, since this looks like a linking issue. Split-debuginfo is in 1.51, not 1.50.

Some more information may be helpful. Which version of xcode are you using? What is dsymutil --version? Does it happen with LTO disabled? Does it happen with "thin" LTO?

Looking at other users reporting similar things, this sounds like maybe some issue with rustc's version of LLVM doing something incompatible with dsymutil, though I'm not sure.

djc commented 3 years ago

I have Xcode "Version 12.4 (12D4e)".

djc-2019 ~ $ dsymutil --version
Apple LLVM version 11.0.0 (clang-1100.0.33.12)
  Optimized build.
  Default target: x86_64-apple-darwin20.3.0
  Host CPU: skylake

If I don't enable lto, I don't see these warnings. If I set lto to thin, I also don't see these warnings.

DianQK commented 1 year ago

111167 should have fixed this.