[libcxx-commits] [PATCH] D100539: [libcxx] Base MSVC autolinking on _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS

Reid Kleckner via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 15 11:44:37 PDT 2021


rnk accepted this revision.
rnk added a comment.

lgtm

I agree this makes sense, it's reasonable to statically link libc++ and dynamically link the CRT.

I think this is Windows-specific, so my approval is enough, but I could be wrong.

---

In Chrome, we define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS in all libc++ static build configs:
https://source.chromium.org/chromium/chromium/src/+/master:build/config/c++/BUILD.gn;l=57?q=_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS&ss=chromium
I see that libc++ appears to support building both static and dynamic libraries in the same build:
https://github.com/llvm/llvm-project/blob/280678122d3175943e41310d56a17924ea38ffc1/libcxx/CMakeLists.txt#L89-L90
That makes it impossible to bake this visibility setting into __config_site. Otherwise, I would suggest that we do that, and make the Windows behavior the cross-platform behavior. Then we would rename this macro to something like _LIBCPP_STATIC_LIBRARY or something like that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100539



More information about the libcxx-commits mailing list