ART: Clean up dex2oats/oatdumps Android.bp modules

Use defaults to avoid repetition.

Test: mmma art
Test: m test-art-host-gtest-dex2oat_test
Change-Id: I142ae7aa900c560ad4772dbbb44dccc77fa4e7a6
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index e74947a..88e69cd 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -70,7 +70,6 @@
     },
     generated_sources: ["art_dex2oat_operator_srcs"],
     shared_libs: [
-        "libprofile",
         "libbase",
         "liblz4",
         "liblzma",
@@ -107,6 +106,7 @@
         "libart-compiler",
         "libart-dexlayout",
         "libart",
+        "libprofile",
     ],
 }
 
@@ -120,6 +120,7 @@
         "libartd-compiler",
         "libartd-dexlayout",
         "libartd",
+        "libprofiled",
     ],
 }
 
@@ -250,8 +251,8 @@
     ],
 }
 
-art_cc_binary {
-    name: "dex2oats",
+cc_defaults {
+    name: "dex2oats-defaults",
     device_supported: false,
     static_executable: true,
     defaults: ["dex2oat-defaults"],
@@ -268,6 +269,12 @@
         // Try to get rid of it.
         "-z muldefs",
     ],
+    static_libs: art_static_dependencies,
+}
+
+art_cc_binary {
+    name: "dex2oats",
+    defaults: ["dex2oats-defaults"],
     static_libs: [
         "libart-dex2oat",
         "libart-compiler",
@@ -278,35 +285,22 @@
         "libprofile",
         "libvixl-arm",
         "libvixl-arm64",
-    ] + art_static_dependencies,
+    ],
 }
 
 art_cc_binary {
     name: "dex2oatds",
-    device_supported: false,
-    static_executable: true,
     defaults: [
         "art_debug_defaults",
-        "dex2oat-defaults",
+        "dex2oats-defaults",
     ],
     target: {
-        darwin: {
-            enabled: false,
-        },
         linux_glibc_x86_64: {
             use_clang_lld: true,
         },
     },
     // b/79417743, oatdump 32-bit tests failed with clang lld
     use_clang_lld: false,
-    ldflags: [
-        // We need this because GC stress mode makes use of
-        // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
-        // defined in libgcc_eh.a(unwind-dw2.o)
-        // TODO: Having this is not ideal as it might obscure errors.
-        // Try to get rid of it.
-        "-z muldefs",
-    ],
     static_libs: [
         "libartd-dex2oat",
         "libartd-compiler",
@@ -317,7 +311,7 @@
         "libdexfiled",
         "libvixld-arm",
         "libvixld-arm64",
-    ] + art_static_dependencies,
+    ],
 }
 
 art_cc_test {
diff --git a/oatdump/Android.bp b/oatdump/Android.bp
index 77dede3..3cd8ae0 100644
--- a/oatdump/Android.bp
+++ b/oatdump/Android.bp
@@ -62,8 +62,8 @@
     ],
 }
 
-art_cc_binary {
-    name: "oatdumps",
+cc_defaults {
+    name: "oatdumps-defaults",
     device_supported: false,
     static_executable: true,
     defaults: ["oatdump-defaults"],
@@ -80,6 +80,12 @@
         // Try to get rid of it.
         "-z muldefs",
     ],
+    static_libs: art_static_dependencies,
+}
+
+art_cc_binary {
+    name: "oatdumps",
+    defaults: ["oatdumps-defaults"],
     static_libs: [
         "libart",
         "libdexfile",
@@ -89,33 +95,20 @@
         "libart-disassembler",
         "libvixl-arm",
         "libvixl-arm64",
-    ] + art_static_dependencies,
+    ],
 }
 
 art_cc_binary {
     name: "oatdumpds",
-    device_supported: false,
-    static_executable: true,
     defaults: [
         "art_debug_defaults",
-        "oatdump-defaults",
+        "oatdumps-defaults",
     ],
     target: {
-        darwin: {
-            enabled: false,
-        },
         linux_glibc_x86_64: {
             use_clang_lld: true,
         },
     },
-    ldflags: [
-        // We need this because GC stress mode makes use of
-        // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
-        // defined in libgcc_eh.a(unwind-dw2.o)
-        // TODO: Having this is not ideal as it might obscure errors.
-        // Try to get rid of it.
-        "-z muldefs",
-    ],
     static_libs: [
         "libartd",
         "libdexfiled",
@@ -125,7 +118,7 @@
         "libartd-disassembler",
         "libvixld-arm",
         "libvixld-arm64",
-    ] + art_static_dependencies,
+    ],
 }
 
 art_cc_test {