Skip to content

rustc 1.32 using system LLVM-7 crashes with: error: failed to load bc of "core.9adngr8s-cgu.0": Invalid record #57903

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
Whissi opened this issue Jan 25, 2019 · 6 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-linux Operating system: Linux

Comments

@Whissi
Copy link

Whissi commented Jan 25, 2019

On Gentoo Linux we have the same problem like reported in #57762, downstream bug: https://bugs.gentoo.org/675752

I now applied the two patches (llvm-mirror/llvm@da1fb72 and llvm-mirror/llvm@cc1f2a5) to our llvm-7 version but fd (https://github.com/sharkdp/fd) is still failing to build. New error is:

INFO 2019-01-25T18:55:20Z: rustc_codegen_llvm::back::lto: linking "core.9adngr8s-cgu.0"
error: failed to load bc of "core.9adngr8s-cgu.0": Invalid record

error: aborting due to previous error
[...]
Could not compile `fd-find`.), unknown: false, exit_code: 101 }
error: Could not compile `fd-find`.

Please see the attached verbose build.log.
build.log.zip

@Centril Centril added A-linkage Area: linking into static, shared libraries and binaries A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-linux Operating system: Linux labels Jan 25, 2019
@Whissi
Copy link
Author

Whissi commented Jan 25, 2019

Patching rust iwth 1c95f5a doesn't help.

@nagisa
Copy link
Member

nagisa commented Jan 25, 2019

There is a somewhat conflicting signal – the comment 16 seems to say that the patch does fix the compilation issue.

Would it be possible to get the sample file that is referenced in the error message (use -Csave-temps and -Ccodegen-units=1)?

@Whissi
Copy link
Author

Whissi commented Jan 25, 2019

Not sure if I did it the right way, I set RUSTFLAGS="-Csave-temps -Ccodegen-units=1" environment variable. Here's the complete target directory, I hope it is included: https://dev.gentoo.org/~whissi/stuff/fd-7.2.0_target_201901252245.tar.xz

@nagisa
Copy link
Member

nagisa commented Jan 25, 2019

Ah, my bad. It seems that the failing bytecode comes from libcore, so it won’t be included in the target/.

@gyakovlev
Copy link

looks like we figured it out, 1c95f5a actually fixes rust with system installed llvm-7

@Whissi
Copy link
Author

Whissi commented Jan 26, 2019

Right. The problem error: failed to load bc of "core.9adngr8s-cgu.0": Invalid record seems to be caused by sccache usage I tried while I started to investigate the original issue #57762 before the bug + solution was filed here to speed up bisect a little bit :/

@Whissi Whissi closed this as completed Jan 26, 2019
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 A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-linux Operating system: Linux
Projects
None yet
Development

No branches or pull requests

4 participants