Downloads
Platform | Package | Size | MD5 Checksum |
---|---|---|---|
Windows | android-ndk-r8b-windows.zip | 188724991 bytes | 6d290d4f2729ef2063c5ae5b1e335622 |
Mac OS X (intel) | android-ndk-r8b-darwin-x86.tar.bz2 | 181255568 bytes | 94fe392194ea41f8a70cfce0dee3870f |
Linux 32/64-bit (x86) | android-ndk-r8b-linux-x86.tar.bz2 | 160466240 bytes | 6694ccc04d543500f0661a75f6c46526 |
Revisions
The sections below provide information and notes about successive releases ofthe NDK, as denoted by revision number.
Android NDK, Revision 8b
(July 2012)
The main features of this release are a new GNU Compiler Collection (GCC) 4.6 toolchain andGNU Debugger (GDB) 7.3.x which adds debugging support for the Android 4.1 (API Level 16) systemimage.
-
Important bug fixes:
-
- Fixed
LOCAL_SHORT_COMMANDS
issues on Mac OS, Windows Cygwin environments forstatic libraries. List file generation is faster, and it is not regenerated to avoid repeatedproject rebuilds. - Fixed several issues in
ndk-gdb
:- Updated tool to pass flags
-e
,-d
and-s
to adb moreconsistently. - Updated tool to accept device serial names containing spaces.
- Updated tool to retrieve
/system/bin/link
information, sogdb
onthe host can set a breakpoint in__dl_rtld_db_dlactivity
and be aware of linker activity(e.g., rescansolib
symbols whendlopen()
is called).
- Updated tool to pass flags
- Fixed
ndk-build clean
on Windows, which was failing to remove./libs/*/lib*.so
. - Fixed
ndk-build.cmd
to return a non-zeroERRORLEVEL
whenmake
fails. - Fixed
libc.so
to stop incorrectly exporting the__exidx_start
and__exidx_end
symbols. - Fixed
SEGV
when unwinding the stack past__libc_init
for ARM andMIPS.
- Fixed
-
Important changes:
-
- Added GCC 4.6 toolchain (
binutils
2.21 withgold
and GDB 7.3.x) toco-exist with the original GCC 4.4.3 toolchain (binutils
2.19 and GDB 6.6).- GCC 4.6 is now the default toolchain. You may set
NDK_TOOLCHAIN_VERSION=4.4.3
inApplication.mk
to select the original one. - Support for the
gold
linker is only available for ARM and x86architectures on Linux and Mac OS hosts. This support is disabled by default. AddLOCAL_LDLIBS += -fuse-ld=gold
inAndroid.mk
to enable it. - Programs compiled with
-fPIE
require the newGDB
for debugging,including binaries in Android 4.1 (API Level 16) system images. - The
binutils
2.21ld
tool contains back-ported fixes fromversion 2.22: - Disabled
sincos()
optimization for compatibility with older platforms.
- GCC 4.6 is now the default toolchain. You may set
- Updated build options to enable the Never eXecute (NX) bit and
relro
/bind_now
protections by default:- Added
--noexecstack
to assembler and-z noexecstack
to linkerthat provides NX protection against buffer overflow attacks by enabling NX bit on stack andheap. - Added
-z relro
and-z now
to linker for hardening of internaldata sections after linking to guard against security vulnerabilities caused by memory corruption.(more info: 1,2) - These features can be disabled using the following options:
- Disable NX protection by setting the
--execstack
option for theassembler and-z execstack
for the linker. - Disable hardening of internal data by setting the
-z norelro
and-z lazy
options for the linker. - Disable these protections in the NDK
jni/Android.mk
by setting thefollowing options:LOCAL_DISABLE_NO_EXECUTE=true # disable "--noexecstack" and "-z noexecstack" DISABLE_RELRO=true # disable "-z relro" and "-z now"
See
docs/ANDROID-MK.html
for more details. - Disable NX protection by setting the
- Added
- Added branding for Android executables with the
.note.ABI-tag
section (incrtbegin_static/dynamic.o
) so that debugging tools can act accordingly. The structuremember and values are defined as follows:static const struct { int32_t namesz; /* = 4, sizeof ("GNU") */ int32_t descsz; /* = 6 * sizeof(int32_t) */ int32_t type; /* = 1 */ char name[sizeof "GNU"]; /* = "GNU" */ int32_t os; /* = 0 */ int32_t major; /* = 2 */ int32_t minor; /* = 6 */ int32_t teeny; /* = 15 */ int32_t os_variant; /* = 1 */ int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */ }
- Added GCC 4.6 toolchain (
-
Other bug fixes:
-
- Fixed
mips-linux-gnu
relocation truncated to fitR_MIPS_TLS_LDM
issue. (more info) - Fixed
ld
tool segfaults when using--gc-sections
. (more info) - Fixed MIPS
GOT_PAGE
counting issue. (more info) - Fixed follow warning symbol link for
mips_elf_count_got_symbols
. - Fixed follow warning symbol link for
mips_elf_allocate_lazy_stub
. - Moved MIPS
.dynamic
to the data segment, so that it is writable. - Replaced hard-coded values for symbols with correct segment sizes for MIPS.
- Removed the
-mno-shared
option from the defaults in the MIPS toolchain.The default for Android toolchain is-fPIC
(or-fpic
if supported). If you do notexplicitly specify-mshared
,-fpic
,-fPIC
,-fpie
, or-fPIE
,the MIPS compiler adds-mno-shared
that turns off PIC. Fixed compiler not to add-mno-shared
in this case. - Fixed wrong package names in samples
hello-jni
andtwo-libs
so thatthetests
project underneath it can compile.
- Fixed
-
Other Changes:
-
- Changed locations of binaries:
- Moved
gdbserver
fromtoolchain/<arch-os-ver>/prebuilt/gdbserver
toprebuilt/android-<arch>/gdbserver/gdbserver
. - Renamed x86 toolchain prefix from
i686-android-linux-
toi686-linux-android-
. - Moved
sources/cxx-stl/gnu-libstdc++/include
andlib
tosources/cxx-stl/gnu-libstdc++/4.6
when compiled with GCC 4.6, orsources/cxx-stl/gnu-libstdc++/4.4.3
when compiled with GCC 4.4.3. - Moved
libbfd.a
andlibintl.a
fromlib/
tolib32/
.
- Moved
- Added and improved various scripts in the rebuild and test NDK toolchain:
- Added
build-mingw64-toolchain.sh
to generate a new Linux-hosted toolchainthat generates Win32 and Win64 executables. - Improved speed of
download-toolchain-sources.sh
by using theclone
command and only usingcheckout
for the directories that are needed to build the NDKtoolchain binaries. - Added
build-host-gcc.sh
andbuild-host-gdb.sh
scripts. - Added
tests/check-release.sh
to check the content of a given NDKinstallation directory, or an existing NDK package. - Rewrote the
tests/standalone/run.sh
standalone tests .
- Added
- Removed
if_dl.h
header from all platforms and architectures. TheAF_LINK
andsockaddr_dl
elements it describes are specific to BSD (i.e., they don't existin Linux).
- Changed locations of binaries: