Define NO_SANITIZE_FUNCTION on win/clang too
Bug: chromium:746914
Change-Id: Iddfcdfb3facb895d42bf5e91662fa00b995fe9f9
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/55728
Tested-by: Nico Weber <thakis@google.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index ead31ef..ba6f21f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -22,14 +22,17 @@
defines += [ "ANGLE_DISABLE_TRACE" ]
}
- if (is_win) {
- defines += [
- "NO_SANITIZE_FUNCTION=",
+ if (!is_win || is_clang) {
+ defines +=
+ [ "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))" ]
+ } else {
+ defines += [ "NO_SANITIZE_FUNCTION=" ]
+ }
- # Disable MSVC warnings about std::aligned_storage being broken before
- # VS 2017 15.8
- "_ENABLE_EXTENDED_ALIGNED_STORAGE",
- ]
+ if (is_win) {
+ # Disable MSVC warnings about std::aligned_storage being broken before
+ # VS 2017 15.8
+ defines += [ "_ENABLE_EXTENDED_ALIGNED_STORAGE" ]
# Diable some MSVC warnings.
if (!is_clang) {
@@ -44,9 +47,6 @@
} else {
cflags_cc = [ "-std=c++17" ]
- defines +=
- [ "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))" ]
-
if (!is_debug) {
cflags += [ "-Os" ]
}