base: dlopen/dlsym for liblog when SDK_VER <= 29

libbase doesn't have to rely on dlopen/dlsym to use liblog's new symbols
when it is built for __ANDROID_SDK_VERSION__ > 29.

Bug: 150860940
Test: TARGET_BUILD_APPS="com.android.adbd com.android.resolv" m
      objdump -T ...shared_com.android.resolv/libbase.so | grep LIBLOG_R
        => should be none because resolv apex is targeting 29
      objdump -T ...shared_com.android.adbd/libbase.so | grep LIBLOG_R
        => should list all new symbols because adbd apex is targeting R
      objdump -T ...shared/libbase.so | grep LIBLOG_R
        => should list all new symbols

Merged-In: I7f7f16510d7637cd380fe35ea9ff3e804f38851d
Change-Id: I7f7f16510d7637cd380fe35ea9ff3e804f38851d
(cherry picked from commit 22207e6590)
This commit is contained in:
Jooyung Han 2020-03-17 03:43:03 +09:00
parent 8a178c184f
commit 2d954136fa
2 changed files with 1 additions and 7 deletions

View File

@ -74,10 +74,6 @@ cc_defaults {
"test_utils.cpp",
],
static: {
cflags: ["-DNO_LIBLOG_DLSYM"],
},
cppflags: ["-Wexit-time-destructors"],
shared_libs: ["liblog"],
target: {

View File

@ -16,11 +16,9 @@
#include "liblog_symbols.h"
#if defined(__ANDROID__)
#if !defined(NO_LIBLOG_DLSYM) || defined(__ANDROID_APEX__)
#if defined(__ANDROID_SDK_VERSION__) && (__ANDROID_SDK_VERSION__ <= 29)
#define USE_DLSYM
#endif
#endif
#ifdef USE_DLSYM
#include <dlfcn.h>