Snap for 6630229 from cbaf0a0453af4db3a865a8a3c014762aabc6e867 to rvc-release

Change-Id: I59c1146afe4075ce648bf04e3b60e3cf102e3a2c
diff --git a/Android.bp b/Android.bp
index a93f70c..38444f4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,12 +14,6 @@
 // limitations under the License.
 //
 
-// We introduce this namespace so that native bridge guest libraries are built
-// only for targets that explicitly use this namespace via PRODUCT_SOONG_NAMESPACES
-// and checkbuild.
-soong_namespace {
-}
-
 cc_defaults {
     name: "native_bridge_stub_library_defaults",
     cflags: [
diff --git a/linker/Android.bp b/linker/Android.bp
index aed9edf..2f47e6e 100644
--- a/linker/Android.bp
+++ b/linker/Android.bp
@@ -37,16 +37,19 @@
     ],
 
     enabled: false,
+    target: {
+       native_bridge: {
+           enabled: true,
+       }
+    },
     arch: {
         arm: {
             srcs: ["init_static_tls_arm.S"],
             version_script: "linker.arm.map",
-            enabled: true,
         },
         arm64: {
             srcs: ["init_static_tls_arm64.S"],
             version_script: "linker.generic.map",
-            enabled: true,
         },
     },
 
diff --git a/overriding/Android.bp b/overriding/Android.bp
new file mode 100644
index 0000000..73e4457
--- /dev/null
+++ b/overriding/Android.bp
@@ -0,0 +1,21 @@
+//
+// Copyright (C) 2018 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.
+//
+
+// We introduce this namespace so that native bridge guest libraries are built
+// only for targets that explicitly use this namespace via PRODUCT_SOONG_NAMESPACES
+// and checkbuild.
+soong_namespace {
+}
diff --git a/libc/Android.bp b/overriding/libc/Android.bp
similarity index 100%
rename from libc/Android.bp
rename to overriding/libc/Android.bp
diff --git a/libc/__cxa_thread_atexit_impl.cpp b/overriding/libc/__cxa_thread_atexit_impl.cpp
similarity index 100%
rename from libc/__cxa_thread_atexit_impl.cpp
rename to overriding/libc/__cxa_thread_atexit_impl.cpp
diff --git a/libc/__libc_add_main_thread.cpp b/overriding/libc/__libc_add_main_thread.cpp
similarity index 100%
rename from libc/__libc_add_main_thread.cpp
rename to overriding/libc/__libc_add_main_thread.cpp
diff --git a/libc/exit.c b/overriding/libc/exit.c
similarity index 100%
rename from libc/exit.c
rename to overriding/libc/exit.c
diff --git a/libc/fork.cpp b/overriding/libc/fork.cpp
similarity index 100%
rename from libc/fork.cpp
rename to overriding/libc/fork.cpp
diff --git a/libc/malloc_init.cpp b/overriding/libc/malloc_init.cpp
similarity index 100%
rename from libc/malloc_init.cpp
rename to overriding/libc/malloc_init.cpp
diff --git a/libc/stubs_arm.cpp b/overriding/libc/stubs_arm.cpp
similarity index 100%
rename from libc/stubs_arm.cpp
rename to overriding/libc/stubs_arm.cpp
diff --git a/libc/stubs_arm64.cpp b/overriding/libc/stubs_arm64.cpp
similarity index 100%
rename from libc/stubs_arm64.cpp
rename to overriding/libc/stubs_arm64.cpp
diff --git a/libicui18n/Android.bp b/overriding/libicui18n/Android.bp
similarity index 100%
rename from libicui18n/Android.bp
rename to overriding/libicui18n/Android.bp
diff --git a/libicui18n/stubs_arm.cc b/overriding/libicui18n/stubs_arm.cc
similarity index 100%
rename from libicui18n/stubs_arm.cc
rename to overriding/libicui18n/stubs_arm.cc
diff --git a/libicui18n/stubs_arm64.cc b/overriding/libicui18n/stubs_arm64.cc
similarity index 100%
rename from libicui18n/stubs_arm64.cc
rename to overriding/libicui18n/stubs_arm64.cc
diff --git a/libicuuc/Android.bp b/overriding/libicuuc/Android.bp
similarity index 100%
rename from libicuuc/Android.bp
rename to overriding/libicuuc/Android.bp
diff --git a/libicuuc/stubs_arm.cc b/overriding/libicuuc/stubs_arm.cc
similarity index 100%
rename from libicuuc/stubs_arm.cc
rename to overriding/libicuuc/stubs_arm.cc
diff --git a/libicuuc/stubs_arm64.cc b/overriding/libicuuc/stubs_arm64.cc
similarity index 100%
rename from libicuuc/stubs_arm64.cc
rename to overriding/libicuuc/stubs_arm64.cc
diff --git a/vdso/Android.bp b/vdso/Android.bp
index ba79c51..d93e3db 100644
--- a/vdso/Android.bp
+++ b/vdso/Android.bp
@@ -18,13 +18,16 @@
     name: "libnative_bridge_vdso",
     enabled: false,
     native_bridge_supported: true,
+    target: {
+       native_bridge: {
+           enabled: true,
+       }
+    },
     arch: {
         arm64: {
-            enabled: true,
             srcs: ["vdso_arm64.S"],
         },
         arm: {
-            enabled: true,
             srcs: ["vdso_arm.S"],
         },
     },