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

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 3 09:30:39 PDT 2021


mstorsjo added a comment.

In D101479#2733434 <https://reviews.llvm.org/D101479#2733434>, @thakis wrote:

> In D101479#2733354 <https://reviews.llvm.org/D101479#2733354>, @mstorsjo wrote:
>
>> Not sure if we want the desicion between static and shared libc++ be coupled with `/MT` and `/MD`, as one can quite plausibly want to use e.g. a static libc++ with `/MD`.
>
> Right, I meant more "how do users pick if they want a statically or dynamically linked libc++". Sounds like you get a dynamic libc++ by default. Since Windows doesn't have rpaths afaik, using `-stdlib=libc++` means you'll get an executable that won't start, unless you know to copy the libc++ dll next to your executable with this patch as-is, yes?

Yes, that sounds correct.

As for how people choose - I guess unless you resort to trickery - you use whichever is default in the libc++ build that is used.

However, the libc++ headers inject linker directives to pull in the right form of the lib, matching the linkage of the headers. So as long as that isn't disabled, the clang driver shouldn't need to specify any lib to link against at all.


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