blob: 7df6a5a60dc8d4730a67bb34dfd694786e7beecb [file] [log] [blame] [view]
Dan Alberte7e2c312021-03-10 16:43:22 -08001# Changelog
2
3Report issues to [GitHub].
4
5For 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 Liutikas9b41cef2021-11-16 15:55:24 -080014 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 Alberte7e2c312021-03-10 16:43:22 -080016
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -080017* Support for GDB has ended. GDB will be removed in the next release. Use LLDB
Dan Albertb8a0c002021-03-18 14:43:06 -070018 instead. Note that `ndk-gdb` uses LLDB by default.
19
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -080020* 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 Alberte7e2c312021-03-10 16:43:22 -080076## Changes
77
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -080078* Includes Android 12 APIs.
79* Updated LLVM to clang-r416183b, based on LLVM 12 development.
Dan Albertb8a0c002021-03-18 14:43:06 -070080 * [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 Alberte7e2c312021-03-10 16:43:22 -080087* 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 Liutikas9b41cef2021-11-16 15:55:24 -080091* The toolchain file (android.toolchain.cmake) is refactored to base on CMake's
Dan Alberte7e2c312021-03-10 16:43:22 -080092 integrated Android support. This new toolchain file will be enabled by default
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -080093 for CMake 3.21 and newer. No user side change is expected. But if anything goes
Dan Alberte7e2c312021-03-10 16:43:22 -080094 wrong, please file a bug and set `ANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON` to
95 restore the legacy behavior.
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -080096 * 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 Alberte7e2c312021-03-10 16:43:22 -0800103* [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 Albertb8a0c002021-03-18 14:43:06 -0700107* [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 Alberte7e2c312021-03-10 16:43:22 -0800111
112[Issue 929]: https://github.com/android/ndk/issues/929
Dan Albertb8a0c002021-03-18 14:43:06 -0700113[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 Alberte7e2c312021-03-10 16:43:22 -0800117[Issue 1390]: https://github.com/android/ndk/issues/1390
Dan Albertb8a0c002021-03-18 14:43:06 -0700118[Issue 1406]: https://github.com/android/ndk/issues/1406
119[Issue 1452]: https://github.com/android/ndk/issues/1452
Aurimas Liutikas9b41cef2021-11-16 15:55:24 -0800120[Issue 1536]: https://github.com/android/ndk/issues/1536
Dan Albertb8a0c002021-03-18 14:43:06 -0700121[Polly]: https://polly.llvm.org/
Dan Alberte7e2c312021-03-10 16:43:22 -0800122
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 Alberte7e2c312021-03-10 16:43:22 -0800161
162[Issue 360]: https://github.com/android/ndk/issues/360
Dan Alberte7e2c312021-03-10 16:43:22 -0800163[Issue 906]: https://github.com/android/ndk/issues/906
164[Issue 988]: https://github.com/android/ndk/issues/988