Merge "Sandbox bluetooth genrules" into main
diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go
index 9f093bb..00a395f 100644
--- a/cc/config/x86_64_device.go
+++ b/cc/config/x86_64_device.go
@@ -33,6 +33,8 @@
"-Wl,--hash-style=gnu",
}
+ X86_64Lldflags = x86_64Ldflags
+
x86_64ArchVariantCflags = map[string][]string{
"": []string{
"-march=x86-64",
@@ -94,10 +96,23 @@
exportedVars.ExportStringListStaticVariable("X86_64ToolchainLdflags", []string{"-m64"})
exportedVars.ExportStringListStaticVariable("X86_64Ldflags", x86_64Ldflags)
- exportedVars.ExportStringListStaticVariable("X86_64Lldflags", x86_64Ldflags)
+ exportedVars.ExportStringList("X86_64Lldflags", X86_64Lldflags)
+ pctx.VariableFunc("X86_64Lldflags", func(ctx android.PackageVarContext) string {
+ maxPageSizeFlag := "-Wl,-z,max-page-size=" + ctx.Config().MaxPageSizeSupported()
+ flags := append(X86_64Lldflags, maxPageSizeFlag)
+ return strings.Join(flags, " ")
+ })
// Clang cflags
- exportedVars.ExportStringListStaticVariable("X86_64Cflags", x86_64Cflags)
+ exportedVars.ExportStringList("X86_64Cflags", x86_64Cflags)
+ pctx.VariableFunc("X86_64Cflags", func(ctx android.PackageVarContext) string {
+ flags := x86_64Cflags
+ if ctx.Config().PageSizeAgnostic() {
+ flags = append(flags, "-D__BIONIC_NO_PAGE_SIZE_MACRO")
+ }
+ return strings.Join(flags, " ")
+ })
+
exportedVars.ExportStringListStaticVariable("X86_64Cppflags", x86_64Cppflags)
// Yasm flags
diff --git a/dexpreopt/config.go b/dexpreopt/config.go
index ba41f4a..c871e85 100644
--- a/dexpreopt/config.go
+++ b/dexpreopt/config.go
@@ -32,7 +32,7 @@
DisablePreoptBootImages bool // disable prepot for boot images
DisablePreoptModules []string // modules with preopt disabled by product-specific config
- OnlyPreoptBootImageAndSystemServer bool // only preopt jars in the boot image or system server
+ OnlyPreoptArtBootImage bool // only preopt jars in the ART boot image
PreoptWithUpdatableBcp bool // If updatable boot jars are included in dexpreopt or not.
@@ -691,45 +691,45 @@
func GlobalConfigForTests(ctx android.PathContext) *GlobalConfig {
return &GlobalConfig{
- DisablePreopt: false,
- DisablePreoptModules: nil,
- OnlyPreoptBootImageAndSystemServer: false,
- HasSystemOther: false,
- PatternsOnSystemOther: nil,
- DisableGenerateProfile: false,
- ProfileDir: "",
- BootJars: android.EmptyConfiguredJarList(),
- ApexBootJars: android.EmptyConfiguredJarList(),
- ArtApexJars: android.EmptyConfiguredJarList(),
- TestOnlyArtBootImageJars: android.EmptyConfiguredJarList(),
- SystemServerJars: android.EmptyConfiguredJarList(),
- SystemServerApps: nil,
- ApexSystemServerJars: android.EmptyConfiguredJarList(),
- StandaloneSystemServerJars: android.EmptyConfiguredJarList(),
- ApexStandaloneSystemServerJars: android.EmptyConfiguredJarList(),
- SpeedApps: nil,
- PreoptFlags: nil,
- DefaultCompilerFilter: "",
- SystemServerCompilerFilter: "",
- GenerateDMFiles: false,
- NoDebugInfo: false,
- DontResolveStartupStrings: false,
- AlwaysSystemServerDebugInfo: false,
- NeverSystemServerDebugInfo: false,
- AlwaysOtherDebugInfo: false,
- NeverOtherDebugInfo: false,
- IsEng: false,
- SanitizeLite: false,
- DefaultAppImages: false,
- Dex2oatXmx: "",
- Dex2oatXms: "",
- EmptyDirectory: "empty_dir",
- CpuVariant: nil,
- InstructionSetFeatures: nil,
- BootImageProfiles: nil,
- BootFlags: "",
- Dex2oatImageXmx: "",
- Dex2oatImageXms: "",
+ DisablePreopt: false,
+ DisablePreoptModules: nil,
+ OnlyPreoptArtBootImage: false,
+ HasSystemOther: false,
+ PatternsOnSystemOther: nil,
+ DisableGenerateProfile: false,
+ ProfileDir: "",
+ BootJars: android.EmptyConfiguredJarList(),
+ ApexBootJars: android.EmptyConfiguredJarList(),
+ ArtApexJars: android.EmptyConfiguredJarList(),
+ TestOnlyArtBootImageJars: android.EmptyConfiguredJarList(),
+ SystemServerJars: android.EmptyConfiguredJarList(),
+ SystemServerApps: nil,
+ ApexSystemServerJars: android.EmptyConfiguredJarList(),
+ StandaloneSystemServerJars: android.EmptyConfiguredJarList(),
+ ApexStandaloneSystemServerJars: android.EmptyConfiguredJarList(),
+ SpeedApps: nil,
+ PreoptFlags: nil,
+ DefaultCompilerFilter: "",
+ SystemServerCompilerFilter: "",
+ GenerateDMFiles: false,
+ NoDebugInfo: false,
+ DontResolveStartupStrings: false,
+ AlwaysSystemServerDebugInfo: false,
+ NeverSystemServerDebugInfo: false,
+ AlwaysOtherDebugInfo: false,
+ NeverOtherDebugInfo: false,
+ IsEng: false,
+ SanitizeLite: false,
+ DefaultAppImages: false,
+ Dex2oatXmx: "",
+ Dex2oatXms: "",
+ EmptyDirectory: "empty_dir",
+ CpuVariant: nil,
+ InstructionSetFeatures: nil,
+ BootImageProfiles: nil,
+ BootFlags: "",
+ Dex2oatImageXmx: "",
+ Dex2oatImageXms: "",
}
}
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index 29ae188..c13e14a 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -124,12 +124,7 @@
return true
}
- // If OnlyPreoptBootImageAndSystemServer=true and module is not in boot class path skip
- // Also preopt system server jars since selinux prevents system server from loading anything from
- // /data. If we don't do this they will need to be extracted which is not favorable for RAM usage
- // or performance. If PreoptExtractedApk is true, we ignore the only preopt boot image options.
- if global.OnlyPreoptBootImageAndSystemServer && !global.BootJars.ContainsJar(module.Name) &&
- !global.AllSystemServerJars(ctx).ContainsJar(module.Name) && !module.PreoptExtractedApk {
+ if global.OnlyPreoptArtBootImage && !module.PreoptExtractedApk {
return true
}
diff --git a/java/app.go b/java/app.go
index 7b9e6bb..2271378 100755
--- a/java/app.go
+++ b/java/app.go
@@ -1584,7 +1584,7 @@
// non-linux build platforms where dexpreopt is generally disabled (the check may fail due to
// various unrelated reasons, such as a failure to get manifest from an APK).
global := dexpreopt.GetGlobalConfig(ctx)
- if global.DisablePreopt || global.OnlyPreoptBootImageAndSystemServer {
+ if global.DisablePreopt || global.OnlyPreoptArtBootImage {
return inputFile
}
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index c0f73af..5fb36df 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -610,7 +610,8 @@
profile := bootImageProfileRule(ctx, imageConfig)
// If dexpreopt of boot image jars should be skipped, stop after generating a profile.
- if SkipDexpreoptBootJars(ctx) {
+ global := dexpreopt.GetGlobalConfig(ctx)
+ if SkipDexpreoptBootJars(ctx) || (global.OnlyPreoptArtBootImage && imageConfig.name != "art") {
return
}
diff --git a/java/dexpreopt_check.go b/java/dexpreopt_check.go
index 7499481..33be603 100644
--- a/java/dexpreopt_check.go
+++ b/java/dexpreopt_check.go
@@ -68,7 +68,7 @@
// The check should be skipped on unbundled builds because system server jars are not preopted on
// unbundled builds since the artifacts are installed into the system image, not the APEXes.
- if global.DisablePreopt || len(targets) == 0 || ctx.Config().UnbundledBuild() {
+ if global.DisablePreopt || global.OnlyPreoptArtBootImage || len(targets) == 0 || ctx.Config().UnbundledBuild() {
return
}
diff --git a/scripts/build-ndk-prebuilts.sh b/scripts/build-ndk-prebuilts.sh
index 0d14019..ef0f44a 100755
--- a/scripts/build-ndk-prebuilts.sh
+++ b/scripts/build-ndk-prebuilts.sh
@@ -19,9 +19,11 @@
exit 1
fi
+# Note: NDK doesn't support flagging APIs, so we hardcode it to trunk_staging.
# TODO: remove ALLOW_MISSING_DEPENDENCIES=true when all the riscv64
# dependencies exist (currently blocked by http://b/273792258).
# TODO: remove BUILD_BROKEN_DISABLE_BAZEL=1 when bazel supports riscv64 (http://b/262192655).
+TARGET_RELEASE=trunk_staging \
ALLOW_MISSING_DEPENDENCIES=true \
BUILD_BROKEN_DISABLE_BAZEL=1 \
TARGET_PRODUCT=ndk build/soong/soong_ui.bash --make-mode --soong-only ${OUT_DIR}/soong/ndk.timestamp