Merge "Add libnativehelper to root Android.bp"
diff --git a/android/arch.go b/android/arch.go
index 13fcb29..d6b2836 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -26,7 +26,7 @@
func init() {
RegisterBottomUpMutator("defaults_deps", defaultsDepsMutator)
- RegisterTopDownMutator("defaults", defaultsMutator)
+ RegisterBottomUpMutator("defaults", defaultsMutator)
RegisterBottomUpMutator("arch", ArchMutator)
}
diff --git a/android/defaults.go b/android/defaults.go
index f9cf0cc..2c589b9 100644
--- a/android/defaults.go
+++ b/android/defaults.go
@@ -45,7 +45,7 @@
type Defaultable interface {
defaults() *defaultsProperties
setProperties([]interface{})
- applyDefaults(TopDownMutatorContext, Defaults)
+ applyDefaults(BottomUpMutatorContext, Defaults)
}
var _ Defaultable = (*DefaultableModule)(nil)
@@ -61,12 +61,13 @@
}
type DefaultsModule struct {
+ DefaultableModule
defaultProperties []interface{}
}
type Defaults interface {
+ Defaultable
isDefaults() bool
- setProperties([]interface{})
properties() []interface{}
}
@@ -75,22 +76,16 @@
}
func (d *DefaultsModule) properties() []interface{} {
- return d.defaultProperties
-}
-
-func (d *DefaultsModule) setProperties(props []interface{}) {
- d.defaultProperties = props
+ return d.defaultableProperties
}
func InitDefaultsModule(module Module, d Defaults, props ...interface{}) (blueprint.Module, []interface{}) {
- d.setProperties(props)
-
- return module, props
+ return InitDefaultableModule(module, d, props...)
}
var _ Defaults = (*DefaultsModule)(nil)
-func (defaultable *DefaultableModule) applyDefaults(ctx TopDownMutatorContext,
+func (defaultable *DefaultableModule) applyDefaults(ctx BottomUpMutatorContext,
defaults Defaults) {
for _, prop := range defaultable.defaultableProperties {
@@ -115,7 +110,7 @@
}
}
-func defaultsMutator(ctx TopDownMutatorContext) {
+func defaultsMutator(ctx BottomUpMutatorContext) {
if defaultable, ok := ctx.Module().(Defaultable); ok {
for _, defaultsDep := range defaultable.defaults().Defaults {
ctx.VisitDirectDeps(func(m blueprint.Module) {
diff --git a/android/variable.go b/android/variable.go
index b0639ae..d2dc5b9 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -58,6 +58,10 @@
Schedboost struct {
Cflags []string
}
+
+ Binder32bit struct {
+ Cflags []string
+ }
} `android:"arch_variant"`
}
@@ -96,6 +100,7 @@
HostStaticBinaries *bool `json:",omitempty"`
Cpusets *bool `json:",omitempty"`
Schedboost *bool `json:",omitempty"`
+ Binder32bit *bool `json:",omitempty"`
SanitizeHost *[]string `json:",omitempty"`
SanitizeDevice *[]string `json:",omitempty"`
diff --git a/cc/arm64_device.go b/cc/arm64_device.go
index 583da44..1dc0ecd 100644
--- a/cc/arm64_device.go
+++ b/cc/arm64_device.go
@@ -94,8 +94,6 @@
pctx.SourcePathVariable("arm64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/aarch64/aarch64-linux-android-${arm64GccVersion}")
- pctx.StaticVariable("arm64GccTriple", "aarch64-linux-android")
-
pctx.StaticVariable("arm64Cflags", strings.Join(arm64Cflags, " "))
pctx.StaticVariable("arm64Ldflags", strings.Join(arm64Ldflags, " "))
pctx.StaticVariable("arm64Cppflags", strings.Join(arm64Cppflags, " "))
@@ -139,7 +137,7 @@
}
func (t *toolchainArm64) GccTriple() string {
- return "${arm64GccTriple}"
+ return "aarch64-linux-android"
}
func (t *toolchainArm64) GccVersion() string {
@@ -167,7 +165,7 @@
}
func (t *toolchainArm64) ClangTriple() string {
- return "${arm64GccTriple}"
+ return t.GccTriple()
}
func (t *toolchainArm64) ClangCflags() string {
diff --git a/cc/arm_device.go b/cc/arm_device.go
index ddda33c..a6c1911 100644
--- a/cc/arm_device.go
+++ b/cc/arm_device.go
@@ -161,8 +161,6 @@
pctx.SourcePathVariable("armGccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/arm/arm-linux-androideabi-${armGccVersion}")
- pctx.StaticVariable("armGccTriple", "arm-linux-androideabi")
-
pctx.StaticVariable("armToolchainCflags", strings.Join(armToolchainCflags, " "))
pctx.StaticVariable("armCflags", strings.Join(armCflags, " "))
pctx.StaticVariable("armLdflags", strings.Join(armLdflags, " "))
@@ -269,7 +267,7 @@
}
func (t *toolchainArm) GccTriple() string {
- return "${armGccTriple}"
+ return "arm-linux-androideabi"
}
func (t *toolchainArm) GccVersion() string {
@@ -308,7 +306,7 @@
}
func (t *toolchainArm) ClangTriple() string {
- return "${armGccTriple}"
+ return t.GccTriple()
}
func (t *toolchainArm) ToolchainClangCflags() string {
diff --git a/cc/builder.go b/cc/builder.go
index 0787847..5988140 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -50,14 +50,14 @@
ld = pctx.StaticRule("ld",
blueprint.RuleParams{
- Command: "$ldCmd ${ldDirFlags} ${crtBegin} @${out}.rsp " +
+ Command: "$ldCmd ${crtBegin} @${out}.rsp " +
"${libFlags} ${crtEnd} -o ${out} ${ldFlags}",
CommandDeps: []string{"$ldCmd"},
Description: "ld $out",
Rspfile: "${out}.rsp",
RspfileContent: "${in}",
},
- "ldCmd", "ldDirFlags", "crtBegin", "libFlags", "crtEnd", "ldFlags")
+ "ldCmd", "crtBegin", "libFlags", "crtEnd", "ldFlags")
partialLd = pctx.StaticRule("partialLd",
blueprint.RuleParams{
@@ -350,7 +350,6 @@
ldCmd = gccCmd(flags.toolchain, "g++")
}
- var ldDirs []string
var libFlagsList []string
if len(flags.libFlags) > 0 {
@@ -378,7 +377,7 @@
}
for _, lib := range sharedLibs {
- dir, file := filepath.Split(lib.String())
+ file := filepath.Base(lib.String())
if !strings.HasPrefix(file, "lib") {
panic("shared library " + lib.String() + " does not start with lib")
}
@@ -386,7 +385,6 @@
panic("shared library " + lib.String() + " does not end with " + flags.toolchain.ShlibSuffix())
}
libFlagsList = append(libFlagsList, lib.String())
- ldDirs = append(ldDirs, dir)
}
deps = append(deps, sharedLibs...)
@@ -403,12 +401,11 @@
Inputs: objFiles,
Implicits: deps,
Args: map[string]string{
- "ldCmd": ldCmd,
- "ldDirFlags": ldDirsToFlags(ldDirs),
- "crtBegin": crtBegin.String(),
- "libFlags": strings.Join(libFlagsList, " "),
- "ldFlags": flags.ldFlags,
- "crtEnd": crtEnd.String(),
+ "ldCmd": ldCmd,
+ "crtBegin": crtBegin.String(),
+ "libFlags": strings.Join(libFlagsList, " "),
+ "ldFlags": flags.ldFlags,
+ "crtEnd": crtEnd.String(),
},
})
}
diff --git a/cc/cc.go b/cc/cc.go
index 51760fc..30228fb 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2691,6 +2691,7 @@
// Optimize out compiling common .o files twice for static+shared libraries
mctx.AddInterVariantDependency(reuseObjTag, shared, static)
sharedCompiler.baseCompiler.Properties.Srcs = nil
+ sharedCompiler.baseCompiler.Properties.Generated_sources = nil
}
}
} else if linker.buildStatic() {
diff --git a/cc/mips64_device.go b/cc/mips64_device.go
index a1ec3a2..51b605c 100644
--- a/cc/mips64_device.go
+++ b/cc/mips64_device.go
@@ -95,15 +95,12 @@
pctx.SourcePathVariable("mips64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mips64GccVersion}")
- pctx.StaticVariable("mips64GccTriple", "mips64el-linux-android")
-
pctx.StaticVariable("mips64Cflags", strings.Join(mips64Cflags, " "))
pctx.StaticVariable("mips64Ldflags", strings.Join(mips64Ldflags, " "))
pctx.StaticVariable("mips64Cppflags", strings.Join(mips64Cppflags, " "))
pctx.StaticVariable("mips64IncludeFlags", bionicHeaders("mips64", "mips"))
// Clang cflags
- pctx.StaticVariable("mips64ClangTriple", "mips64el-linux-android")
pctx.StaticVariable("mips64ClangCflags", strings.Join(clangFilterUnknownCflags(mips64Cflags), " "))
pctx.StaticVariable("mips64ClangLdflags", strings.Join(clangFilterUnknownCflags(mips64Ldflags), " "))
pctx.StaticVariable("mips64ClangCppflags", strings.Join(clangFilterUnknownCflags(mips64Cppflags), " "))
@@ -133,7 +130,7 @@
}
func (t *toolchainMips64) GccTriple() string {
- return "${mips64GccTriple}"
+ return "mips64el-linux-android"
}
func (t *toolchainMips64) GccVersion() string {
@@ -161,7 +158,7 @@
}
func (t *toolchainMips64) ClangTriple() string {
- return "${mips64ClangTriple}"
+ return t.GccTriple()
}
func (t *toolchainMips64) ToolchainClangCflags() string {
diff --git a/cc/mips_device.go b/cc/mips_device.go
index 0b23d37..583a153 100644
--- a/cc/mips_device.go
+++ b/cc/mips_device.go
@@ -131,8 +131,6 @@
pctx.SourcePathVariable("mipsGccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mipsGccVersion}")
- pctx.StaticVariable("mipsGccTriple", "mips64el-linux-android")
-
pctx.StaticVariable("mipsToolchainLdflags", strings.Join(mipsToolchainLdflags, " "))
pctx.StaticVariable("mipsCflags", strings.Join(mipsCflags, " "))
pctx.StaticVariable("mipsLdflags", strings.Join(mipsLdflags, " "))
@@ -140,7 +138,6 @@
pctx.StaticVariable("mipsIncludeFlags", bionicHeaders("mips", "mips"))
// Clang cflags
- pctx.StaticVariable("mipsClangTriple", "mipsel-linux-android")
pctx.StaticVariable("mipsClangCflags", strings.Join(clangFilterUnknownCflags(mipsClangCflags), " "))
pctx.StaticVariable("mipsClangLdflags", strings.Join(clangFilterUnknownCflags(mipsLdflags), " "))
pctx.StaticVariable("mipsClangCppflags", strings.Join(clangFilterUnknownCflags(mipsCppflags), " "))
@@ -170,7 +167,7 @@
}
func (t *toolchainMips) GccTriple() string {
- return "${mipsGccTriple}"
+ return "mips64el-linux-android"
}
func (t *toolchainMips) GccVersion() string {
@@ -202,7 +199,7 @@
}
func (t *toolchainMips) ClangTriple() string {
- return "${mipsClangTriple}"
+ return "mipsel-linux-android"
}
func (t *toolchainMips) ToolchainClangLdflags() string {
diff --git a/cc/toolchain.go b/cc/toolchain.go
index 89485f8..0cb7c9c 100644
--- a/cc/toolchain.go
+++ b/cc/toolchain.go
@@ -146,8 +146,7 @@
"-isystem bionic/libc/arch-" + bionicArch + "/include",
"-isystem bionic/libc/include",
"-isystem bionic/libc/kernel/uapi",
- "-isystem bionic/libc/kernel/android/uapi",
- "-isystem bionic/libc/kernel/common",
"-isystem bionic/libc/kernel/uapi/asm-" + kernelArch,
+ "-isystem bionic/libc/kernel/android/uapi",
}, " ")
}
diff --git a/cc/x86_64_device.go b/cc/x86_64_device.go
index 6923f5f..2747cf0 100644
--- a/cc/x86_64_device.go
+++ b/cc/x86_64_device.go
@@ -140,8 +140,6 @@
pctx.SourcePathVariable("x86_64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/x86/x86_64-linux-android-${x86_64GccVersion}")
- pctx.StaticVariable("x86_64GccTriple", "x86_64-linux-android")
-
pctx.StaticVariable("x86_64ToolchainCflags", "-m64")
pctx.StaticVariable("x86_64ToolchainLdflags", "-m64")
@@ -179,7 +177,7 @@
}
func (t *toolchainX86_64) GccTriple() string {
- return "${x86_64GccTriple}"
+ return "x86_64-linux-android"
}
func (t *toolchainX86_64) GccVersion() string {
@@ -211,7 +209,7 @@
}
func (t *toolchainX86_64) ClangTriple() string {
- return "${x86_64GccTriple}"
+ return t.GccTriple()
}
func (t *toolchainX86_64) ToolchainClangLdflags() string {
diff --git a/cc/x86_device.go b/cc/x86_device.go
index ba2f23a..550aca0 100644
--- a/cc/x86_device.go
+++ b/cc/x86_device.go
@@ -159,8 +159,6 @@
pctx.SourcePathVariable("x86GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/x86/x86_64-linux-android-${x86GccVersion}")
- pctx.StaticVariable("x86GccTriple", "x86_64-linux-android")
-
pctx.StaticVariable("x86ToolchainCflags", "-m32")
pctx.StaticVariable("x86ToolchainLdflags", "-m32")
@@ -198,7 +196,7 @@
}
func (t *toolchainX86) GccTriple() string {
- return "${x86GccTriple}"
+ return "x86_64-linux-android"
}
func (t *toolchainX86) GccVersion() string {