-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix emitting asm and object file output at the same time #30452
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@pythonesque / @alexcrichton could one of you check whether this actually adresses #26235? I can't reproduce the problem on linux, but I believe that it is fixed by this. |
Applying locally to see if this works out, but from #26235 it looks like it wasn't the compiler itself segfaulting but rather the binary that was generated, so could the test here also run the output binary? This seems like a pretty reasonable solution to me though at least! |
I've confirmed that this does indeed fix #26235! With that in mind, r=me if the binaries in run-make are actually executed. |
@alexcrichton Oh, oops, forgot to add the test for #26235, the ones included are just for #24876. Will add the missing one. |
2ea1a24
to
98474f3
Compare
@bors r=alexcrichton Thanks for testing this Alex! |
📌 Commit 98474f3 has been approved by |
|
LLVM doesn't really support reusing the same module to emit more than one file. One bug this causes is that the IR is invalidated by the stack coloring pass when emitting the first file, and then the IR verifier complains by the time we try to emit the second file. Also, we get different binaries with --emit=asm,link than with just --emit=link. In some cases leading to segfaults. Unfortunately, it seems that at this point in time, the most sensible option to circumvent this problem is to just clone the whole llvm module for the asm output if we need both, asm and obj file output. Fixes rust-lang#24876 Fixes rust-lang#26235
98474f3
to
88ffb26
Compare
📌 Commit 88ffb26 has been approved by |
@bors r=alexcrichton Guess the bot doesn't like me talking to others as well? |
📌 Commit 88ffb26 has been approved by |
LLVM doesn't really support reusing the same module to emit more than one file. One bug this causes is that the IR is invalidated by the stack coloring pass when emitting the first file, and then the IR verifier complains by the time we try to emit the second file. Also, we get different binaries with --emit=asm,link than with just --emit=link. In some cases leading to segfaults. Unfortunately, it seems that at this point in time, the most sensible option to circumvent this problem is to just clone the whole llvm module for the asm output if we need both, asm and obj file output. Fixes rust-lang#24876 Fixes rust-lang#26235
LLVM doesn't really support reusing the same module to emit more than
one file. One bug this causes is that the IR is invalidated by the stack
coloring pass when emitting the first file, and then the IR verifier
complains by the time we try to emit the second file. Also, we get
different binaries with --emit=asm,link than with just --emit=link. In
some cases leading to segfaults.
Unfortunately, it seems that at this point in time, the most sensible
option to circumvent this problem is to just clone the whole llvm module
for the asm output if we need both, asm and obj file output.
Fixes #24876
Fixes #26235