Skip to content

Commit

Permalink
Revert "Build with C11 on MSVC in the standalone Bazel build"
Browse files Browse the repository at this point in the history
This reverts commit 28e4a1b. Bazel
broke --cxxopt on Windows in
bazelbuild/bazel#15073, which means projects
enabling, say, C++20 with --cxxopt=/std:c++20 are silently passing
/std:c++20 to our C files.

This is already a problem, but MSVC is smart enough to silently ignore
the flag when building C. However, MSVC will report an error if you then
pass /std:c++20 /std:c11 into the same command. It seems that check is
not aware of this ignoring behavior.

Ultimately, this is a Bazel bug, and one that makes the broken versions
of Bazel unsuitable for use with C. This was fixed in Bazel in
bazelbuild/bazel#18119 and backported to the
upcoming Bazel 6.3.0 release in
bazelbuild/bazel#18552

Temporarily revert the change. When Bazel 6.3.0 is released, we'll put
this back and require Windows users use a functioning version of Bazel.

Bug: 624
Fixed: 623
Change-Id: I68d9b2ed8751b4cf5dc7f42f8c1fbd42a97d6ca2
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61365
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
  • Loading branch information
davidben authored and Boringssl LUCI CQ committed Jul 5, 2023
1 parent 63f4b80 commit 1e2f169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/BUILD.toplevel
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ boringssl_copts = [
}) + asm_copts

boringssl_copts_c11 = boringssl_copts + select({
"@platforms//os:windows": ["/std:c11"],
# TODO(crbug.com/boringssl/624): This should pass /std:c11 on MSVC. It was
# reverted due to https://github.com/bazelbuild/bazel/issues/15073. When
# Bazel 6.3.0 is released, restore it and require C11 on MSVC.
"@platforms//os:windows": [],
"//conditions:default": gcc_copts_c11,
})

Expand Down

0 comments on commit 1e2f169

Please sign in to comment.