Likely libTest.so is built incorrectly and xxx.hardware.test@1.0-service is
ending up with an incorrect DT_NEEDED entry.  Can you show the output of
objdump -x lib/libTest.so and objdump -x
$OUT/vendor/bin/hw/xxx.hardware.test@1.0-service?  My guess is that SONAME
in libTest.so is "out/target/product/xxx/obj/lib/libTest.so" and that gets
copied into NEEDED in xxx.hardware.test@1.0-service.

On Thu, Aug 8, 2019 at 9:50 AM Tore Offermann <
tore.offerm...@tara-systems.de> wrote:

> Hello everyone,
>
> I am currently fighting adding a vendor HIDL service with prebuilt
> libraries on Android Pie.
>
> The HIDL service is created in vendor/...
> It depends on some prebuilt libraries.
>
> The prebuilt libraries are added to the Makefile for the service as
> follows:
>
> include $(CLEAR_VARS)
> LOCAL_PROPRIETARY_MODULE := true
> LOCAL_MODULE_SUFFIX := .so
> LOCAL_MODULE_CLASS := SHARED_LIBRARIES
> LOCAL_MODULE := libTest
> LOCAL_SRC_FILES := lib/libTest.so
> #include $(BUILD_PREBUILT)
>
> During android make the library is correctly copied to /vendor/lib and
> after I flash the device the lib is also available in that folder.
>
> I added the lib to the HIDL service makefile:
>
> include $(CLEAR_VARS)
>
> LOCAL_MODULE := xxx.hardware.test@1.0-service
> LOCAL_PROPRIETARY_MODULE := true
> LOCAL_MODULE_CLASS := EXECUTABLES
> LOCAL_MODULE_RELATIVE_PATH := hw
> LOCAL_INIT_RC := xxx.hardware.t...@1.0-service.rc
> LOCAL_CFLAGS := -Werror
>
> LOCAL_SRC_FILES := service.cpp
>
> LOCAL_C_INCLUDES := $(subst ${ANDROID}/,,$(LOCAL_C_INCLUDES))
>
>
> LOCAL_SHARED_LIBRARIES := \
>     xxx.hardware.test@1.0 \
>     libhidlbase \
>     libhidltransport \
>     libbase \
>     liblog \
>     libutils \
>     libTest
>
> include $(BUILD_EXECUTABLE)
>
> No issues during make, but after I start the device the linker complains
> with:
>
> 08-08 10:13:34.014  6814  6814 F linker  : CANNOT LINK EXECUTABLE
> "/vendor/bin/hw/xxx.hardware.test@1.0-service": library
> "out/target/product/xxx/obj/lib/libTest.so" not found
>
> Not sure how this can happen?
> I would suppose that the linker should check for the lib in /vendor/lib.
>
> Could it have something to do with:
>
> LOCAL_PRELINK_MODULE := false
>
> Thanks in advance!
>
> BR,
> Tore
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-building@googlegroups.com
> To unsubscribe from this group, send email to
> android-building+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-building+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-building/d6699eb8-3c08-4ac1-8e74-fb8634b1bd1f%40googlegroups.com
> <https://groups.google.com/d/msgid/android-building/d6699eb8-3c08-4ac1-8e74-fb8634b1bd1f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
You received this message because you are subscribed to the "Android Building" 
mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-building+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-building/CAMbhsRSmfp3KRh5OyauULYjbOyZhwjvb%3Dr2xWnY89y%2BAZdB_8A%40mail.gmail.com.

Reply via email to