Skip to content

Commit

Permalink
Enable a 64-bit build of AOSP APK on 25 LTS (#4351)
Browse files Browse the repository at this point in the history
These commits were manually cherry picked from the changes in
b/355499070.

b/376441619
  • Loading branch information
hlwarriner authored Nov 1, 2024
1 parent a1f634b commit f9edf09
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ import("//starboard/android/shared/platform_configuration/configuration.gni")
android_abi = "arm64-v8a"
arm_version = 8
sabi_path = "//starboard/sabi/arm64/sabi-v$sb_api_version.json"
sb_evergreen_compatible_package = true
16 changes: 16 additions & 0 deletions starboard/android/arm64/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ gcc_toolchain("target") {
is_clang = true
}
}

gcc_toolchain("native_target") {
prefix = rebase_path("$android_toolchain_path/bin", root_build_dir)
cc = "$prefix/aarch64-linux-android${android_ndk_api_level}-clang"
cxx = "$prefix/aarch64-linux-android${android_ndk_api_level}-clang++"
ld = cxx
readelf = "readelf"
ar = "ar"
nm = "nm"

toolchain_args = {
is_starboard = false
is_native_target_build = true
is_clang = true
}
}
8 changes: 5 additions & 3 deletions starboard/loader_app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ if (sb_is_evergreen_compatible && sb_evergreen_compatible_package &&
if (target_cpu == "arm" && arm_float_abi == "softfp") {
sources = [ "$root_out_dir/../evergreen-$target_cpu-${arm_float_abi}_$build_type/content" ]
} else if (target_cpu == "arm64") {
sources = [ "$root_out_dir/../evergreen-$target_cpu_$build_type/content" ]
sources =
[ "$root_out_dir/../evergreen-${target_cpu}_$build_type/content" ]
} else {
sources = []
}
Expand All @@ -59,8 +60,9 @@ if (sb_is_evergreen_compatible && sb_evergreen_compatible_package &&
if (target_cpu == "arm" && arm_float_abi == "softfp") {
sources = [ "$root_out_dir/../evergreen-$target_cpu-${arm_float_abi}_$build_type/manifest.json" ]
} else if (target_cpu == "arm64") {
sources =
[ "$root_out_dir/../evergreen-$target_cpu_$build_type/manifest.json" ]
sources = [
"$root_out_dir/../evergreen-${target_cpu}_$build_type/manifest.json",
]
} else {
sources = []
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/zlib/arm_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ static void _arm_check_features(void)
arm_cpu_enable_neon, arm_cpu_enable_pmull);
SbLogFlush();
}
#elif defined(ARMV8_OS_ANDROID) && defined(__aarch64__)
#elif defined(ARMV8_OS_ANDROID) && defined(__aarch64__) && !defined(NATIVE_TARGET_BUILD)
uint64_t features = android_getCpuFeatures();
arm_cpu_enable_pmull = !!(features & ANDROID_CPU_ARM64_FEATURE_PMULL);
#elif defined(ARMV8_OS_ANDROID) /* aarch32 */
#elif defined(ARMV8_OS_ANDROID) && !defined(NATIVE_TARGET_BUILD) /* aarch32 */
uint64_t features = android_getCpuFeatures();
arm_cpu_enable_crc32 = !!(features & ANDROID_CPU_ARM_FEATURE_CRC32);
arm_cpu_enable_pmull = !!(features & ANDROID_CPU_ARM_FEATURE_PMULL);
Expand Down

0 comments on commit f9edf09

Please sign in to comment.