summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Wailes <chriswailes@google.com> 2019-01-17 14:57:10 -0800
committer Chris Wailes <chriswailes@google.com> 2019-01-17 15:12:30 -0800
commiteac7f4e15a0617b52aefd3414c019291ea029c9f (patch)
tree20cc4001638b282574f77fb29eba861444632221
parentc7a9dcf351235eb895965bfd96debdbd6b77bd36 (diff)
Added mitigation for b/122921367
Without this patch aosp/870566 will cause clang to abort during x86-eng asan builds (due to b/122921367). This is being committed separately to enable easy reversion in the future. Test: m Bug: 122921367 Change-Id: Id38a6ccabdcd0da02a53e76c47850e197016e781
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index a8e142784397..9e449a20a6f0 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -14,6 +14,15 @@
* limitations under the License.
*/
+/*
+ * Disable optimization of this file if we are compiling with the address
+ * sanitizer. This is a mitigation for b/122921367 and can be removed once the
+ * bug is fixed.
+ */
+#if __has_feature(address_sanitizer)
+#pragma clang optimize off
+#endif
+
#define LOG_TAG "Zygote"
// sys/mount.h has to come before linux/fs.h due to redefinition of MS_RDONLY, MS_BIND, etc