Updated LLVM to clang-r450784d1, based on LLVM 14 development.
Issue 1797: Fixed LLDB handling of forward slashes in absolute paths on Windows.
Issue 1832: Improvements to aarch64 vector code generation.
Issue 1813: -Wl,--gc-sections is no longer set by default for debug builds. This behavior was removed because it could cause the linker to remove functions that may be useful to evaluate during debugging. The new CMake toolchain file (-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF, not the default behavior) does not include this fix because it requires a CMake fix first.
Issue 1757: Updated simpleperf. Includes fix for signing denial when run on macOS.
Issue 1739: Fixed C compatibility issue in amidi/AMidi.h.
Issue 1740: Fixed the legacy toolchain when using CMake’s Release build configuration. Since r23b it has not be receiving any optimization flag. It will now receive -O3. If you’re building with AGP and haven’t overridden AGP’s default CMake modes, this change does not affect you, as AGP uses RelWithDebInfo by default.
Issue 1744: Fixes ASan wrap.sh file to support 32-bit apps on 64-bit devices.
Updated LLVM to clang-r450784d, based on LLVM 14 development.
Issue 1455: Improved display of Android API levels in Clang diagnostics.
Issue 1608: Fixed crash in vector conversions.
Issue 1710: Fixed compiler crash caused by invalid -march values.
Eliminate duplicate static libraries in API-versioned sysroot directories. This reduces the uncompressed size of the NDK by 500 MB.
Strip some binaries and libraries. This reduces the uncompressed size of the NDK by 300 MB.
Remove python2. All scripts now use python3.
Issue 933: Updated reference ASan wrap.sh to support attaching the Java debugger.
Issue 1334: Improved argument escaping for compile_commands.json files generated by ndk-build.
Issue 1634: Fixed the build rule for the libshaderc_combined target.
Issue 1693: The NDK’s toolchain file for CMake (android.toolchain.cmake) defaults to the legacy toolchain file for all versions of CMake. The new toolchain file can still be enabled using -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF.
Issue 1717: Arranged for --gc-sections to be passed to the linker when building shared libraries.
Updated LLVM to clang-r437112b, based on LLVM 14 development.
Issue 1590: Fix LLDB help crash.
Issue 1108: Removed mbstowcs and wcstombs from the pre-API 21 stubs and moved the implementation to libandroid_support to fix those APIs on old devices.
Issue 1299: Additional Apple M1 support:
Issue 1410: Fixed incorrect host tool directory identification in ndk-build on M1 macs.
Issue 1544: LLVM tools are now universal binaries.
Issue 1546: Make is now a universal binary.
Issue 1479: Added LOCAL_BRANCH_PROTECTION option to ndk-build for using -mbranch-protection with aarch64 without breaking other ABIs. Example use: LOCAL_BRANCH_PROTECTION := standard.
Issue 1492: Windows Make now works with -O, and ndk-build now uses it by default.
Issue 1559: Added LOCAL_ALLOW_MISSING_PREBUILT option to PREBUILT_SHARED_LIBRARY and PREBUILT_STATIC_LIBRARY which defers failures for missing prebuilts to build time. This enables use cases within AGP where one module provides “pre” built libraries to another module.
Issue 1587: ndk-stack is now tolerant of unsorted zip infos.
Issue 1589: Fixed broken stack traces on API 29 devices when using a minSdkVersion of 29.
Issue 1593: Improved ndk-which to fall back to LLVM tools when the GNU names are used. For example, ndk-which strip will now return the path to llvm-strip instead of nothing.
Issue 1610: Fixed handling of ANDROID_NATIVE_API_LEVEL in the new CMake toolchain file.
Issue 1618: Corrected CMAKE_ANDROID_EXCEPTIONS behavior for the new CMake toolchain file.
Issue 1623: Fixed behavior of the legacy CMake toolchain file when used with new versions of CMake (incompatible -gcc-toolchain argument).
Issue 1656: The new CMake toolchain file now ignores ANDROID_ARM_MODE when it is passed for ABIs other than armeabi-v7a like the legacy toolchain file did. With CMake 3.22 it is an error to set CMAKE_ANDROID_ARM_MODE for other ABIs, so this fixes a potential incompatibility between the legacy and new toolchains when using CMake 3.22+.
Removed make-standalone-toolchain.sh. This was broken in a previous release and it was unnoticed, so it seems unused. make_standalone_toolchain.py remains, but neither has been needed since NDK r19 since the toolchain can be invoked directly.
Update LLVM to clang-r416183c2, based on LLVM 12 development.
Issue 1590: Fixed LLDB crashes when calling help on unknown commands.
Issue 1608: Fixed crash in vector conversions.
Issue 1619: Fixed performance regression in arm64 vectorization.
Issue 1645: Fixed crash caused by openmp master/critical pragmas.
Issue 1672: Fixed armeabi-v7a libunwind.a to be compatible with vfpv3-d16 (remember that this is the last release that will support that FPU setting).
Issue 1410: Fix ndk-build for Apple M1.
Issue 1546: Universal binaries (M1 support) for make (affects ndk-build).
Issue 1577: Universal binaries (M1 support) for shader-tools (vulkan compilers).
Issue 1569: Fix -fno-integrated-as for Linux and Darwin hosts by making GAS symlink relative
Issue 1589: Fix incorrect API level check for -Wl,–no-rosegment in ndk-build and CMake.
Issue 1593: Improved ndk-which to fall back to LLVM tools when the GNU names are used. For example, ndk-which strip will now return the path to llvm-strip instead of nothing.
Issue 1610: Fix ANDROID_NATIVE_API_LEVEL CMake variable when using the non-legacy toolchain file.
Issue 1618: Fix behavior of ANDROID_CPP_FEATURES with the new toolchain file.
Issue 1656: The new CMake toolchain file now ignores ANDROID_ARM_MODE when it is passed for ABIs other than armeabi-v7a like the legacy toolchain file did. With CMake 3.22 it is an error to set CMAKE_ANDROID_ARM_MODE for other ABIs, so this fixes a potential incompatibility between the legacy and new toolchains when using CMake 3.22+.
Issue 1693: The NDK’s toolchain file for CMake (android.toolchain.cmake) defaults to the legacy toolchain file for all versions of CMake. The new toolchain file can still be enabled using -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF.
Update LLVM to clang-r416183c1, based on LLVM 12 development.
Issue 1540: Fixed compiler crash when using coroutines.
Issue 1544: Now uses universal binaries for M1 Macs.
Issue 1551: Prevent each translation unit from receiving its own copy of emulated thread-local global variables.
Issue 1555: Fixed compiler crash for armeabi-v7a.
Issue 1492: ndk-build.cmd: Stop using make’s -O (–output-sync) flag on Windows to avoid fcntl(): Bad file descriptor error.
Issue 1553: Updated sysroot to latest Android 12.
Issue 1569: Fixed -fno-integrated-as not being able to find the assembler.
CMake changes:
Issue 1536: Make optimization flags used with CMake more consistent. Historically thumb release builds used -Oz, but AGP switched to using RelWithDebInfo for release builds in the latest release which was not using -Oz. To reduce per-arch differences and behavior differences compared to CMake’s defaults, -Oz use was removed. You may see code size increases for armeabi-v7a due to this, but also increased optimization. To restore the prior behavior, add -Oz to your cflags.
Issue 1560: Fixed pull-up of unsupported API levels when using the new CMake toolchain file. This affects CMake 3.21 and ANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON use cases, and was the common case for AGP users with a minSdkVersion below 21.
Issue 1573: Fixed ANDROID_USE_LEGACY_TOOLCHAIN_FILE not being obeyed during CMake try-compile.
Issue 1581: Added workaround for CMake Issue 22647, which was causing MINGW to be incorrectly defined by CMake when building for Android on a Windows host. This only affected those using the Android toolchain file when CMake 3.21 or newer was used. This likely was not a regression for users not using the Android toolchain. The change will fix both use cases.
Updated LLVM to clang-r416183b, based on LLVM 12 development.
Issue 1047: Fixes crash when using ASan with the CFI unwinder.
Issue 1096: Includes support for Polly. Enable by adding -mllvm -polly to your cflags.
Issue 1230: LLVM’s libunwind is now used instead of libgcc for all architectures rather than just 32-bit Arm.
Issue 1231: LLVM’s libclang_rt.builtins is now used instead of libgcc.
Issue 1406: Fixes crash with Neon intrinsic.
Vulkan validation layer source and binaries are no longer shipped in the NDK. The latest are now posted directly to GitHub.
Vulkan tools source is also removed, specifically vulkan_wrapper. It should be downloaded upstream from GitHub.
The toolchain file (android.toolchain.cmake) is refactored to base on CMake’s integrated Android support. This new toolchain file will be enabled by default for CMake 3.21 and newer. No user side change is expected. But if anything goes wrong, please file a bug and set ANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON to restore the legacy behavior.
When using the new behavior (when using CMake 3.21+ and not explicitly selecting the legacy toolchain), default build flags may change. One of the primary goals was to reduce the behavior differences between our toolchain and CMake, and CMake’s default flags do not always match the legacy toolchain file. Most notably, if using CMAKE_BUILD_TYPE=Release, your optimization type will likely be -O3 instead of -O2 or -Oz. See Issue 1536 for more information.
Issue 929: find_library now prefers shared libraries from the sysroot over static libraries.
Issue 1390: ndk-build now warns when building a static executable with the wrong API level.
Issue 1452: NDK_ANALYZE=1 now sets APP_CLANG_TIDY=true rather than using scan-build. clang-tidy performs all the same checks by default, and scan-build was no longer working. See the bug for more details, but no user-side changes should be needed.
Updated LLVM to r399163b, based on LLVM 11 development.
Issue 829: Fixed issue with attribute((visibility(“hidden”))) symbols sometimes not being hidden.
Issue 1149: Fixed Clang crash with #pragma detect_mismatch.
Issue 1212: Fixed llvm-strip to match GNU behavior for removing file symbols.
Issue 1248: Fixed LLD Neon crash.
Issue 1303: Fixed Neon intrinsic optimizer crash.
Updated make to 4.3.
Updated libc++, libc++abi, and libunwind to https://github.com/llvm/llvm-project/commit/52ec983895436089c5be0b0c4d967423db16045b.
Issue 609: std::filesystem support is now included. There are two known issues:
Issue 1258: std::filesystem::perm_options::nofollow may not be honored on old devices.
Issue 1260: std::filesystem::canonical will incorrectly succeed when passed a non-existent path on old devices.
Issue 843: llvm-strip is now used instead of strip to avoid breaking RelRO with LLD. Note that the Android Gradle Plugin performs its own stripping, so most users will need to upgrade to Android Gradle Plugin version 4.0 or newer to get the fix.
Issue 1130: Fixed undefined references to new that could occur when building for APIs prior to 21 and the static libc++. Note that LLD appears to have been unaffected, but the problem is still present for ndk-build when using the deprecated linkers.
Issue 1139: native_app_glue now hooks up the APP_CMD_WINDOW_RESIZED, APP_CMD_WINDOW_REDRAW_NEEDED, and APP_CMD_CONTENT_RECT_CHANGED messages.
Issue 1196: Backtraces for crashes on devices older than API 29 are now correct when using LLD if using ndk-build or the CMake toolchain file. If using a different system and targeting devices older than API 29, use -Wl,–no-rosegment when linking. See the Build System Maintainers Guide for more information.
The deprecated /platforms and /sysroot directories have been removed. These directories were merged and relocated into the toolchain during r19. The location of these contents should not be relevant to anyone, including build systems, since the toolchain handles them implicitly. If you are using a build system that hasn’t adapted to the changes introduced in NDK r19, file a bug with your build system maintainer. See the Build System Maintainers Guide for information on using the NDK in your own build system.
llvm-ar is now used instead of ar.
Issue 1200: Fixed an issue with using dlclose with libraries using thread_local with non-trivial destructors and the static libc++.
The legacy libc++ linker scripts in /sources/cxx-stl/llvm-libc++ have been removed. The linkers scripts in the toolchain should be used instead as described by the Build System Maintainers Guide.
LLD is now used by default. If your build is not yet compatible with LLD, you can continue using the deprecated linkers, set APP_LD=deprecated for ndk-build, ANDROID_LD=deprecated for CMake, or use an explicit -fuse-ld=gold or -fuse-ld=bfd in your custom build system. If you encounter issues be sure to file a bug, because this will not be an option in a subsequent release. Note that Issue 843 will affect builds using LLD with binutils strip and objcopy as opposed to llvm-strip and llvm-objcopy.
ndk-gdb now uses lldb as the debugger. gdb is deprecated and will be removed in a future release. To fall back to gdb, use --no-lldb option. But please file a bug explaining why you couldn’t use lldb.