The profiling runtime was designed to work without static initializers
or a a filesystem (see 117cf2bd1ff585f9754b5f30f5a4cfd65b230bbf and
others). The no-static-initializers part was already documented but this
part got missed before.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for doing this!
+ Eli to comment on whether any workarounds documented in https://lists.llvm.org/pipermail/llvm-dev/2017-September/117156.html are still necessary. To my knowledge it's not currently necessary to explicitly pass -mllvm -enable-value-profiling=false (as value profiling should not be enabled under -fcoverage-mapping -fprofile-instr-generate). It should also not be necessary to shave .o's out of the runtime static archive; so long as the static initializer isn't linked, the linker shouldn't pull in any references to malloc, mmap, etc.
clang/docs/SourceBasedCodeCoverage.rst | ||
---|---|---|
368 | I think we should leave a note about how to avoid pulling in unwanted symbol references, and perhaps reference the preceding section about using the runtime without its static initializer. |
Incorporate feedback from @vsk:
- a bit more explanatory text for the overall context
- explicitly reference the static initializers
clang/docs/SourceBasedCodeCoverage.rst | ||
---|---|---|
368 | Improved this a bit; let me know if you suggested text that makes the unwanted symbol reference stuff a bit more clear. Note, BTW, that I've made this a sub-section of "Using the profiling runtime without static initializers"; if you think it should be a peer section that's an option too. |
I think we should leave a note about how to avoid pulling in unwanted symbol references, and perhaps reference the preceding section about using the runtime without its static initializer.