Commit 4df2e8ce by Tim Van Patten Committed by Angle LUCI CQ

Reduce ANGLE APK size

Add some flags to generate_android_bp.py to make the AOSP match the ANGLE build flags, which makes the CQ testing more relevant and reduces the ANGLE APK size. Additionally, disable various GN args that are no longer required (GL, ESSL, HSSL). Together, this reduces the ANGLE APK size in AOSP from 22.2MB to 16.7MB. This CL also makes some fixes to roll_aosp.sh that are suggested by "Shell Scipt". Bug: b/189125396 Test: manual verification Change-Id: Iea33de799a00ffff182cf028a6998e1ef01a00e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2912933Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent 51feebb4
...@@ -275,6 +275,10 @@ def gn_cflags_to_blueprint_cflags(target_info): ...@@ -275,6 +275,10 @@ def gn_cflags_to_blueprint_cflags(target_info):
# Ignore errors about unrecognized warning flags. # Ignore errors about unrecognized warning flags.
result.append('-Wno-unknown-warning-option') result.append('-Wno-unknown-warning-option')
# Override AOSP build flags to match ANGLE's CQ testing and reduce binary size
result.append('-Oz')
result.append('-fno-unwind-tables')
if 'defines' in target_info: if 'defines' in target_info:
for define in target_info['defines']: for define in target_info['defines']:
# Don't emit ANGLE's CPU-bits define here, it will be part of the arch-specific # Don't emit ANGLE's CPU-bits define here, it will be part of the arch-specific
......
...@@ -24,7 +24,7 @@ function generate_Android_bp_file() { ...@@ -24,7 +24,7 @@ function generate_Android_bp_file() {
"x64" "x64"
) )
for abi in ${abis[@]}; do for abi in "${abis[@]}"; do
# generate gn build files and convert them to blueprints # generate gn build files and convert them to blueprints
gn_args=( gn_args=(
"target_os = \"android\"" "target_os = \"android\""
...@@ -43,7 +43,7 @@ function generate_Android_bp_file() { ...@@ -43,7 +43,7 @@ function generate_Android_bp_file() {
# Disable all backends except Vulkan # Disable all backends except Vulkan
"angle_enable_vulkan = true" "angle_enable_vulkan = true"
"angle_enable_gl = true" # TODO(geofflang): Disable GL once Andrid no longer requires it. anglebug.com/4444 "angle_enable_gl = false"
"angle_enable_d3d9 = false" "angle_enable_d3d9 = false"
"angle_enable_d3d11 = false" "angle_enable_d3d11 = false"
"angle_enable_null = false" "angle_enable_null = false"
...@@ -53,8 +53,8 @@ function generate_Android_bp_file() { ...@@ -53,8 +53,8 @@ function generate_Android_bp_file() {
"angle_enable_swiftshader = false" "angle_enable_swiftshader = false"
# Disable all shader translator targets except desktop GL (for Vulkan) # Disable all shader translator targets except desktop GL (for Vulkan)
"angle_enable_essl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 "angle_enable_essl = false"
"angle_enable_glsl = true" # TODO(geofflang): Disable ESSL once Andrid no longer requires it. anglebug.com/4444 "angle_enable_glsl = false"
"angle_enable_hlsl = false" "angle_enable_hlsl = false"
"angle_enable_commit_id = false" "angle_enable_commit_id = false"
...@@ -122,8 +122,8 @@ add_only_deps=( ...@@ -122,8 +122,8 @@ add_only_deps=(
) )
# Delete dep directories so that gclient can check them out # Delete dep directories so that gclient can check them out
for dep in ${deps[@]} ${delete_only_deps[@]}; do for dep in "${deps[@]}" "${delete_only_deps[@]}"; do
rm -rf $dep rm -rf "$dep"
done done
# Sync all of ANGLE's deps so that 'gn gen' works # Sync all of ANGLE's deps so that 'gn gen' works
...@@ -136,8 +136,8 @@ git add Android.bp ...@@ -136,8 +136,8 @@ git add Android.bp
# Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp # Delete the .git files in each dep so that it can be added to this repo. Some deps like jsoncpp
# have multiple layers of deps so delete everything before adding them. # have multiple layers of deps so delete everything before adding them.
for dep in ${deps[@]} ${delete_only_deps[@]}; do for dep in "${deps[@]}" "${delete_only_deps[@]}"; do
rm -rf $dep/.git rm -rf "$dep"/.git
done done
extra_removal_files=( extra_removal_files=(
...@@ -153,12 +153,12 @@ extra_removal_files=( ...@@ -153,12 +153,12 @@ extra_removal_files=(
"third_party/zlib/contrib/tests/fuzzers/OWNERS" "third_party/zlib/contrib/tests/fuzzers/OWNERS"
) )
for removal_file in ${extra_removal_files[@]}; do for removal_file in "${extra_removal_files[@]}"; do
rm -f $removal_file rm -f "$removal_file"
done done
for dep in ${deps[@]} ${add_only_deps[@]}; do for dep in "${deps[@]}" "${add_only_deps[@]}"; do
git add -f $dep git add -f "$dep"
done done
# Done with depot_tools # Done with depot_tools
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment