[Xiaomi Mi 5 ROMs, Kernels, Recoveries, & Other Dev] smeroni68:
Treble gemini progression... versioned_vndk!!

Hi guys,

we have some news about this project... are you curious?

Well, today [MENTION=5450821]sir mordred[/MENTION] has finally built the first version (only for internal use and testing... so do NOT ask for ETA) of VERSIONED VNDK TREBLE for our device!!

For who has time to read a bit more, here I'll report some info from devs!!

What's versioned_vndk?

It's simply a superior version of full-treble implementation which has been introduced by Google in 8.0 Oreo.

Even if the full-treble implementation was supposed to isolate system (framework) and vendor implementation (HALs), vendor modules can still access system modules (as fallback mechanism), but with versioned_vndk Google applied strict rules to full-treble implementation that no module which is labeled as vendor module can access to system modules and vice versa.

Android's dynamic linker is responsable to do this isolation/restriction as described in google's treble docs, so its just an updated treble implementation which applies full-restriction/isolation rule between system modules and vendor modules (libs,executables etc.), hence its superior version of full-treble implementation, and for reference versioned_vndk is not enabled neither in 8.0 nor 8.1 (Oreo-mr1) by default but as per google's treble documentation, enabling of versioned_vndk is recommended to OEMs on Oreo-mr1 and it has been clearly stated that it will be enforced on android P.

On versioned_vndk enabled builds, vendor image's treble-version (ro.vendor.vndk.version) is 27 and vendor image is using new subset of vndk-sp modules which are just an intermediate compatibility libs between system layer and vendor layer, and from the latest public AOSP sources, Google enabled versioned_vndk support for their Pixel 2 series phones (wahoo family) and didn't enable it for their fully-trebelized Pixel 1 series (Marlin and Sailfish) and with ongoing development which we are doing for Mi5 as JDCTeam we removed dozens of vendor <=> system dependencies (we are calling them as violation since as we said earlier, no vendor modules should access/depend system modules and vice versa, as per the versioned_vndk rule) we have now compiled and booted fine a build with versioned_vndk enabled, and we partially achieved versioned_vndk support for Mi5.

Now, our configuration (system, vendor and kernel) are configured against versioned_vndk changes/support and it booted fine, well why we call it as "partially"? Since we have a lots of closed source proprietary libs, unfortunatly a lots of them depend/link to system modules (violations! As per versioned_vndk rule) and since we dont have source for them, removing these dependency/linkage without breaking functionality requires really hard work... but thanx to our hexedit skilled devs we succesfully eliminated lots of violations and we have now a small number of violations left to fix, and since we still have these violations we temporarily disabled runtime-restriction (isolation) via BOARD_VNDK_RUNTIME_DISABLE as google suggested to OEMs in here https://source.android.com/devices/architecture/vndk/linker-namespace in case of some violations which need to be resolved.
​

Hope you enjoy the reading over here!! ;)