System Android.bp cannot link vendor library

7,289 views
Skip to first unread message

Dimitrije Petrovic

unread,
Dec 20, 2018, 10:48:08 AM12/20/18
to android-porting
Greetings,

I have a vendor library (let's call it mylib), located under vendor/ and to be Treble compliant it should be on the vendor partition.
It was previously built using Android.mk and this library was used by system/vold. Now as vold was migrated to Android.bp I migrated my library as well, so that vold can use it (as .bp files cannot use .mk files).
This solution worked fine until I realised that mylib is built under $OUT/system/lib/. I tried resolving this by adding:

vendor: true,

under the Android.bp file.

This is when these problems occured:
error: system/vold/Android.bp:89:1: dependency "mylib" of "libvold" missing variant:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:core, link:shared
available variants
:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:vendor, link:shared
error
: system/vold/tests/Android.bp:1:1: dependency "mylib" of "vold_tests" missing variant:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:core, link:shared
available variants
:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:vendor, link:shared
error
: system/vold/Android.bp:150:1: dependency "mylib" of "vold" missing variant:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:core, link:shared
available variants
:
  arch
:android_arm_armv7-a-neon_cortex-a15, image:vendor, link:shared



As I understand the problem here is that system binaries and libraries cannot link vendor libraries.
Can someone propose a solution to this problem? And I must add that this was working until vold was migrated to Android.bp-soong build (Android O to Android P migration in my case).

vincent becker

unread,
Mar 30, 2020, 10:54:47 AM3/30/20
to android-porting
Hi,
Correct, system libraries cannot link to vendor librairies, it is well described here : https://source.android.com/devices/architecture/vndk/build-system
Since Android O, the system checks dependencies of this type between modules. You could try to set vendor_available flag, or keep your library system (vendor:false) but you would not be Treble compliant anymore unless you hack the SEpolicy.
Cheers,

Zoltan Kuscsik

unread,
Mar 30, 2020, 11:57:22 AM3/30/20
to android-porting
You should create an HIDL interface for your library or open it as a module.

//Z


--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages