Update Android.bp with arch-specific version scripts

Change-Id: I59b34f21b54e8a2084bb318a08c4092064f48083
diff --git a/libc/Android.bp b/libc/Android.bp
index 93854b7..ab934b9 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1952,9 +1952,6 @@
     stl: "none",
     system_shared_libs: [],
 
-    // Don't re-export new/delete and friends, even if the compiler really wants to.
-    version_script: "libc.map",
-
     // We'd really like to do this for all architectures, but since this wasn't done
     // before, these symbols must continue to be exported on LP32 for binary
     // compatibility.
@@ -1972,6 +1969,9 @@
             //TODO: This is to work around b/24465209. Remove after root cause is fixed
             ldflags: ["-Wl,--hash-style=both"],
 
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.arm.map",
+
             shared: {
                 srcs: ["arch-arm/bionic/exidx_dynamic.c"],
             },
@@ -1983,12 +1983,30 @@
                 "arch-arm/bionic/atexit_legacy.c",
             ],
         },
+        arm64: {
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.arm64.map",
+        },
+        mips: {
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.mips.map",
+        },
+        mips64: {
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.mips64.map",
+        },
         x86: {
             //TODO: This is to work around b/24465209. Remove after root cause is fixed
             ldflags: ["-Wl,--hash-style=both"],
+
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.x86.map",
         },
         x86_64: {
             clang: use_clang_x86_64,
+
+            // Don't re-export new/delete and friends, even if the compiler really wants to.
+            version_script: "libc.x86_64.map",
         },
     },
     sanitize: ["never"],
diff --git a/libdl/Android.bp b/libdl/Android.bp
index 46dd0eb..2aa9b68 100644
--- a/libdl/Android.bp
+++ b/libdl/Android.bp
@@ -13,15 +13,28 @@
     // DO NOT REMOVE --exclude-libs!
 
     ldflags: ["-Wl,--exclude-libs=libgcc.a"],
-    version_script: "libdl.map",
 
     // for x86, exclude libgcc_eh.a for the same reasons as above
     arch: {
+        arm: {
+            version_script: "libdl.arm.map",
+        },
+        arm64: {
+            version_script: "libdl.arm64.map",
+        },
+        mips: {
+            version_script: "libdl.mips.map",
+        },
+        mips64: {
+            version_script: "libdl.mips64.map",
+        },
         x86: {
             ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
+            version_script: "libdl.x86.map",
         },
         x86_64: {
             ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
+            version_script: "libdl.x86_64.map",
         },
     },
     srcs: ["libdl.c"],
diff --git a/libm/Android.bp b/libm/Android.bp
index 3ae086f..0fc860a 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -254,6 +254,7 @@
     "-D__BIONIC_NO_MATH_INLINES",
     "-DFLT_EVAL_METHOD=0",
     "-include freebsd-compat.h",
+    "-Werror",
     "-Wno-missing-braces",
     "-Wno-parentheses",
     "-Wno-sign-compare",
@@ -290,8 +291,6 @@
     native_coverage: bionic_coverage,
     sanitize: ["never"],
 
-    version_script: "libm.map",
-
     multilib: {
         lib64: {
             srcs: libm_ld128_src_files,
@@ -319,6 +318,7 @@
             ],
             instruction_set: "arm",
             ldflags: ["-Wl,--hash-style=both"],
+            version_script: "libm.arm.map",
         },
 
         arm64: {
@@ -350,14 +350,17 @@
                 "upstream-freebsd/lib/msun/src/s_trunc.c",
                 "upstream-freebsd/lib/msun/src/s_truncf.c",
             ],
+            version_script: "libm.arm64.map",
         },
 
         mips: {
             srcs: ["mips/fenv.c"],
+            version_script: "libm.mips.map",
         },
 
         mips64: {
             srcs: ["mips/fenv.c"],
+            version_script: "libm.mips64.map",
         },
 
         x86: {
@@ -366,12 +369,14 @@
             // Clang has wrong long double sizes for x86.
             clang: false,
             ldflags: ["-Wl,--hash-style=both"],
+            version_script: "libm.x86.map",
         },
 
         x86_64: {
             srcs: ["amd64/fenv.c"],
             // Clang has wrong long double sizes for x86.
             clang: false,
+            version_script: "libm.x86_64.map",
         },
     },