diff options
author | Jiyong Park <jiyong@google.com> | 2017-05-11 02:15:07 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2017-05-15 11:05:44 +0900 |
commit | 375f1a4d3288a43cb0b6441906c693301b21e78d (patch) | |
tree | edb0b17405e4cdcf368f73fcbd564261792d2091 | |
parent | ed5b29d32f09a2985bd8f1bb0add2fa821892a65 (diff) | |
download | libhardware-375f1a4d3288a43cb0b6441906c693301b21e78d.tar.gz |
Load legacy HAL modules from the sphal namespace
'vndk' namespace should not have /vendor/lib/* in its search paths.
However, /vendor/lib/* has been included due to libhardware; it should
be able to load HAL libs in /vendor/lib and /vendor/lib/hw.
Since the HAL libs are not vndk but part of SP-HAL, they are loaded
explicitly from the 'sphal' namespace.
Bug: 37731053
Bug: 37323945
Test: sailfish builds and boots successfuly
Test: BOARD_VNDK_VERSION=current m libhardware.vendor successful
Merged-In: I1e1619de7deaa0e6610180e585bd7775887bc562
Change-Id: I1e1619de7deaa0e6610180e585bd7775887bc562
(cherry picked from commit 4d67d2e13a8591a02c63e6f89c3dbdbf94b0c629)
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | hardware.c | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -23,6 +23,7 @@ cc_library_shared { "libcutils", "liblog", "libdl", + "libvndksupport", ], cflags: ["-DQEMU_HARDWARE"], @@ -29,6 +29,8 @@ #define LOG_TAG "HAL" #include <log/log.h> +#include <vndksupport/linker.h> + /** Base path of the hal modules */ #if defined(__LP64__) #define HAL_LIBRARY_PATH1 "/system/lib64/hw" @@ -80,7 +82,7 @@ static int load(const char *id, * dlopen returns. Since RTLD_GLOBAL is not or'd in with * RTLD_NOW the external symbols will not be global */ - handle = dlopen(path, RTLD_NOW); + handle = android_load_sphal_library(path, RTLD_NOW); if (handle == NULL) { char const *err_str = dlerror(); ALOGE("load: module=%s\n%s", path, err_str?err_str:"unknown"); |