Place native shared libs for soong build DCLA.
Currently, DCLA is built in rapid. With new train build, DCLA will be
directly built in soong, just like a regular module, refer to
b/239679485. In old rapid built DCLA, native shared libs are placed the
following way inside apex:
/lib(64)?/foo.so/<sha256 foo.so>/foo.so
The sha256 hash is used to differentiate different libs. To ensure the
same lib placement in soong built DCLA, three changes are made:
(1) in apex.go, added an apex soong module property called
dynamic_common_lib_apex to indicate if this apex is a DCLA
(2) in builder.go, update apexRule to call into run_apexer binary
instead of apexer binary. run_apexer binary is a wrapper of apexer
binary. If it is DCLA, the wrapper binary will place the native
shared libs in desired location and update canned_fs_config accordingly.
TEST: manuualy added this field to adbd. Local build by banchan
and then inspect the payload image contensts. All libs are proprely
placed.
BUG: 241096765
Change-Id: I2a5e7ea75a6e9a7af1932ff7dccb9dc3a3785db9
diff --git a/apex/apex.go b/apex/apex.go
index e9b0815..990154e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -192,6 +192,10 @@
// with the tool to sign payload contents.
Custom_sign_tool *string
+ // Whether this is a dynamic common lib apex, if so the native shared libs will be placed
+ // in a special way that include the digest of the lib file under /lib(64)?
+ Dynamic_common_lib_apex *bool
+
// Canonical name of this APEX bundle. Used to determine the path to the
// activated APEX on device (i.e. /apex/<apexVariationName>), and used for the
// apex mutator variations. For override_apex modules, this is the name of the
@@ -1472,6 +1476,11 @@
return proptools.Bool(a.properties.Test_only_force_compression)
}
+// See the dynamic_common_lib_apex property
+func (a *apexBundle) dynamic_common_lib_apex() bool {
+ return proptools.BoolDefault(a.properties.Dynamic_common_lib_apex, false)
+}
+
// These functions are interfacing with cc/sanitizer.go. The entire APEX (along with all of its
// members) can be sanitized, either forcibly, or by the global configuration. For some of the
// sanitizers, extra dependencies can be forcibly added as well.