[all-commits] [llvm/llvm-project] 5343b2: [libcxxabi] Don't enable -fvisibility=hidden on Wi...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Jul 7 06:16:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5343b204252d7bf5bdfcacd664e78e9f7f9fd745
      https://github.com/llvm/llvm-project/commit/5343b204252d7bf5bdfcacd664e78e9f7f9fd745
  Author: Martin Storsjö <martin at martin.st>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M libcxxabi/src/CMakeLists.txt

  Log Message:
  -----------
  [libcxxabi] Don't enable -fvisibility=hidden on Windows (#207943)

This option is supported (and hence gets added by the
target_add_compile_flags_if_supported function) on Windows, but if using
dllexport, there's no point in using hidden visibility. (However if
building both static and shared libraries at the same time, it could be
beneficial to have hidden visibilty in the static libraries.)

In asserts enabled builds of Clang, building with -fvisibility=hidden
caused errors like this:

    dllexport GlobalValue must have default or protected visibility
    ptr @_ZTIv
    [...]
    fatal error: error in backend: Broken module found, compilation aborted!

Normally, combining -fvisibility=hidden with dllexport is not a problem,
but specifically for `__cxxabiv1:: __fundamental_type_info` it does make
Clang trigger an inconsistency, visible in asserts enabled builds of
Clang - see https://github.com/llvm/llvm-project/issues/207963.

This fixes Windows builds with Clang with asserts enabled, after
cb942d009a5ed029ce20d9b75b3604f551f0cb56.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list