Merge "Use -fno-builtin for libc and libm."
diff --git a/libc/Android.bp b/libc/Android.bp
index 00904aa..2dc10fc 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -67,6 +67,13 @@
 
     // GWP-ASan requires platform TLS.
     "-fno-emulated-tls",
+
+    // We know clang does a lot of harm by rewriting what we've said, and sadly
+    // never see any good it does, so let's just ask it to do what we say...
+    // (The specific motivating example was clang turning a loop that would only
+    // ever touch 0, 1, or 2 bytes into a call to memset, which was never going
+    // to amortize.)
+    "-fno-builtin",
 ]
 
 // Define some common cflags
diff --git a/libm/Android.bp b/libm/Android.bp
index b6ad356..83f40c2 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -490,6 +490,7 @@
         "-DFLT_EVAL_METHOD=0",
         "-include freebsd-compat.h",
         "-include fenv-access.h",
+        "-fno-builtin",
         "-fno-math-errno",
         "-Wall",
         "-Werror",