summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-11 17:45:43 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-11 17:45:43 -0800
commit1b28731bb2e21348cf5dc70c6ba6abc0f0b1d876 (patch)
tree530c0853674ea4b8230b40ef921a3ba74f40af67 /scripts
parente164b332b35a0d550d6387eb1383189a91c1e941 (diff)
parentb16e7861fdd0422fba84b7a12d5ce835c5d0db60 (diff)
Merge "Disable LTO when building the NDK sysroot." into main am: c9fb315834 am: b16e7861fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3489332 Change-Id: Ia92dd1c984eaf8ca0605e872f09ec41981475442 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-ndk-prebuilts.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/build-ndk-prebuilts.sh b/scripts/build-ndk-prebuilts.sh
index ef0f44a7c..b60044389 100755
--- a/scripts/build-ndk-prebuilts.sh
+++ b/scripts/build-ndk-prebuilts.sh
@@ -23,9 +23,18 @@ fi
# 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).
+#
+# LTO is disabled because the NDK compiler is not necessarily in-sync with the
+# compiler used to build the platform sysroot, and the sysroot includes static
+# libraries which would be incompatible with mismatched compilers when built
+# with LTO. Disabling LTO globally for the NDK sysroot is okay because the only
+# compiled code in the sysroot that will end up in apps is those static
+# libraries.
+# https://github.com/android/ndk/issues/1591
TARGET_RELEASE=trunk_staging \
ALLOW_MISSING_DEPENDENCIES=true \
BUILD_BROKEN_DISABLE_BAZEL=1 \
+DISABLE_LTO=true \
TARGET_PRODUCT=ndk build/soong/soong_ui.bash --make-mode --soong-only ${OUT_DIR}/soong/ndk.timestamp
if [ -n "${DIST_DIR}" ]; then