[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 25 17:33:43 PDT 2020


tejohnson marked an inline comment as done.
tejohnson added a comment.

In D75655#2237474 <https://reviews.llvm.org/D75655#2237474>, @pcc wrote:

> I think that the part of the description beginning "This can be used when..." is somewhat misleading since you could pretty much say the same thing about specifying `-fvisibility=hidden -fwhole-program-vtables` at compile time.
>
> I think it would be better to focus on the specific capability that `--lto-visibility-hidden` gives you over just compiling with `-fvisibility=hidden`. Let's keep @evgeny777 's use case out of this because I still have concerns about it being dangerous. Can you simply say:
>
> "This flag can be used to defer specifying whether classes have hidden LTO visibility until link time."
>
> Then, in order to try to forbid inappropriate use of the symbols, you could add:
>
> "Due to an implementation limitation, symbols associated with classes with hidden LTO visibility may still be exported from the binary when using this flag. It is unsafe to refer to these symbols, and their visibility may be relaxed to hidden in a future compiler release."

Added these, but added in my proposed wording about why you would want to defer (to allow bitcode sharing).



================
Comment at: clang/docs/LTOVisibility.rst:39
+During the LTO link, all classes with public LTO visibility will be refined
+to hidden LTO visibility when the ``-lto-whole-program-visibility`` lld linker
+option is applied (``-plugin-opt=whole-program-visibility`` for gold). This
----------------
MaskRay wrote:
> This is now
> 
>     ``--lto-whole-program-visibility``
> 
> (I am currently preparing some lld/ELF release notes for 11.0.0...)
Fixed here and in summary


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75655/new/

https://reviews.llvm.org/D75655



More information about the cfe-commits mailing list