Merge "fortify_test.cpp: _FORTIFY_SOURCE=3 should be a superset of 2." into main
diff --git a/docs/defines.md b/docs/defines.md
index 65cc873..be48ad8 100644
--- a/docs/defines.md
+++ b/docs/defines.md
@@ -21,6 +21,15 @@
Genuine cases are quite rare, and `__BIONIC__` is often more specific (but
remember that it is possible -- if unusual -- to use bionic on the host).
+## `ANDROID` (rarely useful)
+
+Not to be confused with `__ANDROID__`, the similar-looking but very different
+`ANDROID` is _not_ set by the toolchain or NDK build system. This is set by
+the AOSP build system for both device and host code. For that reason, it's
+not typically very useful except as a signal when patching third-party code ---
+but even then, you'd typically _not_ want this because it's true for both
+device and host.
+
## `__ANDROID_API__`
If your code can be built targeting a variety of different OS versions, use
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index 9bd35bb..a74a514 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -238,7 +238,7 @@
// As we move some FORTIFY checks to be always on, __bos needs to be
// always available.
#if defined(__BIONIC_FORTIFY)
-# if _FORTIFY_SOURCE == 2
+# if _FORTIFY_SOURCE > 1
# define __bos_level 1
# else
# define __bos_level 0
diff --git a/tests/Android.bp b/tests/Android.bp
index 4509cc4..72236ab 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -1445,13 +1445,3 @@
"-D_FORTIFY_SOURCE=2",
],
}
-
-cc_library_static {
- name: "bionic-compile-time-tests3-clang++",
- defaults: [
- "bionic_compile_time_tests_defaults",
- ],
- cppflags: [
- "-D_FORTIFY_SOURCE=3",
- ],
-}