fortify: allow diagnostics without run-time checks (attempt #2)

In configs like ASAN, we can't use _chk functions. This CL builds off of
previous work to allow us to still emit diagnostics in conditions like
these.

Wasn't 100% sure what a good test story would look like here. Opinions
appreciated.

Bug: 141267932
Test: checkbuild on internal-master. TreeHugger for x86_64.
Change-Id: I65da9ecc9903d51a09f740e38ab413b9beaeed88
diff --git a/libc/include/bits/fortify/poll.h b/libc/include/bits/fortify/poll.h
index 7a727a4..30fdce4 100644
--- a/libc/include/bits/fortify/poll.h
+++ b/libc/include/bits/fortify/poll.h
@@ -44,13 +44,13 @@
     __overloadable
     __clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
                      "in call to 'poll', fd_count is larger than the given buffer") {
-#if __ANDROID_API__ >= __ANDROID_API_M__
+#if __ANDROID_API__ >= __ANDROID_API_M__ && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
   size_t bos_fds = __bos(fds);
 
   if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
     return __poll_chk(fds, fd_count, timeout, bos_fds);
   }
-#endif /* __ANDROID_API__ >= __ANDROID_API_M__ */
+#endif
   return __call_bypassing_fortify(poll)(fds, fd_count, timeout);
 }
 
@@ -60,13 +60,13 @@
     __overloadable
     __clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
                      "in call to 'ppoll', fd_count is larger than the given buffer") {
-#if __ANDROID_API__ >= __ANDROID_API_M__
+#if __ANDROID_API__ >= __ANDROID_API_M__ && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
   size_t bos_fds = __bos(fds);
 
   if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
     return __ppoll_chk(fds, fd_count, timeout, mask, bos_fds);
   }
-#endif /* __ANDROID_API__ >= __ANDROID_API_M__ */
+#endif
   return __call_bypassing_fortify(ppoll)(fds, fd_count, timeout, mask);
 }
 #endif /* __ANDROID_API__ >= __ANDROID_API_L__ */
@@ -77,11 +77,13 @@
     __overloadable
     __clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
                      "in call to 'ppoll64', fd_count is larger than the given buffer") {
+#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
   size_t bos_fds = __bos(fds);
 
   if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
     return __ppoll64_chk(fds, fd_count, timeout, mask, bos_fds);
   }
+#endif
   return __call_bypassing_fortify(ppoll64)(fds, fd_count, timeout, mask);
 }
 #endif /* __ANDROID_API__ >= __ANDROID_API_P__ */