The Android Native Development Kit
android {
ndkVersion "27.0.11718014-beta1"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r27-beta1-windows.zip | 785017110 | 147b5b333cc57875e34b88ccd29efbe58963264d |
macOS | android-ndk-r27-beta1-darwin.dmg | 926697037 | 168ceb5253fa77eacd6ac7c7b6597bd09a92981c |
Linux | android-ndk-r27-beta1-linux.zip | 658958615 | 35a78f7544ccc72d8438d8ea2feb7f252a062abe |
Report issues to GitHub.
For Android Studio issues, go to https://b.android.com and file a bug using the Android Studio component, not the NDK component.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
Android V will allow OEMs to ship arm64-v8a and x86_64 devices with 16KiB page
sizes. Devices that use this configuration will not be able to run existing
apps that use native code. To be compatible with these devices, applications
will need to rebuild all their native code to be 16KiB aligned, and rewrite
any code which assumes a specific page size. ndk-build and CMake have options
to enable this mode (see note about APP_SUPPORT_FLEXIBLE_PAGE_SIZES
and
ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES
below). A future version of the NDK will
enable this mode by default. If you're using or maintaining a third-party
build system, consult the build system maintainers guide for instructions.
See Support 16 KB page sizes for more information.
clang_source_info.md
in the toolchain
directory for version information.
clang-scan-deps
is now included.std::unexpected::has_value()
.preserve_all
calling convention.aarch64-linux-android21-clang
, you can instead use clang -target aarch64-linux-android21
, e.g. CC="clang -target aarch64-linux-android21" ./configure
. The wrappers are only needed when working with systems that do
not properly handle a CC
that includes arguments.ANDROID_USE_LEGACY_TOOLCHAIN_FILE
value is now preserved
during try-compile steps when ON
.sources/third_party/vulkan
. The standard Vulkan headers are included in the
Android sysroot, which Clang will find automatically.APP_SUPPORT_FLEXIBLE_PAGE_SIZES
for ndk-build and
ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES
for CMake. Set to
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true
in your Application.mk
or pass
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON
to CMake (via
android.defaultConfig.externalNativeBuild.cmake.arguments
if you're using
the Android Gradle Plugin) to build your code to be compatible with devices
that use a 16KiB page size. Third-party build system users and maintainers
should consult the build system maintainers guide.android {
ndkVersion "26.3.11579264"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26d-windows.zip | 665022840 | c7ea35ffe916082876611da1a6d5618d15430c29 |
macOS | android-ndk-r26d-darwin.dmg | 1655224062 | 703100c3d721b04e09f02f3fddc5f1f5ced28b10 |
Linux | android-ndk-r26d-linux.zip | 668556491 | fcdad75a765a46a9cf6560353f480db251d14765 |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
minSdkVersion 34
or higher.AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1679: Clang will now automatically enable ELF TLS for
minSdkVersion 29
or higher.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.ndk-gdb
with -f
.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.WIFSTOPPED
.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.
android {
ndkVersion "26.2.11394342"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26c-windows.zip | 660158794 | f8c8aa6135241954461b2e3629cada4722e13ee7 |
macOS | android-ndk-r26c-darwin.dmg | 1655206097 | 9d86710c309c500aa0a918fa9902d9d72cca0889 |
Linux | android-ndk-r26c-linux.zip | 668556021 | 7faebe2ebd3590518f326c82992603170f07c96e |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
minSdkVersion 34
or higher.AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1679: Clang will now automatically enable ELF TLS for
minSdkVersion 29
or higher.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.ndk-gdb
with -f
.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.WIFSTOPPED
.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.
android {
ndkVersion "26.1.10909125"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26b-windows.zip | 661624075 | 17453c61a59e848cffb8634f2c7b322417f1732e |
macOS | android-ndk-r26b-darwin.dmg | 1657011580 | c30bdbc77c5bae2faf912591611640ac4d3c2331 |
Linux | android-ndk-r26b-linux.zip | 669320864 | fdf33d9f6c1b3f16e5459d53a82c7d2201edbcc4 |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
minSdkVersion 34
or higher.AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1679: Clang will now automatically enable ELF TLS for
minSdkVersion 29
or higher.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.ndk-gdb
with -f
.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.WIFSTOPPED
.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.
android {
ndkVersion "26.0.10792818"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26-windows.zip | 664790510 | 7fcf5789bc248c130af675720353819f72b02b94 |
macOS | android-ndk-r26-darwin.dmg | 1655326729 | c1c5236686e0427978d0afba60f544383d27216b |
Linux | android-ndk-r26-linux.zip | 668596633 | d3bef08e0e43acd9e7815538df31818692d548bb |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
AndroidVersion.txt
and
clang_source_info.md
in the toolchain directory for version information.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1679: Clang will now automatically enable ELF TLS for
minSdkVersion 29
or higher.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.ndk-gdb
with -f
.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.WIFSTOPPED
.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.
android {
ndkVersion "26.0.10636728-rc1"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26-rc1-windows.zip | 664889050 | d4f4aa8a863e6e7cc0c433f1ecd8a304da4848a7 |
macOS | android-ndk-r26-rc1-darwin.dmg | 1655325328 | 2d95e41291d059585cd1b76ddfd8c68e39d1537c |
Linux | android-ndk-r26-rc1-linux.zip | 668698776 | 6ec8c08204409fea4853bf0317660caadabfc8b0 |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
Issue 1907: HWASan linker will be used automatically for
minSdkVersion 34
or higher.
Issue 1909: Fixed ABI mismatch between function-multi-versioning and ifunc resolvers.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.ndk-gdb
with -f
.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.WIFSTOPPED
.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.
android {
ndkVersion "26.0.10404224-beta1"
}
Platform | Package | Size (Bytes) | SHA1 Checksum |
---|---|---|---|
Windows | android-ndk-r26-beta1-windows.zip | 664889266 | bcdc60cf0149fc862cbb5514e7879d8c46c6e1e0 |
macOS | android-ndk-r26-beta1-darwin.dmg | 1655327043 | b97bd170f5ea5a04449aa23bbfdbd686395e0591 |
Linux | android-ndk-r26-beta1-linux.zip | 668699088 | fb5e34313766764d9654b04603e69af813b18799 |
Report issues to GitHub.
For Android Studio issues, follow the docs on the Android Studio site.
If you're a build system maintainer that needs to use the tools in the NDK directly, see the build system maintainers guide.
Clang now treats -Wimplicit-function-declaration
as an error rather than a
warning in C11 and newer. Clang's default C standard is 17, so this is a
change in default behavior compared to older versions of Clang, but is the
behavior defined by C99.
If you encounter these errors when upgrading, you most likely forgot an
#include
. If you cannot (or do not want to) fix those issues, you can
revert to the prior behavior with
-Wno-error=implicit-function-declaration
.
C++ users are unaffected. This has never been allowed in C++.
See https://reviews.llvm.org/D122983 for more details.
Issue 1298: Fixed seccomp error with ASan on x86_64 devices.
Issue 1530: Updated libc++ to match LLVM version.
Issue 1565: Fixed lldb ncurses issue with terminal database on Darwin.
Issue 1677: Fixed Clang crash in optimizer.
Issue 1834: Fixed Clang crash during SVE conversions.
Issue 1860: Fixed miscompilation affecting armv7.
Issue 1861: Fixed front end crash in Clang.
Issue 1862: Fixed Clang crash for aarch64 with -Os
.
Issue 1880: Fixed crash in clang-format.
Issue 1883: Fixed crash when incorrectly using neon intrinsics.
-DANDROID_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS=ON
to CMake or set
LOCAL_ALLOW_UNDEFINED_VERSION_SCRIPT_SYMBOLS := true
in your Android.mk
file. For other build systems, see the secion titled "Version script
validation" in the build system maintainers guide.__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__
as an option.strtoq
and strtouq
from the libc stub
libraries. These were never exposed in the header files, but could confuse
some autoconf like systems.This is not intended to be a comprehensive list of all outstanding bugs.
Issue 360: thread_local
variables with non-trivial destructors will cause
segfaults if the containing library is dlclose
ed. This was fixed in API 28,
but code running on devices older than API 28 will need a workaround. The
simplest fix is to stop calling dlclose
. If you absolutely must continue
calling dlclose
, see the following table:
Pre-API 23 | APIs 23-27 | API 28+ | |
---|---|---|---|
No workarounds | Works for static STL | Broken | Works |
-Wl,-z,nodelete |
Works for static STL | Works | Works |
No dlclose |
Works | Works | Works |
If your code must run on devices older than M (API 23) and you cannot use the
static STL (common), the only fix is to not call dlclose
, or to stop
using thread_local
variables with non-trivial destructors.
If your code does not need to run on devices older than API 23 you can link
with -Wl,-z,nodelete
, which instructs the linker to ignore dlclose
for
that library. You can backport this behavior by not calling dlclose
.
The fix in API 28 is the standardized inhibition of dlclose
, so you can
backport the fix to older versions by not calling dlclose
.
Issue 988: Exception handling when using ASan via wrap.sh can crash. To
workaround this issue when using libc++_shared, ensure that your application's
libc++_shared.so is in LD_PRELOAD
in your wrap.sh
as in the following
example:
#!/system/bin/sh
HERE="$(cd "$(dirname "$0")" && pwd)"
export ASAN_OPTIONS=log_to_syslog=false,allow_user_segv_handler=1
ASAN_LIB=$(ls $HERE/libclang_rt.asan-*-android.so)
if [ -f "$HERE/libc++_shared.so" ]; then
# Workaround for https://github.com/android/ndk/issues/988.
export LD_PRELOAD="$ASAN_LIB $HERE/libc++_shared.so"
else
export LD_PRELOAD="$ASAN_LIB"
fi
"$@"
There is no known workaround for libc++_static.
Note that because this is a platform bug rather than an NDK bug this cannot be fixed with an NDK update. This workaround will be necessary for code running on devices that do not contain the fix, and the bug has not been fixed even in the latest release of Android.