Reland "Build libc++ and libc++abi with -std=c++20"
This is a reland of aea3a572a01844fdf4b4137d2b0c1fad90f70aab
https://chromium-review.googlesource.com/c/chromium/src/+/3469695
sorts out the lginux-gcc-rel issue.
Original change's description:
> Build libc++ and libc++abi with -std=c++20
>
> This changed upstream a while ago
> (https://github.com/llvm/llvm-project/commit/3b625060fc), and as of
> this commit it's required to build libcxxabi:
>
> https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+/3359ae8b6165e0512446c0f6b3fe50da4e30c8cb
>
> Generally, we require the same -std= flag across all of chromium.
> Given that this is a low-level external library, make an exception
> for just this library. (It also used c++17 before the rest, for the
> same reasons.) No other target should do this.
>
> Bug: 1298070
> Change-Id: I6767464dfea1ae3b61224563da96be5dd08bd702
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3469195
> Commit-Queue: Nico Weber <thakis@chromium.org>
> Auto-Submit: Nico Weber <thakis@chromium.org>
> Reviewed-by: Hans Wennborg <hans@chromium.org>
> Commit-Queue: Hans Wennborg <hans@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#971961}
Bug: 1298070
Cq-Include-Trybots: luci.chromium.try:linux-gcc-rel
Change-Id: Id6ef290a3bd77df6f1f9d062133bccb67e4b9b73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3469398
Reviewed-by: Arthur Eubanks <aeubanks@google.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#972044}
NOKEYCHECK=True
GitOrigin-RevId: e36f6c33728bfb08a22bf4a13193a918cecb3c4a
diff --git a/third_party/libc++/BUILD.gn b/third_party/libc++/BUILD.gn
index afef64e..7915346 100644
--- a/third_party/libc++/BUILD.gn
+++ b/third_party/libc++/BUILD.gn
@@ -11,18 +11,19 @@
cflags = [ "-fstrict-aliasing" ]
if (is_win) {
cflags += [
- # libc++ wants to redefine the macros WIN32_LEAN_AND_MEAN and _CRT_RAND_S in
- # its implementation.
+ # libc++ wants to redefine the macros WIN32_LEAN_AND_MEAN and _CRT_RAND_S
+ # in its implementation.
"-Wno-macro-redefined",
# We want to use a uniform C++ version across all of chromium, but
- # upstream libc++ requires C++17 so we have to make an exception here.
- "-std:c++17",
+ # upstream libc++ requires C++20 so we have to make an exception here.
+ # No other target should override the default -std= flag.
+ "-std:c++20",
]
} else {
cflags += [
"-fPIC",
- "-std=c++17",
+ "-std=c++20",
]
}