1. __set_errno is deprecated and subject to removal in future release
2. elf.h is seen to be included alone, causing compilation error due
to undefined uint32_t and uint64_t
Change-Id: I4ca348a8ba0689eb3880622dcf5c53be470c57e8
To be the same as bionic's. See
ec37237d69289e2bb9836bfa0d071ab958234d00
The new one also no longer undef offsetof and replaces it with
"((size_t) &((TYPE *)0)->MEMBER)" if __compiler_offsetof isn't
defined. The problem with the old behavior are that
1. __compiler_offsetof isn't defined in linux/compiler.h even though
all Android compilers support __builtin_offsetof
2. As as result, offsetof defined in stddef.h to use __builtin_offsetof
is undefined and replaced here. Problem is,
"((size_t) &((TYPE *)0)->MEMBER)" isn't considered a compile-time
constant, and fails some code expect offsetof to be.
Change-Id: I3ebb0de9e1d95305a0890a099360ff6936d24b2f
With --enable-libgomp, gcc/gcc-4.4.3/libiberty/configure line #2124 tries
to link a trivial program but fails w/o the presence of libc.so and libdl.so
and sets "gcc_no_link=yes" at line #2131. Confiugre later fails with
cryptic message reads "Link tests are not allowed after GCC_NO_EXECUTABLES."
See
https://android-review.googlesource.com/#/c/34491, 48617, and 48619
Change-Id: I6e761c5fb12f413dca04a26b39f27e9f026d75d3
The LONG_LONG_MIN, LONG_LONG_MAX and ULONG_LONG_MAX are
GLibc-specific macros. Move their declarations from
<pthread.h> to <limits.h> where they belong.
Change-Id: I597465b99893706ade82069238f60df73d8e236e
This is port of related CLs:
9d40326830c2bd407427889c554adeb915ee6b4a
f3cfcd869ded41d25c1f4f4e48e7c374a64f9583
Summary: By placing __PREINIT_ARRAY__, __INIT_ARRAY__, __FINI_ARRAY__
and __CTOR_LIST__ on stack, this change allows PIC w/o relying on text
relocations.
Change-Id: I02a1b496b16aba692f4f9fa998a71efd943689fd
Changed "jump __libc_init" to "call __libc_init" otherwise stack unwinding
past __libc_init may get wrong return address and crash the program or do
wield things. With "call", return address is pushed on stack and unwinding
stops correctly at _start. Note that __libc_init never returns, so this
fix wonʼt affect normal program execution. But just in case it "does"
return, jump to address 0 and halt.
Change-Id: Id194fb32adcbf89ae59939cee33c50b5bbdd36fe
This patch removes all prebuilt C runtime object files from
the ndk/platforms/ directory. We replace them with equivalent
assembly sources lifted from the following directories:
bionic/libc/private/ (for __dso_handle.S and __dso_handle_so.S)
bionic/libc/arch-$ARCH/ (for all others)
Note: This requires that your NDK's gen-platforms.sh script be
capable of rebuilding the object files from sources.
See https://android-review.googlesource.com/36822
The goal here is to make it much easier to update these files,
and track their changes relative to the content of bionic/lib.
For example to fix the following issues in the future:
Change-Id: If4c84e2584b0e58ca3585b034bb8a13a8add8ab9
http://code.google.com/p/android/issues/detail?id=26911http://code.google.com/p/android/issues/detail?id=23203
This patch improves the formatting of <pthread.h> as exposed by the NDK:
- change '#if __cplusplus' into '#ifdef __cplusplus'
- change C++-style comment into C-style comment
Change-Id: Ib093058e8d7a7554d8329a40e102cde11d065932
- Cleanup declaration of lseek64() to use off64_t instead of loff_t
- Cleanup declaration of prctl() to use variable number of arguments
The cleanups are performed to better match upstream.
Change-Id: I3c9420e328c3772bbb57dc9108dc879aa698a981
This patch fixes some formatting issues in <sys/cdefs.h>:
- change '#if __STDC_VERSION__ > xxx' into '#if defined(__STDC_VERSION__) && __STDC_VERSION > xxx'
- add __LIBC_HIDDEN__ definition (not technically required, but makes comparing the headers with upstream easier)
This fixes two minor issues with recent updates to the IPv6 related headers:
- add missing <linux/ipv6.h> kernel header
- avoid conflict in netinet/in6.h, the macro is already defined by <linux/in6.h>
The atomic operations exported by the platform's C library do not
provide full memory barriers. This can result in incorrect results
when NDK machine code linked against them runs on multi-core devices.
While the bug has been fixed in the platform, this NDK header change
ensures that any source code that includes <sys/atomics.h> will end
up using a correct implementation of these functions, based on the
corresponding GCC builtins.
These builtins always provide a full barrier and have reasonable
performance. Application developers who depend on <sys/atomics.h>
should recompile their unmodified sources against this version
of the NDK as soon as possible.
This patch contains a minor update to the netinet headers from the C library.
Most of the changes come from later platform release, but can be safely back-ported
to previous API levels since they don't change the ABI:
- <netinet/icmp6.h>, <netinet/ip6.h>: new headers
- <netinet/in.h>: now always include <linux/ipv6.h> by default
- <netinet/in6.h>: add macros: IN6_IS_ADDR_ULA, IN6ADDR_LOOPBACK_INIT
- <netinet/ip.h>: add macro: IPTOS_MINCOST
- <net/if_ether.h>: always include <sys/types.h> by default.
This is a minor update to two ARM-specific kernel headers.
- <asm/ptrace.h>: Add two new constants
- <asm/user.h>: Add 'struct vfp_user' and 'struct vfp_user_exc'
The x86 asm headers define __u64 regardless of __STRICT_ANSI__.
The linux/videodev2.h header requires __u64 to be defined, thus
this fixes compiling with -std=c99 when including the
linux/videodev2.h header.
In glibc, the asm/types.h header defines __u64 regardless of
__STRICT_ANSI__.
This commit copies the updated header from bionic into the ndk
platform headers.
Both functions are part of the C library since Android 1.5 / API level 3
but were missing a declaration in <time.h>, so add then here
+ Fix first parameter from 'int' to 'clockid_t' for clock_getres()
and clock_gettime()
Fixes http://code.google.com/p/android/issues/detail?id=20140
Change-Id: Ic2191d5eb54475c149b9a6b8f3ba55bc8ed4643f
We don't use these since NDK r5, since we now provide
customized versions of the library under
$NDK/sources/android/libthread_db
Change-Id: I2e3103b85c14e75a00ba9cece7a872d2156f5ef9
Remove the prebuilt system shared libraries and unified symbol files
from development/ndk. We don't need them anymore:
- the unified symbol files are replaced by separate functions/variables
symbol list, which were added in a previous commit, i.e.:
libc.so.txt --> libc.so.functions.txt
libc.so.variables.txt
- the shared libraries are now generated on the fly by the NDK
gen-platforms.sh script, from the functions/variables symbol lists.
Note that we need to keep the static libraries and runtime objects,
they are required to build the cross-toolchains and target binaries.
Change-Id: Ifa0a7f2d741ed32b80216561ca3f17e67df06ce9
This change introduces separate symbol lists for functions
and variables of each NDK system shared library.
Note that we don't remove the unified symbol files yet. This
will be done later when we complete other changes under ndk/,
namely the ability to generate platforms trees containing shell
libraries generated directly from them.
These files were generated using the following:
cd development/ndk
for DIR in platforms/*/*/lib; do
for ARCH in arm x86; do
$NDK/build/tools/gen-system-symbols $DIR $DIR/../symbols
done
done
This means that the symbol lists were generated by parsing the
existing prebuilt shared libraries under platforms/ and extracting
their function and variable names.
Change-Id: Ie1e791d98260a7f0d8d2e9f71323a7ea448f2dd4
This patch updates the definition of JNIEXPORT in <jni.h> to
use the "default" ELF visibility attribute for JNI_OnLoad and
any function that uses the macro for its definition.
This is handy when a developer wants to use hidden visibility
by default by using a compiler flag like -fvisibility=hidden
in its Android.mk or custom build script.
Change-Id: I95112932731216a9a4986820a1875edfb3f52e5b