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

failed to get bitcode from object file for LTO (Bitcode section not found in object file) #94232

Open
matthiaskrgr opened this issue Feb 21, 2022 · 5 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 21, 2022

git clone https://github.com/rust-lang/rust-clippy
cd rust-clippy
git checkout 9e605ef80f05fbaec22677e633971096675f2650
echo "[profile.release]
codegen-units = 1
lto = true" >> Cargo.toml

cargo test --release

fails to build without any interesting details unfortunately

.....
   Compiling clippy v0.1.60 (/home/matthias/vcs/github/rust-clippy)
error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)

error: could not compile `clippy` due to previous error
warning: build failed, waiting for other jobs to finish...

with nightly-2022-02-10

Seems to happen while compiling tests:
Building [=======================> ] 140/141: compile-test(test)

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 21, 2022
@ehuss
Copy link
Contributor

ehuss commented Feb 23, 2022

I believe this is because the compiler rlib libraries do not include bitcode in them. The compile-test.rs test depends on them, so it is not possible to build that test with LTO.

It would be nice if the error message included which file was missing the information (which would be easy to add here).

@aliciawyy
Copy link

Hello, I have the same problem. How should we fix it?

@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Dec 20, 2022
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
@tseli0s
Copy link

tseli0s commented Apr 13, 2023

Same problem here when using lto.
EDIT: Seems like it was a dependency problem, removing a few dependencies (Not sure which ones but I can search git history) solved it.

@virusdefender
Copy link

I have the same problem when running cargo test --release, and it seems only fails in my linux builder only, works in my Mac

@zamazan4ik
Copy link
Contributor

Met the same problem for ppc64le target in Maturin: PyO3/maturin#2337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants