Fix: 'required' property is ignored

This change fixes a bug that the 'required' property of a module is
ignored when the module is using a shared from an APEX. This is
happening because LOCAL_REQUIRED_MODULES is overwritten (with := instead
of +=) when ApexesProvidingSharedLibs is not empty.

Fixing the bug by appending ApexesProvidingSharedLibs to
AndroidMkData.Reuired so that it is handled in android/androidmk.go

Test: m
Test: build with https://android-review.googlesource.com/c/platform/bionic/+/849044
and make sure that system/bin/vold_prepare_subdirs exist.

Change-Id: Ie57bca480ba4198b4da0df1c73e92fa42b5ebda8
This commit is contained in:
Jiyong Park
2018-12-26 21:34:03 +09:00
parent 189ff9868e
commit f7df9b7e55

View File

@@ -59,7 +59,7 @@ func (c *Module) AndroidMk() android.AndroidMkData {
ret := android.AndroidMkData{ ret := android.AndroidMkData{
OutputFile: c.outputFile, OutputFile: c.outputFile,
Required: c.Properties.AndroidMkRuntimeLibs, Required: append(c.Properties.AndroidMkRuntimeLibs, c.Properties.ApexesProvidingSharedLibs...),
Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk", Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk",
Extra: []android.AndroidMkExtraFunc{ Extra: []android.AndroidMkExtraFunc{
@@ -76,9 +76,6 @@ func (c *Module) AndroidMk() android.AndroidMkData {
if len(c.Properties.AndroidMkWholeStaticLibs) > 0 { if len(c.Properties.AndroidMkWholeStaticLibs) > 0 {
fmt.Fprintln(w, "LOCAL_WHOLE_STATIC_LIBRARIES := "+strings.Join(c.Properties.AndroidMkWholeStaticLibs, " ")) fmt.Fprintln(w, "LOCAL_WHOLE_STATIC_LIBRARIES := "+strings.Join(c.Properties.AndroidMkWholeStaticLibs, " "))
} }
if len(c.Properties.ApexesProvidingSharedLibs) > 0 {
fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(c.Properties.ApexesProvidingSharedLibs, " "))
}
fmt.Fprintln(w, "LOCAL_SOONG_LINK_TYPE :=", c.getMakeLinkType()) fmt.Fprintln(w, "LOCAL_SOONG_LINK_TYPE :=", c.getMakeLinkType())
if c.useVndk() { if c.useVndk() {
fmt.Fprintln(w, "LOCAL_USE_VNDK := true") fmt.Fprintln(w, "LOCAL_USE_VNDK := true")