summaryrefslogtreecommitdiff
path: root/android/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'android/config.go')
-rw-r--r--android/config.go62
1 files changed, 44 insertions, 18 deletions
diff --git a/android/config.go b/android/config.go
index a5edf0da8..d47f0d44a 100644
--- a/android/config.go
+++ b/android/config.go
@@ -200,6 +200,11 @@ func (c Config) ReleaseAconfigValueSets() []string {
return c.config.productVariables.ReleaseAconfigValueSets
}
+// If native modules should have symbols stripped by default. Default false, enabled for build tools
+func (c Config) StripByDefault() bool {
+ return proptools.Bool(c.config.productVariables.StripByDefault)
+}
+
func (c Config) ReleaseAconfigExtraReleaseConfigs() []string {
result := []string{}
if val, ok := c.config.productVariables.BuildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"]; ok {
@@ -233,11 +238,6 @@ func (c Config) ReleaseAconfigFlagDefaultPermission() string {
return c.config.productVariables.ReleaseAconfigFlagDefaultPermission
}
-// Enable object size sanitizer
-func (c Config) ReleaseBuildObjectSizeSanitizer() bool {
- return c.config.productVariables.GetBuildFlagBool("RELEASE_BUILD_OBJECT_SIZE_SANITIZER")
-}
-
// The flag indicating behavior for the tree wrt building modules or using prebuilts
// derived from RELEASE_DEFAULT_MODULE_BUILD_FROM_SOURCE
func (c Config) ReleaseDefaultModuleBuildFromSource() bool {
@@ -385,24 +385,28 @@ type config struct {
}
type partialCompileFlags struct {
- // Is partial compilation enabled at all?
- Enabled bool
-
// Whether to use d8 instead of r8
Use_d8 bool
+ // Whether to disable stub validation. This is slightly more surgical
+ // than DISABLE_STUB_VALIDATION, in that it only applies to partial
+ // compile builds.
+ Disable_stub_validation bool
+
+ // Whether to disable api lint.
+ Disable_api_lint bool
+
// Add others as needed.
}
// These are the flags when `SOONG_PARTIAL_COMPILE` is empty or not set.
-var defaultPartialCompileFlags = partialCompileFlags{
- Enabled: false,
-}
+var defaultPartialCompileFlags = partialCompileFlags{}
// These are the flags when `SOONG_PARTIAL_COMPILE=true`.
var enabledPartialCompileFlags = partialCompileFlags{
- Enabled: true,
- Use_d8: true,
+ Use_d8: true,
+ Disable_stub_validation: false,
+ Disable_api_lint: false,
}
type deviceConfig struct {
@@ -477,13 +481,29 @@ func (c *config) parsePartialCompileFlags(isEngBuild bool) (partialCompileFlags,
state = "+"
}
switch tok {
+ case "all":
+ // Turn on **all** of the flags.
+ ret = partialCompileFlags{
+ Use_d8: true,
+ Disable_stub_validation: true,
+ Disable_api_lint: true,
+ }
case "true":
ret = enabledPartialCompileFlags
case "false":
// Set everything to false.
ret = partialCompileFlags{}
- case "enabled":
- ret.Enabled = makeVal(state, defaultPartialCompileFlags.Enabled)
+
+ case "api_lint", "enable_api_lint":
+ ret.Disable_api_lint = !makeVal(state, !defaultPartialCompileFlags.Disable_api_lint)
+ case "disable_api_lint":
+ ret.Disable_api_lint = makeVal(state, defaultPartialCompileFlags.Disable_api_lint)
+
+ case "stub_validation", "enable_stub_validation":
+ ret.Disable_stub_validation = !makeVal(state, !defaultPartialCompileFlags.Disable_stub_validation)
+ case "disable_stub_validation":
+ ret.Disable_stub_validation = makeVal(state, defaultPartialCompileFlags.Disable_stub_validation)
+
case "use_d8":
ret.Use_d8 = makeVal(state, defaultPartialCompileFlags.Use_d8)
default:
@@ -814,11 +834,18 @@ func (c *config) HostCcSharedLibPath(ctx PathContext, lib string) Path {
func (c *config) PrebuiltOS() string {
switch runtime.GOOS {
case "linux":
- return "linux-x86"
+ switch runtime.GOARCH {
+ case "amd64":
+ return "linux-x86"
+ case "arm64":
+ return "linux-arm64"
+ default:
+ panic(fmt.Errorf("Unknown GOARCH %s", runtime.GOARCH))
+ }
case "darwin":
return "darwin-x86"
default:
- panic("Unknown GOOS")
+ panic(fmt.Errorf("Unknown GOOS %s", runtime.GOOS))
}
}
@@ -2222,7 +2249,6 @@ var (
"RELEASE_APEX_CONTRIBUTIONS_NFC": "com.android.nfcservices",
"RELEASE_APEX_CONTRIBUTIONS_ONDEVICEPERSONALIZATION": "com.android.ondevicepersonalization",
"RELEASE_APEX_CONTRIBUTIONS_PERMISSION": "com.android.permission",
- "RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS": "",
"RELEASE_APEX_CONTRIBUTIONS_PROFILING": "com.android.profiling",
"RELEASE_APEX_CONTRIBUTIONS_REMOTEKEYPROVISIONING": "com.android.rkpd",
"RELEASE_APEX_CONTRIBUTIONS_RESOLV": "com.android.resolv",