Merge changes I545a832a,I85a51b04
* changes:
Remove empty DepsMutator methods
Replace *[]string with []string in product variables
diff --git a/android/prebuilt_etc.go b/android/prebuilt_etc.go
index 42c7c2c..e180342 100644
--- a/android/prebuilt_etc.go
+++ b/android/prebuilt_etc.go
@@ -145,6 +145,9 @@
fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
fmt.Fprintln(w, "LOCAL_MODULE :=", name+nameSuffix)
fmt.Fprintln(w, "LOCAL_MODULE_CLASS := ETC")
+ if p.commonProperties.Owner != nil {
+ fmt.Fprintln(w, "LOCAL_MODULE_OWNER :=", *p.commonProperties.Owner)
+ }
fmt.Fprintln(w, "LOCAL_MODULE_TAGS := optional")
fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", p.outputFilePath.String())
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", "$(OUT_DIR)/"+p.installDirPath.RelPathString())
diff --git a/android/prebuilt_etc_test.go b/android/prebuilt_etc_test.go
index 8ab978b..d1a80af 100644
--- a/android/prebuilt_etc_test.go
+++ b/android/prebuilt_etc_test.go
@@ -15,8 +15,11 @@
package android
import (
+ "bufio"
+ "bytes"
"io/ioutil"
"os"
+ "strings"
"testing"
)
@@ -130,3 +133,47 @@
t.Errorf("expected bar.conf, got %q", p.outputFilePath.Base())
}
}
+
+func TestPrebuiltEtcAndroidMk(t *testing.T) {
+ ctx := testPrebuiltEtc(t, `
+ prebuilt_etc {
+ name: "foo",
+ src: "foo.conf",
+ owner: "abc",
+ filename_from_src: true,
+ }
+ `)
+
+ data := AndroidMkData{}
+ data.Required = append(data.Required, "modA", "moduleB")
+
+ expected := map[string]string{
+ "LOCAL_MODULE": "foo",
+ "LOCAL_MODULE_CLASS": "ETC",
+ "LOCAL_MODULE_OWNER": "abc",
+ "LOCAL_INSTALLED_MODULE_STEM": "foo.conf",
+ "LOCAL_REQUIRED_MODULES": "modA moduleB",
+ }
+
+ mod := ctx.ModuleForTests("foo", "android_arm64_armv8-a_core").Module().(*PrebuiltEtc)
+ buf := &bytes.Buffer{}
+ mod.AndroidMk().Custom(buf, "foo", "", "", data)
+ for k, expected := range expected {
+ found := false
+ scanner := bufio.NewScanner(bytes.NewReader(buf.Bytes()))
+ for scanner.Scan() {
+ line := scanner.Text()
+ tok := strings.Split(line, " := ")
+ if tok[0] == k {
+ found = true
+ if tok[1] != expected {
+ t.Errorf("Incorrect %s '%s', expected '%s'", k, tok[1], expected)
+ }
+ }
+ }
+
+ if !found {
+ t.Errorf("No %s defined, saw %s", k, buf.String())
+ }
+ }
+}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index b9787f0..c13b855 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -35,7 +35,7 @@
asanLdflags = []string{"-Wl,-u,__asan_preinit"}
asanLibs = []string{"libasan"}
- hwasanCflags = []string{"-mllvm", "-hwasan-with-ifunc=0", "-fno-omit-frame-pointer", "-Wno-frame-larger-than=", "-mllvm", "-hwasan-create-frame-descriptions=0"}
+ hwasanCflags = []string{"-fno-omit-frame-pointer", "-Wno-frame-larger-than=", "-mllvm", "-hwasan-create-frame-descriptions=0"}
cfiCflags = []string{"-flto", "-fsanitize-cfi-cross-dso",
"-fsanitize-blacklist=external/compiler-rt/lib/cfi/cfi_blacklist.txt"}
@@ -444,7 +444,11 @@
flags.LdFlags = append(flags.LdFlags, "-Wl,--no-as-needed")
} else {
flags.CFlags = append(flags.CFlags, "-mllvm", "-asan-globals=0")
- flags.DynamicLinker = "/system/bin/linker_asan"
+ if ctx.bootstrap() {
+ flags.DynamicLinker = "/system/bin/bootstrap/linker_asan"
+ } else {
+ flags.DynamicLinker = "/system/bin/linker_asan"
+ }
if flags.Toolchain.Is64Bit() {
flags.DynamicLinker += "64"
}