]> git.lizzy.rs Git - rust.git/commit
Fix emitting asm and object file output at the same time
authorBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 18 Dec 2015 00:24:40 +0000 (01:24 +0100)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 18 Dec 2015 03:14:52 +0000 (04:14 +0100)
commit88ffb26cf50cff64c7ec0f4fc269a377a5b2918a
tree107f1dbeab5549f97f5e2c1894c0cc2406d1f9e5
parent785a8a6681963ff389b5902e7d6bd30006fafe0a
Fix emitting asm and object file output at the same time

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
src/librustc_llvm/lib.rs
src/librustc_trans/back/write.rs
src/test/run-make/emit/Makefile [new file with mode: 0644]
src/test/run-make/emit/test-24876.rs [new file with mode: 0644]
src/test/run-make/emit/test-26235.rs [new file with mode: 0644]