Generate the per-arch .map files at build time.

We shouldn't be checking in these generated files...

Bug: N/A
Test: ran tests
Change-Id: Ib67c1ba839eacd7acebd713e1dcd4dd2c25d67f0
diff --git a/libdl/Android.bp b/libdl/Android.bp
index 656d3ab..c4078a0 100644
--- a/libdl/Android.bp
+++ b/libdl/Android.bp
@@ -56,18 +56,12 @@
     // for x86, exclude libgcc_eh.a for the same reasons as above
     arch: {
         arm: {
-            version_script: "libdl.arm.map",
+            version_script: ":libdl.arm.map",
             pack_relocations: false,
             ldflags: ["-Wl,--hash-style=both"],
         },
         arm64: {
-            version_script: "libdl.arm64.map",
-        },
-        mips: {
-            version_script: "libdl.mips.map",
-        },
-        mips64: {
-            version_script: "libdl.mips64.map",
+            version_script: ":libdl.arm64.map",
         },
         x86: {
             pack_relocations: false,
@@ -75,11 +69,11 @@
                 "-Wl,--exclude-libs=libgcc_eh.a",
                 "-Wl,--hash-style=both",
             ],
-            version_script: "libdl.x86.map",
+            version_script: ":libdl.x86.map",
         },
         x86_64: {
             ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
-            version_script: "libdl.x86_64.map",
+            version_script: ":libdl.x86_64.map",
         },
     },
     shared: {
@@ -118,3 +112,35 @@
     name: "libdl",
     symbol_file: "libdl.map.txt",
 }
+
+genrule {
+    name: "libdl.arm.map",
+    out: ["libdl.arm.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.arm64.map",
+    out: ["libdl.arm64.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.x86.map",
+    out: ["libdl.x86.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
+}
+
+genrule {
+    name: "libdl.x86_64.map",
+    out: ["libdl.x86_64.map"],
+    srcs: ["libdl.map.txt"],
+    tool_files: [":bionic-generate-version-script"],
+    cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
+}
diff --git a/libdl/libdl.arm.map b/libdl/libdl.arm.map
deleted file mode 100644
index 28f0601..0000000
--- a/libdl/libdl.arm.map
+++ /dev/null
@@ -1,56 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dl_unwind_find_exidx; # arm
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.arm64.map b/libdl/libdl.arm64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.arm64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.mips.map b/libdl/libdl.mips.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.mips.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.mips64.map b/libdl/libdl.mips64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.mips64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.x86.map b/libdl/libdl.x86.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.x86.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;
diff --git a/libdl/libdl.x86_64.map b/libdl/libdl.x86_64.map
deleted file mode 100644
index a03e9e1..0000000
--- a/libdl/libdl.x86_64.map
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by genversion-scripts.py. Do not edit.
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LIBC {
-  global:
-    android_dlopen_ext; # introduced=21
-    dl_iterate_phdr; # introduced-arm=21
-    dladdr;
-    dlclose;
-    dlerror;
-    dlopen;
-    dlsym;
-  local:
-    *;
-};
-
-LIBC_N {
-  global:
-    android_get_application_target_sdk_version; # introduced=24 versioned=29
-    dlvsym; # introduced=24
-} LIBC;
-
-LIBC_OMR1 { # introduced=27
-  global:
-    __cfi_shadow_size;
-    __cfi_slowpath;
-    __cfi_slowpath_diag;
-} LIBC_N;
-
-LIBC_PLATFORM {
-  global:
-    __cfi_init;
-    android_dlwarning;
-    android_set_application_target_sdk_version;
-    android_get_LD_LIBRARY_PATH;
-    android_update_LD_LIBRARY_PATH;
-    android_init_anonymous_namespace;
-    android_create_namespace;
-    android_link_namespaces;
-    android_get_exported_namespace;
-} LIBC_OMR1;