Disable FORTIFY on ASAN builds

FORTIFY's *_chk functions mess with ASAN's library function
interceptors, which can apparently result in false-positives.

Since adding even more complexity to every run-time check condition in
FORTIFY doesn't seem like a great idea, and the majority of our builds
will still use FORTIFY anyway, turning FORTIFY off here seems
reasonable.

Bug: 63104159
Test: checkbuild on internal master + CtsBionicTestCases. No new
failures.

Change-Id: Id32e551e28ee70a9815ad140c3253b86f03de63f
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 71d8426..58eebc5 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -239,9 +239,18 @@
 
 #define __BIONIC_FORTIFY_UNKNOWN_SIZE ((size_t) -1)
 
-#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && \
-      (defined(__clang__) || (defined(__OPTIMIZE__) && __OPTIMIZE__ > 0))
-#  define __BIONIC_FORTIFY 1
+#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
+#  if defined(__clang__)
+/* FORTIFY's _chk functions effectively disable ASAN's stdlib interceptors. */
+#    if !__has_feature(address_sanitizer)
+#      define __BIONIC_FORTIFY 1
+#    endif
+#  elif defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+#    define __BIONIC_FORTIFY 1
+#  endif
+#endif
+
+#if defined(__BIONIC_FORTIFY)
 #  if _FORTIFY_SOURCE == 2
 #    define __bos_level 1
 #  else