diff options
-rw-r--r-- | android/module.go | 4 | ||||
-rw-r--r-- | cc/binary.go | 2 | ||||
-rw-r--r-- | cc/cc.go | 4 | ||||
-rw-r--r-- | cc/ndk_library.go | 1 | ||||
-rw-r--r-- | cc/stl.go | 7 | ||||
-rw-r--r-- | java/dex.go | 1 | ||||
-rw-r--r-- | java/sdk_library.go | 19 |
7 files changed, 27 insertions, 11 deletions
diff --git a/android/module.go b/android/module.go index 4d9ddd4b1..ae1227449 100644 --- a/android/module.go +++ b/android/module.go @@ -602,6 +602,10 @@ func (p *ModuleBase) InstallInRecovery() bool { return Bool(p.commonProperties.Recovery) } +func (a *ModuleBase) Owner() string { + return String(a.commonProperties.Owner) +} + func (a *ModuleBase) generateModuleTarget(ctx ModuleContext) { allInstalledFiles := Paths{} allCheckbuildFiles := Paths{} diff --git a/cc/binary.go b/cc/binary.go index 6352ba151..07d503b1b 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -208,7 +208,7 @@ func (binary *binaryDecorator) staticBinary() bool { func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags { flags = binary.baseLinker.linkerFlags(ctx, flags) - if ctx.Host() && !binary.static() { + if ctx.Host() && !ctx.Windows() && !binary.static() { if !ctx.Config().IsEnvTrue("DISABLE_HOST_PIE") { flags.LdFlags = append(flags.LdFlags, "-pie") } @@ -366,6 +366,10 @@ type Module struct { staticVariant *Module } +func (c *Module) OutputFile() android.OptionalPath { + return c.outputFile +} + func (c *Module) Init() android.Module { c.AddProperties(&c.Properties, &c.VendorProperties) if c.compiler != nil { diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 3bffacd42..2709a89b6 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -39,6 +39,7 @@ var ( ndkPrebuiltSharedLibs = []string{ "android", + "binder_ndk", "c", "dl", "EGL", @@ -213,10 +213,9 @@ func init() { hostDynamicGccLibs = map[android.OsType][]string{ android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"}, android.Darwin: []string{"-lc", "-lSystem"}, - android.Windows: []string{"-lmsvcr110", "-lmingw32", "-lgcc", "-lmoldname", - "-lmingwex", "-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32", - "-lkernel32", "-lmingw32", "-lgcc", "-lmoldname", "-lmingwex", - "-lmsvcrt"}, + android.Windows: []string{"-lmingw32", "-lgcc", "-lmoldname", "-lmingwex", "-lmsvcr110", + "-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32", "-lkernel32", "-lmingw32", + "-lgcc", "-lmoldname", "-lmingwex", "-lmsvcrt"}, } hostStaticGccLibs = map[android.OsType][]string{ android.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"}, diff --git a/java/dex.go b/java/dex.go index 054a1766b..644594037 100644 --- a/java/dex.go +++ b/java/dex.go @@ -42,6 +42,7 @@ var r8 = pctx.AndroidStaticRule("r8", `rm -f "$outDict" && ` + `${config.R8Cmd} -injars $in --output $outDir ` + `--force-proguard-compatibility ` + + `--no-data-resources ` + `-printmapping $outDict ` + `$dxFlags $r8Flags && ` + `touch "$outDict" && ` + diff --git a/java/sdk_library.go b/java/sdk_library.go index d58880178..3e6908bde 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -217,38 +217,45 @@ func (module *sdkLibrary) AndroidMk() android.AndroidMkData { fmt.Fprintln(w, "LOCAL_MODULE :=", name) fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+module.implName()) fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)") + owner := module.ModuleBase.Owner() + if owner == "" { + owner = "android" + } // Create dist rules to install the stubs libs to the dist dir if len(module.publicApiStubsPath) == 1 { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.publicApiStubsPath.Strings()[0]+ - ":"+path.Join("apistubs", "public", module.BaseModuleName()+".jar")+")") + ":"+path.Join("apistubs", owner, "public", + module.BaseModuleName()+".jar")+")") } if len(module.systemApiStubsPath) == 1 { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.systemApiStubsPath.Strings()[0]+ - ":"+path.Join("apistubs", "system", module.BaseModuleName()+".jar")+")") + ":"+path.Join("apistubs", owner, "system", + module.BaseModuleName()+".jar")+")") } if len(module.testApiStubsPath) == 1 { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.testApiStubsPath.Strings()[0]+ - ":"+path.Join("apistubs", "test", module.BaseModuleName()+".jar")+")") + ":"+path.Join("apistubs", owner, "test", + module.BaseModuleName()+".jar")+")") } if module.publicApiFilePath != nil { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.publicApiFilePath.String()+ - ":"+path.Join("apistubs", "public", "api", + ":"+path.Join("apistubs", owner, "public", "api", module.BaseModuleName()+".txt")+")") } if module.systemApiFilePath != nil { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.systemApiFilePath.String()+ - ":"+path.Join("apistubs", "system", "api", + ":"+path.Join("apistubs", owner, "system", "api", module.BaseModuleName()+".txt")+")") } if module.testApiFilePath != nil { fmt.Fprintln(w, "$(call dist-for-goals,sdk win_sdk,"+ module.testApiFilePath.String()+ - ":"+path.Join("apistubs", "test", "api", + ":"+path.Join("apistubs", owner, "test", "api", module.BaseModuleName()+".txt")+")") } }, |