25 lines
769 B
Diff
25 lines
769 B
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
|
Date: Thu, 22 Dec 2016 07:15:34 -0500
|
|
Subject: [PATCH] enable -fwrapv in Clang for non-UBSan builds
|
|
|
|
---
|
|
build/config/compiler/BUILD.gn | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
|
index 04a4efb658b28..e91ed9c20f8f1 100644
|
|
--- a/build/config/compiler/BUILD.gn
|
|
+++ b/build/config/compiler/BUILD.gn
|
|
@@ -348,6 +348,10 @@ config("compiler") {
|
|
}
|
|
}
|
|
|
|
+ if (is_clang && !is_ubsan && !is_ubsan_security) {
|
|
+ cflags += [ "-fwrapv" ]
|
|
+ }
|
|
+
|
|
# Linker warnings.
|
|
if (fatal_linker_warnings && !is_apple && current_os != "aix" &&
|
|
current_os != "zos") {
|