Commit 023af639 authored by Matthew Denton's avatar Matthew Denton Committed by Commit Bot

GCC: no -fno-delete-null-pointer-checks in compiler flags

GCC seems to have a bug with constexpr when this flag is present:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97913

So enable it only on clang for now.

Bug: 1139129
Change-Id: If657d5e3fac1621adf57c266cfd64ce628dc7b86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551494
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829585}
parent ecb86306
......@@ -263,7 +263,10 @@ config("compiler") {
# of some security-critical code: see https://crbug.com/1139129.
# Nacl does not support the flag. And, we still want UBSAN to catch undefined
# behavior related to nullptrs, so do not add this flag if UBSAN is enabled.
if (!is_nacl && !is_ubsan) {
# GCC seems to have some bugs compiling constexpr code when this is defined,
# so only enable it if using_clang. See: https://gcc.gnu.org/PR97913
# TODO(mpdenton): remove is_clang once GCC bug is fixed.
if (!is_nacl && !is_ubsan && is_clang) {
cflags += [ "-fno-delete-null-pointer-checks" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment