Revert "Build jemalloc for host, too."

This reverts commit fa9301657a7f5c1405cf2691d8e15e23eae113aa.

Reason for revert: Unknown build failure.

Change-Id: I0e29c414274568c70db361675014383f758acbc0
diff --git a/Android.bp b/Android.bp
index a2c8fb5..e7d9ea0 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,10 +44,9 @@
 //     usually decreases the amount of PSS used, but can increase
 //     fragmentation.
 
-android_common_cflags = [
-    // Default to a single arena for svelte configurations to minimize
-    // PSS. This will be overridden by android_product_variables for
-    // non-svelte configs.
+// Default to a single arena for svelte configurations to minimize
+// PSS consumed by jemalloc.
+common_cflags += [
     "-DANDROID_MAX_ARENAS=1",
     "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
 ]
@@ -57,7 +56,7 @@
     "include",
 ]
 
-android_product_variables = {
+common_product_variables = {
     // Only enable the tcache on non-svelte configurations, to save PSS.
     malloc_not_svelte: {
         cflags: [
@@ -73,20 +72,9 @@
 cc_defaults {
     name: "jemalloc_defaults",
     defaults: ["linux_bionic_supported"],
-    host_supported: true,
     cflags: common_cflags,
 
-    target: {
-        android: {
-            cflags: android_common_cflags + [
-                "-include android/include/log.h",
-            ],
-            product_variables: android_product_variables,
-        },
-        linux_glibc: {
-            enabled: true,
-        },
-    },
+    product_variables: common_product_variables,
 
     multilib: {
         lib32: {
@@ -144,19 +132,13 @@
 //-----------------------------------------------------------------------
 // jemalloc static library
 //-----------------------------------------------------------------------
-cc_library {
+cc_library_static {
     name: "libjemalloc",
     recovery_available: true,
 
     defaults: ["jemalloc_defaults"],
 
-    target: {
-        android: {
-            shared: {
-                enabled: false,
-            },
-        },
-    },
+    cflags: ["-include bionic/libc/async_safe/include/async_safe/log.h"],
 
     srcs: lib_src_files,
 }
@@ -171,6 +153,7 @@
 
     cflags: [
         "-DJEMALLOC_JET",
+        "-include android/include/log.h",
     ],
 
     srcs: lib_src_files,
@@ -197,8 +180,10 @@
     name: "libjemalloc_unittest",
 
     defaults: ["jemalloc_defaults"],
+
     cflags: [
         "-DJEMALLOC_UNIT_TEST",
+        "-include android/include/log.h",
     ],
 
     local_include_dirs: [
@@ -209,6 +194,7 @@
     srcs: jemalloc_testlib_srcs,
 
     whole_static_libs: ["libjemalloc_jet"],
+
 }
 
 //-----------------------------------------------------------------------
@@ -261,12 +247,13 @@
 cc_test {
     name: "jemalloc_unittests",
 
-    defaults: ["jemalloc_defaults"],
-
     gtest: false,
 
+    product_variables: common_product_variables,
+
     cflags: common_cflags + [
         "-DJEMALLOC_UNIT_TEST",
+        "-include android/include/log.h",
     ],
 
     local_include_dirs: common_c_local_includes + [
@@ -293,6 +280,7 @@
 
     cflags: [
         "-DJEMALLOC_INTEGRATION_TEST",
+        "-include android/include/log.h",
     ],
 
     local_include_dirs: [
@@ -311,6 +299,7 @@
     "test/integration/aligned_alloc.c",
     "test/integration/allocated.c",
     "test/integration/chunk.c",
+    "test/integration/iterate.c",
     "test/integration/MALLOCX_ARENA.c",
     "test/integration/mallocx.c",
     "test/integration/overflow.c",
@@ -322,19 +311,17 @@
     "test/integration/xallocx.c",
 ]
 
-android_integration_tests = [
-    "test/integration/iterate.c",
-]
-
 cc_test {
-    name: "jemalloc_integrationtests",
 
-    defaults: ["jemalloc_defaults"],
+    name: "jemalloc_integrationtests",
 
     gtest: false,
 
+    product_variables: common_product_variables,
+
     cflags: common_cflags + [
         "-DJEMALLOC_INTEGRATION_TEST",
+        "-include android/include/log.h",
     ],
 
     local_include_dirs: common_c_local_includes + [
@@ -343,11 +330,6 @@
     ],
 
     srcs: integration_tests,
-    target: {
-        android: {
-            srcs: android_integration_tests,
-        },
-    },
 
     static_libs: ["libjemalloc_integrationtest"],