From 88bdf80d1756577490daef717926b4535dece4e8 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 22 Jan 2019 14:52:51 +0000 Subject: [PATCH] Conscrypt should only link against bionic. Also remove useless code in native_loader.cpp Test: m Change-Id: Id176256cc36fa32d3f722e1443429cb9fbec05f2 --- libnativeloader/native_loader.cpp | 4 ---- rootdir/etc/ld.config.txt | 7 ++++--- rootdir/etc/ld.config.vndk_lite.txt | 7 ++++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp index ab17b29d4..ad967dbee 100644 --- a/libnativeloader/native_loader.cpp +++ b/libnativeloader/native_loader.cpp @@ -43,10 +43,6 @@ #include #endif -extern "C" { -struct android_namespace_t* android_get_exported_namespace(const char*); -} - #define CHECK(predicate) LOG_ALWAYS_FATAL_IF(!(predicate),\ "%s:%d: %s CHECK '" #predicate "' failed.",\ __FILE__, __LINE__, __FUNCTION__) diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index 3804c86e7..eb29c8b03 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt @@ -152,11 +152,12 @@ namespace.media.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% namespace.conscrypt.isolated = true namespace.conscrypt.visible = true +# Keep in sync with ld.config.txt in the com.android.runtime APEX. namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB} namespace.conscrypt.links = default -# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library -# when it exists. -namespace.conscrypt.link.default.allow_all_shared_libs = true +namespace.conscrypt.link.default.shared_libs = libc.so +namespace.conscrypt.link.default.shared_libs += libm.so +namespace.conscrypt.link.default.shared_libs += libdl.so ############################################################################### # "sphal" namespace diff --git a/rootdir/etc/ld.config.vndk_lite.txt b/rootdir/etc/ld.config.vndk_lite.txt index 2ce25b548..b368805e5 100644 --- a/rootdir/etc/ld.config.vndk_lite.txt +++ b/rootdir/etc/ld.config.vndk_lite.txt @@ -99,11 +99,12 @@ namespace.media.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% namespace.conscrypt.isolated = true namespace.conscrypt.visible = true +# Keep in sync with ld.config.txt in the com.android.runtime APEX. namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB} namespace.conscrypt.links = default -# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library -# when it exists. -namespace.conscrypt.link.default.allow_all_shared_libs = true +namespace.conscrypt.link.default.shared_libs = libc.so +namespace.conscrypt.link.default.shared_libs += libm.so +namespace.conscrypt.link.default.shared_libs += libdl.so ############################################################################### # "sphal" namespace