[PATCH] D121141: [Clang] Add `-fexperimental-library` flag to enable unstable and experimental features: follow-up fixes

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 01:15:14 PDT 2022


phosek added a comment.

In D121141#3656100 <https://reviews.llvm.org/D121141#3656100>, @mstorsjo wrote:

> In D121141#3655323 <https://reviews.llvm.org/D121141#3655323>, @ldionne wrote:
>
>> The `experimental-library-flag` test is currently failing on Windows because on Windows, `-stdlib=libc++` seems to be ignored and we don't add `-lc++` or `-lc++experimental`. Does someone understand how things are supposed to work when using libc++ on Windows? @mstorsjo maybe?
>
> Clarification - I presume it would fail when targeting MSVC, not when targeting mingw.
>
> Yes, I think `-stdlib=libc++` has no effect on MSVC targets currently, and you have to add the include directory and lib arguments when using it - I think @rnk, @hans or @thakis can confirm that.
>
> @phosek has a patch to take the option into use there too, but it's essentially blocked by D103947 <https://reviews.llvm.org/D103947> if I remember correctly. (The chain of dependencies that trigger that is a bit non-obvious, but I think it was the case that they build their Clang with `-DCLANG_DEFAULT_CXX_STDLIB=libc++`, and once that has an effect on the MSVC configs, a bunch of code in their build setup suddenly ends up using libc++ instead of MSVC STL, and there's a lot of code there that is built with `_HAS_EXCEPTIONS=0` - hence libc++ needing to work in that configuration.)

That's correct, I implemented the support for `-stdlib=libc++` on MSVC targets in D101479 <https://reviews.llvm.org/D101479>, but that change caused a number of build failures including the compiler-rt due to `_HAS_EXCEPTIONS=0` so relanding that change is blocked on D103947 <https://reviews.llvm.org/D103947>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121141



More information about the cfe-commits mailing list