[libcxx-commits] [libcxx] 57c6854 - Update Android CI and Emulator image to API 23 (#194936)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 1 22:51:51 PDT 2026


Author: Sharjeel Khan
Date: 2026-05-02T01:51:46-04:00
New Revision: 57c68540dea08ac1ef646ec731dd7a442e6550c0

URL: https://github.com/llvm/llvm-project/commit/57c68540dea08ac1ef646ec731dd7a442e6550c0
DIFF: https://github.com/llvm/llvm-project/commit/57c68540dea08ac1ef646ec731dd7a442e6550c0.diff

LOG: Update Android CI and Emulator image to API 23 (#194936)

As seen in https://github.com/android/ndk/issues/2188, NDK will raise
minimum supported version to API 23 (Android 6.0) in r31. We need to
bump the API level for the x86 emulator image so we can use it for the
CI. It required generating a new ABI list for API 23 and removing the
old API 21 and making some changes to adb_run.py to filter out warnings
and get permissions for the adb run folder.

Added: 
    libcxx/lib/abi/i686-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/x86_64-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist

Modified: 
    libcxx/utils/adb_run.py
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/vendor/android/build-emulator-images.sh
    runtimes/cmake/android/Arch-arm.cmake
    runtimes/cmake/android/Arch-arm64.cmake
    runtimes/cmake/android/Arch-x86.cmake
    runtimes/cmake/android/Arch-x86_64.cmake

Removed: 
    libcxx/lib/abi/i686-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist
    libcxx/lib/abi/x86_64-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist


################################################################################
diff  --git a/libcxx/lib/abi/i686-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/i686-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
similarity index 99%
rename from libcxx/lib/abi/i686-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist
rename to libcxx/lib/abi/i686-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
index 767a3a9d0da06..814fa26349b3d 100644
--- a/libcxx/lib/abi/i686-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/i686-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1,5 +1,6 @@
 {'is_defined': False, 'name': '__cxa_atexit at LIBC', 'type': 'FUNC'}
 {'is_defined': False, 'name': '__cxa_finalize at LIBC', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_thread_atexit_impl at LIBC', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt10bad_typeid4whatEv', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}

diff  --git a/libcxx/lib/abi/x86_64-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
similarity index 99%
rename from libcxx/lib/abi/x86_64-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist
rename to libcxx/lib/abi/x86_64-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
index c3826e77c101f..975d7ae118bf5 100644
--- a/libcxx/lib/abi/x86_64-linux-android21.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-linux-android23.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1,5 +1,6 @@
 {'is_defined': False, 'name': '__cxa_atexit at LIBC', 'type': 'FUNC'}
 {'is_defined': False, 'name': '__cxa_finalize at LIBC', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_thread_atexit_impl at LIBC', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt10bad_typeid4whatEv', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'}
 {'is_defined': True, 'name': '_ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}

diff  --git a/libcxx/utils/adb_run.py b/libcxx/utils/adb_run.py
index cddbd191e9881..d4b1e9ac096a8 100755
--- a/libcxx/utils/adb_run.py
+++ b/libcxx/utils/adb_run.py
@@ -63,6 +63,16 @@ def sync_test_dir(local_dir: str, remote_dir: str) -> None:
         if not os.path.islink(local_file) and os.path.isfile(local_file):
             run_adb_sync_command(["adb", "push", "--sync", local_file,
                                   remote_file])
+            # Some libc++ tests create temporary files in the working directory,
+            # which might be owned by root. In Android M (API 23), the
+            # directories are owned by root so they are not writable by the
+            # shell user. Make them writable before running the tests as the shell
+            # user.
+            run_adb_sync_command(["adb", "shell", "chmod", "777", REMOTE_BASE_DIR])
+            run_adb_sync_command(
+                ["adb", "shell", "chmod", "777", os.path.dirname(remote_dir)]
+            )
+            run_adb_sync_command(["adb", "shell", "chmod", "777", remote_dir])
             return
 
     assert os.path.basename(local_dir) == os.path.basename(remote_dir)
@@ -70,6 +80,13 @@ def sync_test_dir(local_dir: str, remote_dir: str) -> None:
     run_adb_sync_command(["adb", "push", "--sync", local_dir,
                           os.path.dirname(remote_dir)])
 
+    # Some libc++ tests create temporary files in the working directory, which might be
+    # owned by root. In Android M (API 23), the directories are owned by root so they are
+    # not writable by the shell user. Make them writable before running the tests as the
+    # shell user.
+    run_adb_sync_command(["adb", "shell", "chmod", "777", REMOTE_BASE_DIR])
+    run_adb_sync_command(["adb", "shell", "chmod", "777", os.path.dirname(remote_dir)])
+    run_adb_sync_command(["adb", "shell", "chmod", "777", remote_dir])
 
 def build_env_arg(env_args: List[str], prepend_path_args: List[Tuple[str, str]]) -> str:
     components = []
@@ -115,10 +132,6 @@ def run_command(args: argparse.Namespace) -> int:
         # and always run as root. Non-debug builds typically lack `su` and only
         # run as the shell user.
         #
-        # Some libc++ tests create temporary files in the working directory,
-        # which might be owned by root. Before switching to shell, make the
-        # cwd writable (and readable+executable) to every user.
-        #
         # N.B.:
         #  - Avoid "id -u" because it wasn't supported until Android M.
         #  - The `env` and `which` commands were also added in Android M.
@@ -204,7 +217,17 @@ def run_command(args: argparse.Namespace) -> int:
                              f"  output: {output}\n")
             return 1
 
-        sys.stderr.write(match.group(1))
+        # Android M (API 23) will print a warning for DT_FLAGS_1=0x8000001
+        # because they were not set until 2016 which is Android O.
+        stderr_content = match.group(1)
+        stderr_content = re.sub(
+            r"^WARNING: linker: .*unsupported flags DT_FLAGS_1=.*\n?",
+            "",
+            stderr_content,
+            flags=re.MULTILINE,
+        )
+
+        sys.stderr.write(stderr_content)
         sys.stdout.write(match.group(2))
         return int(match.group(3))
 

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index eb2804e5cbef1..d4107cf11ad51 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -153,8 +153,8 @@ steps:
 
 - group: ':android: Android'
   steps:
-  - label: Android 5.0, x86 NDK
-    command: libcxx/utils/ci/run-buildbot android-ndk-21-def-x86
+  - label: Android 6.0, x86 NDK
+    command: libcxx/utils/ci/run-buildbot android-ndk-23-def-x86
     env:
       CC: /opt/android/clang/clang-current/bin/clang
       CXX: /opt/android/clang/clang-current/bin/clang++

diff  --git a/libcxx/utils/ci/vendor/android/build-emulator-images.sh b/libcxx/utils/ci/vendor/android/build-emulator-images.sh
index 4e29c172e47ed..4fdb81c5cafc3 100755
--- a/libcxx/utils/ci/vendor/android/build-emulator-images.sh
+++ b/libcxx/utils/ci/vendor/android/build-emulator-images.sh
@@ -24,5 +24,5 @@ build_image() {
 
 cd "${THIS_DIR}"
 
-build_image 21-def-x86
+build_image 23-def-x86
 build_image 33-goog-x86_64

diff  --git a/runtimes/cmake/android/Arch-arm.cmake b/runtimes/cmake/android/Arch-arm.cmake
index c9e6e2509cb2e..34b8a0edb72ec 100644
--- a/runtimes/cmake/android/Arch-arm.cmake
+++ b/runtimes/cmake/android/Arch-arm.cmake
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
 
 set(CMAKE_SYSTEM_PROCESSOR "armv7-a" CACHE STRING "")
-set(CMAKE_ASM_COMPILER_TARGET "armv7a-linux-androideabi21" CACHE STRING "")
-set(CMAKE_C_COMPILER_TARGET   "armv7a-linux-androideabi21" CACHE STRING "")
-set(CMAKE_CXX_COMPILER_TARGET "armv7a-linux-androideabi21" CACHE STRING "")
-set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
+set(CMAKE_ASM_COMPILER_TARGET "armv7a-linux-androideabi23" CACHE STRING "")
+set(CMAKE_C_COMPILER_TARGET   "armv7a-linux-androideabi23" CACHE STRING "")
+set(CMAKE_CXX_COMPILER_TARGET "armv7a-linux-androideabi23" CACHE STRING "")
+set(ANDROID_NATIVE_API_LEVEL 23 CACHE STRING "")

diff  --git a/runtimes/cmake/android/Arch-arm64.cmake b/runtimes/cmake/android/Arch-arm64.cmake
index 9cae3313fad0d..9a50b347f68b0 100644
--- a/runtimes/cmake/android/Arch-arm64.cmake
+++ b/runtimes/cmake/android/Arch-arm64.cmake
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
 
 set(CMAKE_SYSTEM_PROCESSOR "aarch64" CACHE STRING "")
-set(CMAKE_ASM_COMPILER_TARGET "aarch64-linux-android21" CACHE STRING "")
-set(CMAKE_C_COMPILER_TARGET   "aarch64-linux-android21" CACHE STRING "")
-set(CMAKE_CXX_COMPILER_TARGET "aarch64-linux-android21" CACHE STRING "")
-set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
+set(CMAKE_ASM_COMPILER_TARGET "aarch64-linux-android23" CACHE STRING "")
+set(CMAKE_C_COMPILER_TARGET   "aarch64-linux-android23" CACHE STRING "")
+set(CMAKE_CXX_COMPILER_TARGET "aarch64-linux-android23" CACHE STRING "")
+set(ANDROID_NATIVE_API_LEVEL 23 CACHE STRING "")

diff  --git a/runtimes/cmake/android/Arch-x86.cmake b/runtimes/cmake/android/Arch-x86.cmake
index 31b7a719e6a3d..3fe76803349f4 100644
--- a/runtimes/cmake/android/Arch-x86.cmake
+++ b/runtimes/cmake/android/Arch-x86.cmake
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
 
 set(CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "")
-set(CMAKE_ASM_COMPILER_TARGET "i686-linux-android21" CACHE STRING "")
-set(CMAKE_C_COMPILER_TARGET   "i686-linux-android21" CACHE STRING "")
-set(CMAKE_CXX_COMPILER_TARGET "i686-linux-android21" CACHE STRING "")
-set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
+set(CMAKE_ASM_COMPILER_TARGET "i686-linux-android23" CACHE STRING "")
+set(CMAKE_C_COMPILER_TARGET   "i686-linux-android23" CACHE STRING "")
+set(CMAKE_CXX_COMPILER_TARGET "i686-linux-android23" CACHE STRING "")
+set(ANDROID_NATIVE_API_LEVEL 23 CACHE STRING "")

diff  --git a/runtimes/cmake/android/Arch-x86_64.cmake b/runtimes/cmake/android/Arch-x86_64.cmake
index a109fac6974f5..061cb39e169c5 100644
--- a/runtimes/cmake/android/Arch-x86_64.cmake
+++ b/runtimes/cmake/android/Arch-x86_64.cmake
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
 
 set(CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "")
-set(CMAKE_ASM_COMPILER_TARGET "x86_64-linux-android21" CACHE STRING "")
-set(CMAKE_C_COMPILER_TARGET   "x86_64-linux-android21" CACHE STRING "")
-set(CMAKE_CXX_COMPILER_TARGET "x86_64-linux-android21" CACHE STRING "")
-set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
+set(CMAKE_ASM_COMPILER_TARGET "x86_64-linux-android23" CACHE STRING "")
+set(CMAKE_C_COMPILER_TARGET   "x86_64-linux-android23" CACHE STRING "")
+set(CMAKE_CXX_COMPILER_TARGET "x86_64-linux-android23" CACHE STRING "")
+set(ANDROID_NATIVE_API_LEVEL 23 CACHE STRING "")


        


More information about the libcxx-commits mailing list