[PATCH] D101479: [Driver] Support libc++ in MSVC

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 5 23:32:11 PDT 2021


phosek added a comment.

In D101479#2741202 <https://reviews.llvm.org/D101479#2741202>, @mstorsjo wrote:

> In D101479#2740895 <https://reviews.llvm.org/D101479#2740895>, @phosek wrote:
>
>> On other platforms the decision whether to use static or shared is controlled by `-static-libstdc++`, does CL have a similar flag or shall we support `-static-libstdc++` in MSVC driver as well?
>
> Hmm, well contrary to how `-static-libstdc++` works otherwise (you only need it while linking), you'd need to define `-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS` everwhere when compiling, if libc++ defaults to DLL linkage but you'd want to use a static version instead.
>
> Repeating the question - does the driver really need to know or care? Thanks to the autolinking directive in libc++ headers, the driver shouldn't need to explicitly link against the libc++ library at all?

I'd be fine with that. Is that what CL does as well? Do we still need the `-libpath:` for the linker to find the library?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101479



More information about the cfe-commits mailing list