[PATCH] D58055: [CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object files and unit tests.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 28 09:59:42 PST 2019


delcypher added a comment.

In D58055#1410888 <https://reviews.llvm.org/D58055#1410888>, @yln wrote:

> LGTM. Compiling all linker inputs with the same visibility is the right approach.
>
> Please check my understanding:
>  Before r336238 the `kIgnoreRemaining` constant got inlined, both into libFuzzer and the unit test.


I wouldn't say the constant got inlined, instead its the fact we have a single method that is compiled with different visibility and that method uses static storage. It seems that the static storage is implemented on Darwin as a weak global.

> So we had two definitions, one with hidden and one with default visibility resulting in a linker warning. If we (just for testing purposes) compile libFuzzer without hidden visibility, we would get a "duplicate symbol" linker error. With this patch we have two hidden definitions, which is fine.

I'm not 100% sure about this. I'm not sure what the linker means by "direct access" here.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58055





More information about the llvm-commits mailing list