0

Disable TLSDESC for Android RISC-V builds

By default, newer versions of Clang enable TLSDESC for Android RISC-V
targets. However, TLSDESC is not enabled in NDK r27, the next shipping
version of the Android NDK. To maintain consistency with Android's
distributed toolchain, disable TLSDESC here for Android RISC-V builds.

This feature will likely be re-enabled and present in NDK r28, at which
point this code can be removed safely.

Bug: 338624902
Test: Verified Cronet RISC-V build produces __tls_get_addr in objdump.
Change-Id: I70711848978f65ffb577827b29a409dde4cefd84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5530922
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299248}
This commit is contained in:
Prashanth Swaminathan
2024-05-10 15:21:56 +00:00
committed by Chromium LUCI CQ
parent f669940bbe
commit 099c1b2cc2

@ -64,6 +64,13 @@ config("compiler") {
}
}
# Disable TLSDESC for riscv64 until the Android NDK supports it. While
# Chromium's clang turns it on by default for Android RISC-V devices, NDK r27
# currently has it disabled. This can likely be removed in NDK r28.
if (current_cpu == "riscv64") {
cflags += [ "-mtls-dialect=trad" ]
}
# $compile_api_level corresponds to the API level used for the sysroot path
# calculation in //build/config/android/config.gni
if (android_64bit_target_cpu) {