PA: Restrict use_sized_deallocation’s assertion to Clang
In https://crrev.com/c/7136445, we added an assertion: !is_win ||
!is_component_build || use_sized_deallocation This assertion is to
prevent symbol mismatches with Abseil .def lists, which are created
expecting sized deallocation.
However, ANGLE MSVC builds (where is_clang is false) have
use_sized_deallocation as false, triggering an assertion failure.
Since Abseil is not used in these builds, we restrict the assertion to
only run when is_clang is true.
Bug: 410190984
Change-Id: I2c040e6003ed17ee1d6677659ac4b4b37990e552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7214907
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Ayumi Ono <ayumiohno@google.com>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Reviewed-by: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1552695}
diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
index b70dadec..ae3b36f0 100644
--- a/build/config/compiler/compiler.gni
+++ b/build/config/compiler/compiler.gni
@@ -168,7 +168,9 @@
# The Abseil .def lists for Windows component builds are created expecting sized
# deallocation. Disabling it leads to symbol mismatches and build failures.
-assert(!is_win || !is_component_build || use_sized_deallocation,
+# This assertion is restricted to Clang builds. ANGLE MSVC builds, where
+# is_clang is false, do not use Abseil that requires this assertion.
+assert(!is_clang || !is_win || !is_component_build || use_sized_deallocation,
"Sized deallocation must be enabled in component builds on Windows.")
assert(is_clang || !use_sized_deallocation,
"Sized deallocation is supported on clang.")