Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 1 | # Changelog |
| 2 | |
| 3 | Report issues to [GitHub]. |
| 4 | |
| 5 | For Android Studio issues, follow the docs on the [Android Studio site]. |
| 6 | |
| 7 | [GitHub]: https://github.com/android/ndk/issues |
| 8 | [Android Studio site]: http://tools.android.com/filing-bugs |
| 9 | |
| 10 | ## Announcements |
| 11 | |
| 12 | * GNU binutils, excluding the GNU Assembler (GAS), has been removed. GAS will be |
| 13 | removed in the next release. If you are building with `-fno-integrated-as`, |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 14 | file bugs if anything is preventing you from removing that flag. See |
| 15 | [Clang Migration Notes] for advice about making assembly compatible with LLVM. |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 16 | |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 17 | * Support for GDB has ended. GDB will be removed in the next release. Use LLDB |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 18 | instead. Note that `ndk-gdb` uses LLDB by default. |
| 19 | |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 20 | * NDK r23 is the last release that will support non-Neon. Beginning with NDK |
| 21 | r24, the armeabi-v7a libraries in the sysroot will be built with Neon. A very |
| 22 | small number of very old devices do not support Neon so most apps will not |
| 23 | notice aside from the performance improvement. |
| 24 | |
| 25 | * Jelly Bean (APIs 16, 17, and 18) will not be supported in the next NDK |
| 26 | release. The minimum OS supported by the NDK for r24 will be KitKat (API level |
| 27 | 19). |
| 28 | |
| 29 | [Clang Migration Notes]: ClangMigration.md |
| 30 | |
| 31 | ## r23b |
| 32 | |
| 33 | * Update LLVM to clang-r416183c1, based on LLVM 12 development. |
| 34 | * [Issue 1540]: Fixed compiler crash when using coroutines. |
| 35 | * [Issue 1544]: Now uses universal binaries for M1 Macs. |
| 36 | * [Issue 1551]: Prevent each translation unit from receiving its own copy of |
| 37 | emulated thread-local global variables. |
| 38 | * [Issue 1555]: Fixed compiler crash for armeabi-v7a. |
| 39 | * [Issue 1492]: ndk-build.cmd: Stop using make's `-O` (`--output-sync`) flag on |
| 40 | Windows to avoid `fcntl(): Bad file descriptor` error. |
| 41 | * [Issue 1553]: Updated sysroot to latest Android 12. |
| 42 | * [Issue 1569]: Fixed `-fno-integrated-as` not being able to find the assembler. |
| 43 | * CMake changes: |
| 44 | * [Issue 1536]: Make optimization flags used with CMake more consistent. |
| 45 | Historically thumb release builds used `-Oz`, but AGP switched to using |
| 46 | `RelWithDebInfo` for release builds in the latest release which was not |
| 47 | using `-Oz`. To reduce per-arch differences and behavior differences |
| 48 | compared to CMake's defaults, `-Oz` use was removed. You may see code size |
| 49 | increases for armeabi-v7a due to this, but also increased optimization. To |
| 50 | restore the prior behavior, add `-Oz` to your cflags. |
| 51 | * [Issue 1560]: Fixed pull-up of unsupported API levels when using the new |
| 52 | CMake toolchain file. This affects CMake 3.21 and |
| 53 | `ANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON` use cases, and was the common case |
| 54 | for AGP users with a `minSdkVersion` below 21. |
| 55 | * [Issue 1573]: Fixed `ANDROID_USE_LEGACY_TOOLCHAIN_FILE` not being obeyed |
| 56 | during CMake try-compile. |
| 57 | * [Issue 1581]: Added workaround for [CMake Issue 22647], which was causing |
| 58 | `MINGW` to be incorrectly defined by CMake when building for Android on a |
| 59 | Windows host. This only affected those using the Android toolchain file when |
| 60 | CMake 3.21 or newer was used. This likely was not a regression for users not |
| 61 | using the Android toolchain. The change will fix both use cases. |
| 62 | |
| 63 | [CMake Issue 22647]: https://gitlab.kitware.com/cmake/cmake/-/issues/22647 |
| 64 | [Issue 1492]: https://github.com/android/ndk/issues/1492 |
| 65 | [Issue 1536]: https://github.com/android/ndk/issues/1536 |
| 66 | [Issue 1540]: https://github.com/android/ndk/issues/1540 |
| 67 | [Issue 1544]: https://github.com/android/ndk/issues/1544 |
| 68 | [Issue 1551]: https://github.com/android/ndk/issues/1551 |
| 69 | [Issue 1553]: https://github.com/android/ndk/issues/1553 |
| 70 | [Issue 1555]: https://github.com/android/ndk/issues/1555 |
| 71 | [Issue 1560]: https://github.com/android/ndk/issues/1560 |
| 72 | [Issue 1569]: https://github.com/android/ndk/issues/1569 |
| 73 | [Issue 1573]: https://github.com/android/ndk/issues/1573 |
| 74 | [Issue 1581]: https://github.com/android/ndk/issues/1581 |
| 75 | |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 76 | ## Changes |
| 77 | |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 78 | * Includes Android 12 APIs. |
| 79 | * Updated LLVM to clang-r416183b, based on LLVM 12 development. |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 80 | * [Issue 1047]: Fixes crash when using ASan with the CFI unwinder. |
| 81 | * [Issue 1096]: Includes support for [Polly]. Enable by adding `-mllvm -polly` |
| 82 | to your cflags. |
| 83 | * [Issue 1230]: LLVM's libunwind is now used instead of libgcc for all |
| 84 | architectures rather than just 32-bit Arm. |
| 85 | * [Issue 1231]: LLVM's libclang_rt.builtins is now used instead of libgcc. |
| 86 | * [Issue 1406]: Fixes crash with Neon intrinsic. |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 87 | * Vulkan validation layer source and binaries are no longer shipped in the NDK. |
| 88 | The latest are now posted directly to [GitHub](https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases). |
| 89 | * Vulkan tools source is also removed, specifically vulkan_wrapper. |
| 90 | It should be downloaded upstream from [GitHub](https://github.com/KhronosGroup/Vulkan-Tools). |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 91 | * The toolchain file (android.toolchain.cmake) is refactored to base on CMake's |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 92 | integrated Android support. This new toolchain file will be enabled by default |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 93 | for CMake 3.21 and newer. No user side change is expected. But if anything goes |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 94 | wrong, please file a bug and set `ANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON` to |
| 95 | restore the legacy behavior. |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 96 | * When using the new behavior (when using CMake 3.21+ and not explicitly |
| 97 | selecting the legacy toolchain), **default build flags may change**. One |
| 98 | of the primary goals was to reduce the behavior differences between our |
| 99 | toolchain and CMake, and CMake's default flags do not always match the |
| 100 | legacy toolchain file. Most notably, if using `CMAKE_BUILD_TYPE=Release`, |
| 101 | your optimization type will likely be `-O3` instead of `-O2` or `-Oz`. See |
| 102 | [Issue 1536] for more information. |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 103 | * [Issue 929]: `find_library` now prefers shared libraries from the sysroot over |
| 104 | static libraries. |
| 105 | * [Issue 1390]: ndk-build now warns when building a static executable with the |
| 106 | wrong API level. |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 107 | * [Issue 1452]: `NDK_ANALYZE=1` now sets `APP_CLANG_TIDY=true` rather than using |
| 108 | scan-build. clang-tidy performs all the same checks by default, and scan-build |
| 109 | was no longer working. See the bug for more details, but no user-side changes |
| 110 | should be needed. |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 111 | |
| 112 | [Issue 929]: https://github.com/android/ndk/issues/929 |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 113 | [Issue 1047]: https://github.com/android/ndk/issues/1047 |
| 114 | [Issue 1096]: https://github.com/android/ndk/issues/1096 |
| 115 | [Issue 1230]: https://github.com/android/ndk/issues/1230 |
| 116 | [Issue 1231]: https://github.com/android/ndk/issues/1231 |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 117 | [Issue 1390]: https://github.com/android/ndk/issues/1390 |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 118 | [Issue 1406]: https://github.com/android/ndk/issues/1406 |
| 119 | [Issue 1452]: https://github.com/android/ndk/issues/1452 |
Aurimas Liutikas | 9b41cef | 2021-11-16 15:55:24 -0800 | [diff] [blame] | 120 | [Issue 1536]: https://github.com/android/ndk/issues/1536 |
Dan Albert | b8a0c00 | 2021-03-18 14:43:06 -0700 | [diff] [blame] | 121 | [Polly]: https://polly.llvm.org/ |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 122 | |
| 123 | ## Known Issues |
| 124 | |
| 125 | * This is not intended to be a comprehensive list of all outstanding bugs. |
| 126 | * [Issue 360]: `thread_local` variables with non-trivial destructors will cause |
| 127 | segfaults if the containing library is `dlclose`ed on devices running M or |
| 128 | newer, or devices before M when using a static STL. The simple workaround is |
| 129 | to not call `dlclose`. |
| 130 | * [Issue 906]: Clang does not pass `-march=armv7-a` to the assembler when using |
| 131 | `-fno-integrated-as`. This results in the assembler generating ARMv5 |
| 132 | instructions. Note that by default Clang uses the integrated assembler which |
| 133 | does not have this problem. To workaround this issue, explicitly use |
| 134 | `-march=armv7-a` when building for 32-bit ARM with the non-integrated |
| 135 | assembler, or use the integrated assembler. ndk-build and CMake already |
| 136 | contain these workarounds. |
| 137 | * [Issue 988]: Exception handling when using ASan via wrap.sh can crash. To |
| 138 | workaround this issue when using libc++_shared, ensure that your |
| 139 | application's libc++_shared.so is in `LD_PRELOAD` in your `wrap.sh` as in the |
| 140 | following example: |
| 141 | |
| 142 | ```bash |
| 143 | #!/system/bin/sh |
| 144 | HERE="$(cd "$(dirname "$0")" && pwd)" |
| 145 | export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1 |
| 146 | ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so) |
| 147 | if [ -f "$HERE/libc++_shared.so" ]; then |
| 148 | # Workaround for https://github.com/android/ndk/issues/988. |
| 149 | export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so" |
| 150 | else |
| 151 | export LD_PRELOAD="$ASAN_LIB" |
| 152 | fi |
| 153 | "$@" |
| 154 | ``` |
| 155 | |
| 156 | There is no known workaround for libc++_static. |
| 157 | |
| 158 | Note that because this is a platform bug rather than an NDK bug this |
| 159 | workaround will be necessary for this use case to work on all devices until |
| 160 | at least Android R. |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 161 | |
| 162 | [Issue 360]: https://github.com/android/ndk/issues/360 |
Dan Albert | e7e2c31 | 2021-03-10 16:43:22 -0800 | [diff] [blame] | 163 | [Issue 906]: https://github.com/android/ndk/issues/906 |
| 164 | [Issue 988]: https://github.com/android/ndk/issues/988 |