Skip to content

LTO triggers type debuginfo unification error in LLVM #15045

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

Closed
luqmana opened this issue Jun 19, 2014 · 4 comments
Closed

LTO triggers type debuginfo unification error in LLVM #15045

luqmana opened this issue Jun 19, 2014 · 4 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@luqmana
Copy link
Member

luqmana commented Jun 19, 2014

This is with a recent rustc that includes #14819 and a new snapshot. Exact line used to build rustc:

../configure --disable-docs --disable-valgrind --prefix=/scratch/laden/local --target=i686-unknown-linux-gnu,arm-unknown-linux-gnueabi,arm-unknown-linux-gnueabihf,arm-linux-androideabi --android-cross-path=/scratch/laden/android-dev/standalone --enable-debug
RUSTFLAGS="-g" VERBOSE=1 make -j32
-> % rustc -v
rustc 0.11.0-pre (bb06790 2014-06-19 09:26:24 +0000)
host: x86_64-unknown-linux-gnu
fn main() {
    println!("Hello World!");
}
-> % rustc foo.rs -Z lto
rustc: /scratch/laden/rust/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:938: llvm::DIE* llvm::DwarfUnit::getOrCreateTypeDIE(const llvm::MDNode*): Assertion `Ty == resolve(Ty.getRef()) && "type was not uniqued, possible ODR violation."' failed.
[1]    18332 abort      rustc foo.rs -Z lto

cc @michaelwoerister

@michaelwoerister
Copy link
Member

Thanks for the report and for making sure that it occurs with a recent version. I was already able to reproduce it and will take a look at it next week. I suspect source file and line information of inlined items to be the culprit. But only closer investigation will show the real reason...

@michaelwoerister
Copy link
Member

A little update on this: This is probably fixed by PR #15199 but another issue (#15156) prevents testing this properly (one has to manually fix LLVM in order to work around that). Let's leave the issue open until the other issue is fixed.

@michaelwoerister
Copy link
Member

Update

While the original issue indeed seems to have been fixed with #15199, there's another problem occuring now (60e7317) with the same test case:

rustc: /home/mw/rust/src/llvm/lib/CodeGen/LexicalScopes.cpp:179: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(llvm::MDNode*): Assertion `DISubprogram(Scope).describes(MF->getFunction())' failed.

Note that this is the same error as in #17201. It seems that LTO still triggers the problem, even if all crates involved contain debuginfo.

@michaelwoerister michaelwoerister changed the title Can't LTO if built with RUSTFLAGS="-g" LTO triggers type debuginfo unification error in LLVM Oct 1, 2014
@michaelwoerister
Copy link
Member

As the original problem has been fixed, I'll close this issue and open a new one for the new problem. I also renamed the issue to better reflect what the original error was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants