Issue |
138194
|
Summary |
Crash in lld with thin LTO cache and assembly output
|
Labels |
lld
|
Assignees |
|
Reporter |
quic-akaryaki
|
After #136121 is merged, thin LTO with assembly output with cache crashes lld. A test case is basic:
`int main() { return 0; }`
```
clang -c main.c -O2 -flto=thin -o main.o
ld.lld --thinlto-cache-dir=. --lto-emit-asm -e main main.o
```
The crash happens in the destructor of MCAsmStreamer, which tries to close a stream that it was passed. However, the stream was previously closed while calling the commit() function in LTOBackend.cpp: codegen().
A simple fix would be to delete the LTO pipeline before the stream commit function is called in LTOBackend.cpp: codegen().
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs