Merge "linker: disable ld.config.txt in ASAN mode" into oc-dev am: 41e0ceb5c9
am: 08d3f97e7f

Change-Id: I32c0e73d2080ae1f65e5855bce6ecca467f20e42
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index 0a9aeab..2bdde1e 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -371,6 +371,15 @@
                                       bool is_asan,
                                       const Config** config,
                                       std::string* error_msg) {
+  // TODO(b/38114603) Currently, multiple namespaces does not support ASAN mode
+  // where some symbols should be intercepted via LD_PRELOAD; LD_PRELOADed libs
+  // are not being preloaded into the linked namespaces other than the default
+  // namespace. Until we fix the problem, we temporarily disable ld.config.txt
+  // in ASAN mode.
+  if (is_asan) {
+    return false;
+  }
+
   g_config.clear();
 
   std::unordered_map<std::string, PropertyValue> property_map;
diff --git a/linker/tests/linker_config_test.cpp b/linker/tests/linker_config_test.cpp
index 5e51113..b024011 100644
--- a/linker/tests/linker_config_test.cpp
+++ b/linker/tests/linker_config_test.cpp
@@ -174,6 +174,7 @@
   run_linker_config_smoke_test(false);
 }
 
-TEST(linker_config, asan_smoke) {
-  run_linker_config_smoke_test(true);
-}
+// TODO(b/38114603) revive this test when ld.config.txt is enabled for ASAN mode
+//TEST(linker_config, asan_smoke) {
+//  run_linker_config_smoke_test(true);
+//}