Add support for thinlto option ( thinlto-emit-imports-files) to emit import files for thinlink.
Details
- Reviewers
pcc ruiu • espindola - Commits
- rG4fb5119215f8: Add support for thinlto option ( thinlto-emit-imports-files) to emit import…
rLLD331696: Add support for thinlto option ( thinlto-emit-imports-files) to emit import…
rL331696: Add support for thinlto option ( thinlto-emit-imports-files) to emit import…
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
lld/ELF/LTO.cpp | ||
---|---|---|
84 | I don't understand this part of code. I think OS will be closed at end of this if block, so I don't think you are writing anything to the file. Is this code correct? |
lld/ELF/LTO.cpp | ||
---|---|---|
84 | For all the bitcode files, empty import files are generated at first. For the files selected by the linker having summary, lto::createWriteIndexesThinBackend overwrites the imports files . However, for the files which are either not selected by linker or they don't have summary, we don't write anything to .imports file since they don't import anything. These files are required for distributed ThinLTO build file staging. |
Added test to ensure that lld doesn't generate import files when thinlto-index-only is not enabled
Added createEmptyFile function to create empty import files. Also updated the test with error description.
I need to make similar change while creating empty index files, along with updating the description in test for it. I will add that change in next patch if that is okay.
I will be sending another patch to address tejohnson's concerns. I think, in the meantime, we can add emit-imports option support. Or would you like me to send that patch first?
I don't understand this part of code. I think OS will be closed at end of this if block, so I don't think you are writing anything to the file. Is this code correct?