[all-commits] [llvm/llvm-project] ab82c3: [Fuchsia] Build with -fvisibility=default (#67067)

Alex Brachet via All-commits all-commits at lists.llvm.org
Fri Sep 22 12:08:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab82c3d0a8406edecfd26cb30678aab6d3eff1b7
      https://github.com/llvm/llvm-project/commit/ab82c3d0a8406edecfd26cb30678aab6d3eff1b7
  Author: Alex Brachet <abrachet at google.com>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M clang/cmake/caches/Fuchsia-stage2.cmake

  Log Message:
  -----------
  [Fuchsia] Build with -fvisibility=default (#67067)

There was an issue with relative vtables when two TU's which define the
same vtable object are built with different default visibilities. Some
TU's are built with -fvisibility=hidden in the code base, grep for
CMAKE_CXX_VISIBILITY_PRESET to find them. Our whole toolchain, is
statically linked, and built with -fPIE anyway, so the cost of
overriding local CMAKE_CXX_VISIBILITY_PRESET properties is not high.
I've counted that adding this flag increases our llvm binary by 13
relocations. Frankly I'm not sure where those are even coming from.

It would be preferable to use hidden visibility, but that breaks liblld.
This can be solved by setting LLDB_EXPORT_ALL_SYMBOLS. After that some
ORC tests fail which do symbolic lookup in the tests. It seems that
setting CMAKE_CXX_VISIBILITY_PRESET=hidden will not be worth the
maintenance burden. Setting it to default works to unblock using
relative vtables, so we can just go with that.




More information about the All-commits mailing list