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

Fix emitting asm and object file output at the same time #30452

Merged
merged 1 commit into from
Dec 18, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Dec 18, 2015

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

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@dotdash
Copy link
Contributor Author

dotdash commented Dec 18, 2015

@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.

@alexcrichton
Copy link
Member

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!

@alexcrichton
Copy link
Member

I've confirmed that this does indeed fix #26235!

With that in mind, r=me if the binaries in run-make are actually executed.

@dotdash
Copy link
Contributor Author

dotdash commented Dec 18, 2015

@alexcrichton Oh, oops, forgot to add the test for #26235, the ones included are just for #24876. Will add the missing one.

@dotdash
Copy link
Contributor Author

dotdash commented Dec 18, 2015

@bors r=alexcrichton

Thanks for testing this Alex!

@bors
Copy link
Contributor

bors commented Dec 18, 2015

📌 Commit 98474f3 has been approved by alexcrichton

@mitaa
Copy link
Contributor

mitaa commented Dec 18, 2015

/home/travis/build/rust-lang/rust/src/test/run-make/emit/test-26235.rs:41: line longer than 100 chars

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
@dotdash
Copy link
Contributor Author

dotdash commented Dec 18, 2015

@bors r=alexcrichton

@mitaa Thanks!

@bors
Copy link
Contributor

bors commented Dec 18, 2015

📌 Commit 88ffb26 has been approved by alexcrichton

@dotdash
Copy link
Contributor Author

dotdash commented Dec 18, 2015

@bors r=alexcrichton

Guess the bot doesn't like me talking to others as well?

@bors
Copy link
Contributor

bors commented Dec 18, 2015

📌 Commit 88ffb26 has been approved by alexcrichton

Manishearth added a commit to Manishearth/rust that referenced this pull request Dec 18, 2015
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
bors added a commit that referenced this pull request Dec 18, 2015
@bors bors merged commit 88ffb26 into rust-lang:master Dec 18, 2015
@dotdash dotdash deleted the 24876_take_2 branch January 15, 2016 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants