Currently we do not generate stats for the LTO step. This change
together with D45531 allows us to gather stats for the LTO step too.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
- Do non gold linkers all accept the -Wl,-plugin-opt lines?
- Maybe the clang driver knows if a gold linker is used and could add the -Wl,-plugin opt lines itself when -save-stats is used?
Thanks for having a look! After @tejohnson 's feedback, I've updated the llvm patch and added a clang patch that adds support for -save-stats with LTO to the clang driver.
Ping. The related patches clang/llvm patches have been merged. Clang now accepts and passes on -save-stats= when doing linking + LTO with the gold plugin.
test-suite/trunk/CMakeLists.txt | ||
---|---|---|
198 | You could just append the flag to LDFLAHS unconditionally now, can you? (Or do nothing at all, I think currently we append cflags to all linker invocations too; which admittedly is bad style but unlikely to change... |
test-suite/trunk/CMakeLists.txt | ||
---|---|---|
198 | Ah I saw your comment too late, sorry! I think the main reason I originally added it conditionally is to avoid "unused argument" warnings when not doing LTO. What do you think? |
test-suite/trunk/CMakeLists.txt | ||
---|---|---|
198 | I only added the comments after you committed so no worries. But I still think that adding all this after you did the changes for working without -Wl,plugin are not necessary anymore, maybe try removing them and if things still work remove this? |
test-suite/trunk/CMakeLists.txt | ||
---|---|---|
198 | I just tried, unconditionally adding -save-stats to the LDFLAGS works. But for non-lto builds, it produces argument unused during compilation warnings for each linker invocation. IMO it would be slightly better to only add it for LTO, to avoid those warnings in the non-LTO case for now. |
You could just append the flag to LDFLAHS unconditionally now, can you? (Or do nothing at all, I think currently we append cflags to all linker invocations too; which admittedly is bad style but unlikely to change...