From f7df9b7e551f938055f5e1e6d18188aac773a86f Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 26 Dec 2018 21:34:03 +0900 Subject: [PATCH] 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 --- cc/androidmk.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cc/androidmk.go b/cc/androidmk.go index 1f5a8adfc..82feec833 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -59,7 +59,7 @@ func (c *Module) AndroidMk() android.AndroidMkData { ret := android.AndroidMkData{ OutputFile: c.outputFile, - Required: c.Properties.AndroidMkRuntimeLibs, + Required: append(c.Properties.AndroidMkRuntimeLibs, c.Properties.ApexesProvidingSharedLibs...), Include: "$(BUILD_SYSTEM)/soong_cc_prebuilt.mk", Extra: []android.AndroidMkExtraFunc{ @@ -76,9 +76,6 @@ func (c *Module) AndroidMk() android.AndroidMkData { if len(c.Properties.AndroidMkWholeStaticLibs) > 0 { 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()) if c.useVndk() { fmt.Fprintln(w, "LOCAL_USE_VNDK := true")