This was removed from bionic by commit c82c0b7e072491da4818e7de37411fbb2055fce1
in 2014-06. The symbols are still in NDK cruft for LP32, but no longer in the
NDK's libc.so. Microsoft points out that we should probably remove the header
too.
Bug: 11156955
Change-Id: Id463f8f20d3d8c4428f6aecb317577d78ccad215
Also since __aeabi* and __gnu_Unwind_Find_exidx symbols
were incorrectly versioned in M (android-23) remove them from
the version script for all platform versions <= 23
Bug: https://github.com/android-ndk/ndk/issues/1
Change-Id: I04902aac25a722100fc502600df908bb3a786356
The following arm symbols should be exported by libc.so:
__aeabi_atexit; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
Bug: https://github.com/android-ndk/ndk/issues/1
Change-Id: I36f758c574a939174d43999048c193e63def548f
This consolidates the guts of the three endian.h files (endian.h,
sys/endian.h, and machine/endian.h) into just sys/endian.h, and turns
the others into headers that forward to it.
This also consolidates all the architecture specific machine/endian.h
files into a single generic header.
Finally, this is also the update version of sys/endian.h, which just
forwards to compiler builtins rather than implementing it ourselves.
Change-Id: Ifce64dc684ce3d3231f3f43a94c083bbd8661840
This is all macros, so there's no reason to have one per API level.
This is still quite a ways from matching what we have in bionic, but
that's a problem for another day.
Change-Id: I804edfd6299d9ba15a3ba59e1091f301eace2142
GCC and Clang will not define __GNUC_STDC_INLINE__ when compiling C++, so this
macro currently implies regular C++ inline semantics in C++. This may cause
the compiler to emit an external definition of the function, which will cause
link errors when compiling with -fvisibility=hidden; see e.g. crbug.com/481902.
To fix this, also test the __cplusplus macro when deciding whether to assume
non-GNU inline semantics.
Change-Id: Icbd1f42279c2f65610e62f21d4a0a09d3b0e091c
This CL unconditionally removes the existance of __builtin_isinf and
__builtin_isnan from math.h for clang, because (unlike other math functions)
clang doesn't like those to be declared.
See LLVM bugzilla entry: http://llvm.org/bugs/show_bug.cgi?id=20958
The reason for decorating all math functions with __attribute__((pcs("aapcs")))
is to offer developers the ability to compile their code with hardfp and still
link Android's libm.so which follows softfp calling convention.
Before issue 20958 is fixed, those who want clang to compile their code with
hardfp in NDK has to go all the way hard, ie.
1) LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
Note that _NDK_MATH_NO_SOFTFP=1 remove __attribute__((pcs("aapcs"))) for all math functions
2) LOCAL_LDLIBS += -lm_hard # link libm_hard.a recompiled with -mhard-float instead of bionic libm.so
Change-Id: Ie2f95e73e58e1574e8cadbcab92a5209d94448e1
Macros putc, getc and their unlock cousins use internal functions and
variables not necessarily available in future libc.so (*1). Remove macros
and use functions aleady exists in libc.so instead.
(*1) https://android-review.googlesource.com/#/c/110662/
Change-Id: I3faa2d74de40ef8376119b38f2a39d46ece47d07
Upstream clang3.6 still doesn't allow change of calling convension of
__builtin_isnan from the default to "softfp" (via __attribute__((pcs("aapcs"))))
as required by bionic libm.so for 32-bit ARM. Let's hope clang3.7
fix that. See upstream bug http://llvm.org/bugs/show_bug.cgi?id=20958
Change-Id: Ibdcc1783ffa7cf2f36e733983bd6d912ad38df70
Also
1. Header singal.h now includes <sys/ucontext.h>
2. asm/user.h include sys/user.h
3. change use of user_i387_struct to user_fpregs_struct
See bionic 26a8eb50a84e131d34d10d5d167d67e9995399bd
Change-Id: I9592e98b90d773ef5babb428a6a6ef208fe86327
When GCC is built bionic's stdio.h (among other headers) is fixed: __va_list
is replaced with __gnuc_va_list, and put in include-fixed/stdio.h,
unless stdio.h already contains __gnuc_va_list. When GCC is later
used bionic's stdio.h is never included.
The problem in the context of NDK is that all 32-bit Android toolchain
are built with android-9 header and expect to work with all API levels
sometime with sustantially different stdio.h.
This CL stops GCC from generating include-fixed/stdio.h by putting
__gnuc_va_list in it.
See bionic df85f50b and b.android.com/73728
Change-Id: I7a490496efbd491a0376608b9ae6e9e2dfc15fb3
1) Add ldexp. ldexp used to co-exist in both libc.so and libm.so until
the removal from libm.so in ICS. Unfortunately the sole copy of libm_hard.a
in NDK was compiled from JB source and miss ldexp. Code compiled with
hard-float using ldexp may use libc.so which follows soft-float and misbehave
2) Turns out the following (all in fpclassify.o) also exists in recent libc.so
too. Add them in libm_hard.a as well:
__fpclassifyd
__fpclassifyf
__fpclassifyl
__isfinitef
__isfinite
__isfinitel
__isinff
__isinf
__isinfl
__isnanl
__isnormalf
__isnormal
__isnormall
isinf
isnan
isnanf
Change-Id: Ia157fb2911341988de102e55d0c6f6141a9c3dda
1) ssize_t is int, instead of long int
2) WCHAR_MIN and WCHAR_MAX be consistent with bionic's:
respond to __WCHAR_UNSIGNED__, work for both signed (X86/MIPS)
and unsigned (ARM) wchar_t, and work for -fshort-wchar too
Change-Id: Ief1be007571b50c5d63a819df489f9d3f9b47bc8
$NDK/tests/standalone/run.sh fail to run with last update on stdint.h
to android-20 level. Restore stdint.h for fear of the new one breaking
the existing apps
Also fix signal_portable.h to use SIGRTMIN/MAX in old headers
(which got renamed to __SIGRTMIN in new header)
Also change _JBLEN to 1024 which shall be large enough to store CPU
states for forseable future.
Change-Id: Ia9c03558a258c10434eb8e6985adc122532feaa3
It appears that upstream 3.5 still can't accept __builtin_isnan redeclared
with calling convention, eg.
cat > isnan.c <<EOF
int __builtin_isnan(double) __attribute__((pcs("aapcs")));
EOF
clang -target armv5te-none-linux-androideabi -c isnan.c
isnan.c:1:5: error: function declared 'aapcs' here was previously declared without calling convention
int __builtin_isnan(double) __attribute__((pcs("aapcs")));
^
isnan.c:1:5: note: previous declaration is here
Change-Id: Iff466fd913c3deec27aa3ff355a208543028d368
* Add i386/elf_machdep.h, it is used during the build of 32-bit part of
multilib compiler;
* Remove page.h. See https://android-review.googlesource.com/#/c/83299;
* Update other x86 headers from bionic for compatibility which are
required for successful build;
Change-Id: Ia66301849e699b79c657146424a806d0aa22342b
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
This change moves _types.h from common area to all 32-bits archs.
Required for successful NDK build.
Change-Id: Ife676a285f4b77aef4c33e465a0dbc7cab1481a3
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Define __PTHREAD_MUTEX_INIT_VALUE, __PTHREAD_RECURSIVE_MUTEX_INIT_VALUE,
and __PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE in pthread.h for API < 9.
Pthread.h in API >= 9 have those already since bionic
9831ad3ce6bd5b22da16a275ed67e7236eae3d1f
Change-Id: Ia97960ecbfed0811dde70f75cb23951ecdf803af
1. Fixed missing #include <sys/types.h> in android/asset_manager.h for API >= 13
2. Fixed missing #include <stdint.h> in android/rect_manager.h for API >= 14
3. Added JNICALL to JNI_OnLoad and JNI_OnUnload in jni.h
Change-Id: I875ec0b6e6f7c2f433c176f0a738eb78f3c33062
Similar to clang 3.3, it seems that clang 3.4 declares an incompatible
function prototypes for __builtin_isnan(). To workaround this issue,
we should not declare the function prototype for __builtin_isnan().
Note: Though it may be good to fix this in clang type checker, like
__builtin_nexttoward(), however it seems non-trivial since __builtin_isnsn()
might be overloaded. We can revert this after we have fixed the
clang builtin definition.
Change-Id: I329b56225f3d229b0c141bb8414c4369f154efda
wait4() was incorrectly declared in <sys/wait.h>, but only added to the
C library in Android 4.3 (API level 18) [1]
This patch:
- Removes the wait4() declarations for any <sys/wait.h> header before
API level 19.
- Brings the API level 19 <sys/wait.h> which correctly declares wait4().
- Update the libc.so.functions.txt for API level 19 of all platforms
to include the exported symbol.
NOTE: This does not bring the static libc.a to API level 19, which means
it is stuck at API level 9 for ARM.
See [2] for the corresponding NDK tests.
http://b.android.com/19854
[1] 17a8b0db63
[2] https://android-review.googlesource.com/#/c/72000/
Change-Id: I7735473d177c44f43b09bb6738e9914945cd4d0a
In armeabi-v7a, VM still expects JNI functions to follow soft-abi.
Annotate it with __NDK_FPABI__ so compiler follows soft-abi in JNI
functions regardless the presence of -mhard-float in command-line.
It's up to developer to apply JNICALL consistently on JNI functions,
ie. those functions whose first arg has type "JNIEnv*" is likely to be
Change-Id: Ica7cca8ab9498ce00de6ffc7fff35f8cc13aedbf
Annotate __builtin math functions with __NDK_FPABI_MATH__ too.
1. __attribute__((pcs("aapcs"))) has no effect on codegen when __buitlin
function is emitted inlined.
2. When __builtin call into regular function in Android's libm, it has
proper attribute which observes soft float-abi
Change-Id: I11e8b74fc22f3072b9ce849193e4a56e98c92d64
from poll(struct pollfd *, nfds_t, long) to
poll(struct pollfd *, nfds_t, int)
See 11952073af22568bba0b661f7a9d4402c443a888
and ebfbb367fb
Change-Id: Idba600d4b172404f0a1d5d715febcba8a495a770