From 643b262becfa90486a6559001764ee6309523ea0 Mon Sep 17 00:00:00 2001 From: Juan Yescas Date: Thu, 13 Apr 2023 16:53:42 -0700 Subject: 16K: Declare DeviceMaxPageSizeSupported as a product variable DeviceMaxPageSizeSupported product variable will be used in arm/arm64 targets to configure the binary alignment. Test: Unit tests Bug: 276963698 Bug: 276801883 (cherry picked from https://android-review.googlesource.com/q/commit:68470992f2bbdcc5c01fbf28a6407029e38c55bc) Merged-In: I27168b3343ac383020483eddf907ee71cf084de8 Change-Id: I27168b3343ac383020483eddf907ee71cf084de8 --- .../product_variables_providing_rule.bzl | 2 ++ tests/products/BUILD | 34 ++++++++++++++++------ tests/products/aosp_arm.variables.bzl | 1 + tests/products/aosp_arm64.variables.bzl | 1 + tests/products/aosp_x86.variables.bzl | 1 + tests/products/aosp_x86_64.variables.bzl | 1 + tests/products/product_labels.bzl | 6 ++-- 7 files changed, 35 insertions(+), 11 deletions(-) diff --git a/product_config/product_variables_providing_rule.bzl b/product_config/product_variables_providing_rule.bzl index b1af0e0f..8317dee6 100644 --- a/product_config/product_variables_providing_rule.bzl +++ b/product_config/product_variables_providing_rule.bzl @@ -25,6 +25,7 @@ ProductVariablesInfo = provider( "Unbundled_build": "True if this is an unbundled build", "ManifestPackageNameOverrides": "A list of string:string mapping from APEX/APK name to package name to override the AndroidManifest.xml package of the module.", "CertificateOverrides": "A list of string:string mapping from APEX/APK name to the certificate name to override the certificate used to sign the APEX/APK container.", + "DeviceMaxPageSizeSupported": "String indicating the max-page-size supported by the device.", }, ) @@ -53,6 +54,7 @@ def _product_variables_providing_rule_impl(ctx): Unbundled_build = vars.get("Unbundled_build", False), ManifestPackageNameOverrides = vars.get("ManifestPackageNameOverrides", []), CertificateOverrides = vars.get("CertificateOverrides", []), + DeviceMaxPageSizeSupported = vars.get("DeviceMaxPageSizeSupported", ""), ), ProductVariablesDepsInfo( DefaultAppCertificateFiles = ctx.files.default_app_certificate_filegroup, diff --git a/tests/products/BUILD b/tests/products/BUILD index 0e78ebaa..22dd0163 100644 --- a/tests/products/BUILD +++ b/tests/products/BUILD @@ -24,18 +24,16 @@ android_product( ) android_product( - name = "aosp_arm64_for_testing", - soong_variables = _soong_variables_arm64, -) - -android_product( - name = "aosp_x86_for_testing", - soong_variables = _soong_variables_x86, + name = "aosp_arm_for_testing_custom_linker_alignment", + soong_variables = dicts.add( + _soong_variables_arm, + {"DeviceMaxPageSizeSupported": "65536"}, + ), ) android_product( - name = "aosp_x86_64_for_testing", - soong_variables = _soong_variables_x86_64, + name = "aosp_arm64_for_testing", + soong_variables = _soong_variables_arm64, ) android_product( @@ -70,3 +68,21 @@ android_product( }, ), ) + +android_product( + name = "aosp_arm64_for_testing_custom_linker_alignment", + soong_variables = dicts.add( + _soong_variables_arm64, + {"DeviceMaxPageSizeSupported": "16384"}, + ), +) + +android_product( + name = "aosp_x86_for_testing", + soong_variables = _soong_variables_x86, +) + +android_product( + name = "aosp_x86_64_for_testing", + soong_variables = _soong_variables_x86_64, +) diff --git a/tests/products/aosp_arm.variables.bzl b/tests/products/aosp_arm.variables.bzl index 3d531ea1..75d59e75 100644 --- a/tests/products/aosp_arm.variables.bzl +++ b/tests/products/aosp_arm.variables.bzl @@ -32,6 +32,7 @@ variables = json.decode('''{ "DeviceSecondaryArchVariant": "", "DeviceSecondaryCpuVariant": "", "DeviceSecondaryAbi": [], + "DeviceMaxPageSizeSupported": "4096", "Aml_abis": false, "Ndk_abis": false, "NativeBridgeArch": "", diff --git a/tests/products/aosp_arm64.variables.bzl b/tests/products/aosp_arm64.variables.bzl index 21cb0e8c..3b2e97a0 100644 --- a/tests/products/aosp_arm64.variables.bzl +++ b/tests/products/aosp_arm64.variables.bzl @@ -32,6 +32,7 @@ variables = json.decode('''{ "DeviceSecondaryArchVariant": "armv8-a", "DeviceSecondaryCpuVariant": "generic", "DeviceSecondaryAbi": ["armeabi-v7a","armeabi"], + "DeviceMaxPageSizeSupported": "4096", "Aml_abis": false, "Ndk_abis": false, "NativeBridgeArch": "", diff --git a/tests/products/aosp_x86.variables.bzl b/tests/products/aosp_x86.variables.bzl index c6ec1b69..09ee23de 100644 --- a/tests/products/aosp_x86.variables.bzl +++ b/tests/products/aosp_x86.variables.bzl @@ -32,6 +32,7 @@ variables = json.decode('''{ "DeviceSecondaryArchVariant": "", "DeviceSecondaryCpuVariant": "", "DeviceSecondaryAbi": [], + "DeviceMaxPageSizeSupported": "4096", "Aml_abis": false, "Ndk_abis": false, "NativeBridgeArch": "", diff --git a/tests/products/aosp_x86_64.variables.bzl b/tests/products/aosp_x86_64.variables.bzl index f6e89589..f6661a8b 100644 --- a/tests/products/aosp_x86_64.variables.bzl +++ b/tests/products/aosp_x86_64.variables.bzl @@ -32,6 +32,7 @@ variables = json.decode('''{ "DeviceSecondaryArchVariant": "x86_64", "DeviceSecondaryCpuVariant": "", "DeviceSecondaryAbi": ["x86"], + "DeviceMaxPageSizeSupported": "4096", "Aml_abis": false, "Ndk_abis": false, "NativeBridgeArch": "", diff --git a/tests/products/product_labels.bzl b/tests/products/product_labels.bzl index e3d88d76..e1cefefc 100644 --- a/tests/products/product_labels.bzl +++ b/tests/products/product_labels.bzl @@ -1,9 +1,11 @@ product_labels = [ "@//build/bazel/tests/products:aosp_arm_for_testing", + "@//build/bazel/tests/products:aosp_arm_for_testing_custom_linker_alignment", "@//build/bazel/tests/products:aosp_arm64_for_testing", - "@//build/bazel/tests/products:aosp_x86_for_testing", - "@//build/bazel/tests/products:aosp_x86_64_for_testing", + "@//build/bazel/tests/products:aosp_arm64_for_testing_custom_linker_alignment", "@//build/bazel/tests/products:aosp_arm64_for_testing_no_compression", "@//build/bazel/tests/products:aosp_arm64_for_testing_unbundled_build", "@//build/bazel/tests/products:aosp_arm64_for_testing_with_overrides_and_app_cert", + "@//build/bazel/tests/products:aosp_x86_for_testing", + "@//build/bazel/tests/products:aosp_x86_64_for_testing", ] -- cgit v1.2.3