Merge "Place native shared libs for soong build DCLA." am: ee959f49eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2172270 Change-Id: Ice1e46d7b51d26e596aa6efca371b61317c94a0b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -192,6 +192,10 @@ type apexBundleProperties struct {
|
|||||||
// with the tool to sign payload contents.
|
// with the tool to sign payload contents.
|
||||||
Custom_sign_tool *string
|
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
|
// 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
|
// 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
|
// apex mutator variations. For override_apex modules, this is the name of the
|
||||||
@@ -1472,6 +1476,11 @@ func (a *apexBundle) testOnlyShouldForceCompression() bool {
|
|||||||
return proptools.Bool(a.properties.Test_only_force_compression)
|
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
|
// 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
|
// members) can be sanitized, either forcibly, or by the global configuration. For some of the
|
||||||
// sanitizers, extra dependencies can be forcibly added as well.
|
// sanitizers, extra dependencies can be forcibly added as well.
|
||||||
|
@@ -39,6 +39,7 @@ func init() {
|
|||||||
pctx.Import("android/soong/cc/config")
|
pctx.Import("android/soong/cc/config")
|
||||||
pctx.Import("android/soong/java")
|
pctx.Import("android/soong/java")
|
||||||
pctx.HostBinToolVariable("apexer", "apexer")
|
pctx.HostBinToolVariable("apexer", "apexer")
|
||||||
|
pctx.HostBinToolVariable("apexer_with_DCLA_preprocessing", "apexer_with_DCLA_preprocessing")
|
||||||
// ART minimal builds (using the master-art manifest) do not have the "frameworks/base"
|
// ART minimal builds (using the master-art manifest) do not have the "frameworks/base"
|
||||||
// projects, and hence cannot build 'aapt2'. Use the SDK prebuilt instead.
|
// projects, and hence cannot build 'aapt2'. Use the SDK prebuilt instead.
|
||||||
hostBinToolVariableWithPrebuilt := func(name, prebuiltDir, tool string) {
|
hostBinToolVariableWithPrebuilt := func(name, prebuiltDir, tool string) {
|
||||||
@@ -115,7 +116,35 @@ var (
|
|||||||
Rspfile: "${out}.copy_commands",
|
Rspfile: "${out}.copy_commands",
|
||||||
RspfileContent: "${copy_commands}",
|
RspfileContent: "${copy_commands}",
|
||||||
Description: "APEX ${image_dir} => ${out}",
|
Description: "APEX ${image_dir} => ${out}",
|
||||||
}, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key", "opt_flags", "manifest", "payload_fs_type")
|
}, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key",
|
||||||
|
"opt_flags", "manifest")
|
||||||
|
|
||||||
|
DCLAApexRule = pctx.StaticRule("DCLAApexRule", blueprint.RuleParams{
|
||||||
|
Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` +
|
||||||
|
`(. ${out}.copy_commands) && ` +
|
||||||
|
`APEXER_TOOL_PATH=${tool_path} ` +
|
||||||
|
`${apexer_with_DCLA_preprocessing} ` +
|
||||||
|
`--apexer ${apexer} ` +
|
||||||
|
`--canned_fs_config ${canned_fs_config} ` +
|
||||||
|
`${image_dir} ` +
|
||||||
|
`${out} ` +
|
||||||
|
`-- ` +
|
||||||
|
`--include_build_info ` +
|
||||||
|
`--force ` +
|
||||||
|
`--payload_type image ` +
|
||||||
|
`--key ${key} ` +
|
||||||
|
`--file_contexts ${file_contexts} ` +
|
||||||
|
`--manifest ${manifest} ` +
|
||||||
|
`${opt_flags} `,
|
||||||
|
CommandDeps: []string{"${apexer_with_DCLA_preprocessing}", "${apexer}", "${avbtool}", "${e2fsdroid}",
|
||||||
|
"${merge_zips}", "${mke2fs}", "${resize2fs}", "${sefcontext_compile}", "${make_f2fs}",
|
||||||
|
"${sload_f2fs}", "${make_erofs}", "${soong_zip}", "${zipalign}", "${aapt2}",
|
||||||
|
"prebuilts/sdk/current/public/android.jar"},
|
||||||
|
Rspfile: "${out}.copy_commands",
|
||||||
|
RspfileContent: "${copy_commands}",
|
||||||
|
Description: "APEX ${image_dir} => ${out}",
|
||||||
|
}, "tool_path", "image_dir", "copy_commands", "file_contexts", "canned_fs_config", "key",
|
||||||
|
"opt_flags", "manifest", "is_DCLA")
|
||||||
|
|
||||||
zipApexRule = pctx.StaticRule("zipApexRule", blueprint.RuleParams{
|
zipApexRule = pctx.StaticRule("zipApexRule", blueprint.RuleParams{
|
||||||
Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` +
|
Command: `rm -rf ${image_dir} && mkdir -p ${image_dir} && ` +
|
||||||
@@ -662,22 +691,41 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
|
|
||||||
optFlags = append(optFlags, "--payload_fs_type "+a.payloadFsType.string())
|
optFlags = append(optFlags, "--payload_fs_type "+a.payloadFsType.string())
|
||||||
|
|
||||||
ctx.Build(pctx, android.BuildParams{
|
if a.dynamic_common_lib_apex() {
|
||||||
Rule: apexRule,
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Implicits: implicitInputs,
|
Rule: DCLAApexRule,
|
||||||
Output: unsignedOutputFile,
|
Implicits: implicitInputs,
|
||||||
Description: "apex (" + apexType.name() + ")",
|
Output: unsignedOutputFile,
|
||||||
Args: map[string]string{
|
Description: "apex (" + apexType.name() + ")",
|
||||||
"tool_path": outHostBinDir + ":" + prebuiltSdkToolsBinDir,
|
Args: map[string]string{
|
||||||
"image_dir": imageDir.String(),
|
"tool_path": outHostBinDir + ":" + prebuiltSdkToolsBinDir,
|
||||||
"copy_commands": strings.Join(copyCommands, " && "),
|
"image_dir": imageDir.String(),
|
||||||
"manifest": a.manifestPbOut.String(),
|
"copy_commands": strings.Join(copyCommands, " && "),
|
||||||
"file_contexts": fileContexts.String(),
|
"manifest": a.manifestPbOut.String(),
|
||||||
"canned_fs_config": cannedFsConfig.String(),
|
"file_contexts": fileContexts.String(),
|
||||||
"key": a.privateKeyFile.String(),
|
"canned_fs_config": cannedFsConfig.String(),
|
||||||
"opt_flags": strings.Join(optFlags, " "),
|
"key": a.privateKeyFile.String(),
|
||||||
},
|
"opt_flags": strings.Join(optFlags, " "),
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ctx.Build(pctx, android.BuildParams{
|
||||||
|
Rule: apexRule,
|
||||||
|
Implicits: implicitInputs,
|
||||||
|
Output: unsignedOutputFile,
|
||||||
|
Description: "apex (" + apexType.name() + ")",
|
||||||
|
Args: map[string]string{
|
||||||
|
"tool_path": outHostBinDir + ":" + prebuiltSdkToolsBinDir,
|
||||||
|
"image_dir": imageDir.String(),
|
||||||
|
"copy_commands": strings.Join(copyCommands, " && "),
|
||||||
|
"manifest": a.manifestPbOut.String(),
|
||||||
|
"file_contexts": fileContexts.String(),
|
||||||
|
"canned_fs_config": cannedFsConfig.String(),
|
||||||
|
"key": a.privateKeyFile.String(),
|
||||||
|
"opt_flags": strings.Join(optFlags, " "),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(jiyong): make the two rules below as separate functions
|
// TODO(jiyong): make the two rules below as separate functions
|
||||||
apexProtoFile := android.PathForModuleOut(ctx, a.Name()+".pb"+suffix)
|
apexProtoFile := android.PathForModuleOut(ctx, a.Name()+".pb"+suffix)
|
||||||
|
Reference in New Issue
Block a user