aboutsummaryrefslogtreecommitdiff
path: root/build_overrides
diff options
context:
space:
mode:
authorDaniel Cheng <dcheng@chromium.org>2023-02-17 10:46:24 -0800
committerAngle LUCI CQ <angle-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-23 21:34:52 +0000
commit05bb784a882f53e490973af0818f148bf65cac3c (patch)
treeb14be1aa18718be99499da4c2f930767e1986a2c /build_overrides
parentb07394368a5df8c1b90506c781837adbd1a2d07f (diff)
downloadangle-05bb784a882f53e490973af0818f148bf65cac3c.tar.gz
Define enable_safe_libcxx in build_overrides/build.gni.
enable_safe_libcxx will be overridable by projects that embed Chrome's //build using the build_overrides mechanism. All downstream projects will need to define this new variable so Chrome can stop conditionally defining enable_safe_libcxx upstream. ANGLE, unlike other projects, defaults to setting this to false. This is because ANGLE is used in extremely performance sensitive scenarios such as the system graphics driver on Android. When used in this way, ANGLE makes no security guarantees. Bug: chromium:1385662 Change-Id: Ieaa1eda9ca747f91ac54df3bf761e7169b807b10 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4264463 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Diffstat (limited to 'build_overrides')
-rw-r--r--build_overrides/build.gni24
1 files changed, 24 insertions, 0 deletions
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
index 0a7128a184..77c7274627 100644
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -35,3 +35,27 @@ limit_android_deps = true
# Use C++17 instead of C++20 in MSVC builds
msvc_use_cxx17 = true
+
+# Standalone ANGLE is used in places that are extremely performance sensitive,
+# such as the system graphics driver on Android. ANGLE validates arguments at
+# the API boundary and assumes that all bounds, et cetera are valid elsewhere
+# in internal code.
+#
+# Unfortunately, this means the compiler cannot optimize out the vast majority
+# of hardening checks. To ensure performance remains competitive, drop the
+# libc++ hardening checks, since ANGLE already makes no security guarantees in
+# these situations.
+if (is_win) {
+ # TODO(https://crbug.com/1418717): ANGLE uses Chromium's abseil-cpp directory.
+ # Since Abseil does not mark symbols as exported, Chromium uses an alternate
+ # approach to scrape the symbols that need to be exported and generates .def
+ # files that the ANGLE build reuses.
+ #
+ # However, these symbol names include libc++ types, and libc++ hardening
+ # affects ABI, so ANGLE and Chromium's libc++ hardening modes need to remain
+ # in sync on Windows. This is a bit of a hack but "OK" since the performance
+ # concerns for standalone ANGLE builds are not relevant on Windows.
+ enable_safe_libcxx = true
+} else {
+ enable_safe_libcxx = false
+}