Commit Graph

167 Commits

Author SHA1 Message Date
Pavel Chupin
fa5250051f Fix x86_64 alignment in crtbegin
Sync from bionic

Change-Id: Ic2b5f1cf87c4c89f75571f76b6a078990bfcb1e4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-03-21 15:23:07 +04:00
Andrew Hsieh
884081d929 Fix MIPS' struct stat
In NDK r9c MIPS' struct stat was incorrectly set to its 64-bit
counterpart for API >= 12

Change-Id: I75db78ac7654fad982430e6adbe4480828776051
2014-02-20 07:56:38 +08:00
Andrew Hsieh
2643554fa0 Move sys/cachectl.h up from mips-specific folder
It is only effective when compile with mips, although
development no longer has to check themselves

Change-Id: I7fb703170e1cc6bb2e6ea31109851a90a26eacb8
2014-02-10 09:28:47 +08:00
Andrew Hsieh
f0387da709 Merge "Rename arch-aarch64 to arch-arm64" 2014-02-06 22:57:34 +00:00
David Friedman
3b601c6550 Fixed apparent copy/paste mistake
Bug: 11634373

Change-Id: I44766217f414988bfd3be68043a4b80dd21554d8
2014-02-05 11:18:32 +08:00
Andrew Hsieh
4618dc6c2a Rename arch-aarch64 to arch-arm64
Build instruction:
  ./build/tools/download-toolchain-sources.sh /tmp/ndk-$USER/src
  ./build/tools/gen-platforms.sh --minimal --dst-dir=$NDK \
     --ndk-dir=$NDK --overlay --arch=arm64
  ./build/tools/build-gcc.sh /tmp/ndk-$USER/src $NDK \
     aarch64-linux-android-4.8 --try-64

Change-Id: Ieaac9908cd2121981e257113cb8d5d3575c8718e
2014-02-04 17:36:55 +08:00
Andrew Hsieh
ca34e29d94 Merge "Fix headers to be inclued alone" 2014-01-16 17:03:03 +00:00
Andrew Hsieh
42bb3bcadc Merge "Fix typo in comments in looper.h" 2014-01-16 17:02:47 +00:00
Andrew Hsieh
2c8776805a Fix headers to be inclued alone
See b.android.com/64679 for one of header sys/prctl.h

Change-Id: Ie415ebe2086d2f0190d84fba0c57cc7e1e5822ae
2014-01-13 12:58:46 +08:00
Andrew Hsieh
d980848377 Fix typo in comments in looper.h
Remove android-13's looper.h because it's identical to android-9's
Note that ndk/platforms/android-N only keep delta to previous level

Change-Id: Ibd2c3e168cfe7f6902fdc6eca2e2778d8ccf1fac
2014-01-08 17:24:22 +08:00
Andrew Hsieh
7e25851a68 Implement wait4 already exist in header
1. Implement wait4 by calling __wait4 exists in libc.so
2. Add wait4 to libc.a

Change-Id: I08b6555cc50ee88358cd2ec63f9d8d2d4482305a
2013-12-30 11:57:38 +08:00
Logan Chien
ad40d952a1 Workaround the __builtin_isnan() type error for clang 3.4.
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
2013-12-25 01:59:29 +00:00
David 'Digit' Turner
db275132c5 ndk: Fix wait4() declarations
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
2013-12-11 17:23:46 +01:00
Andrew Hsieh
2a571fda2b Fix -mhard-float for calling __builtin_* math functions
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
2013-12-04 11:45:04 +08:00
Andrew Hsieh
d0b6889fd1 Merge "<pthread.h>: Mark pthread_exit() as __noreturn" 2013-11-05 00:40:09 +00:00
Andrew Hsieh
a915811733 Remove obsolete ndk/platforms/android-9/arch-x86/src/__dso_handle*.S
Superceded by __dso_handle.h

Change-Id: Ic224b8a1ed74a9535ae9f8814f3450cb4f92efb6
2013-11-04 10:42:21 +08:00
Andrew Hsieh
effaa95815 <pthread.h>: Mark pthread_exit() as __noreturn
Same fix as https://android-review.googlesource.com/#/c/67540/
Fix for: https://code.google.com/p/android/issues/detail?id=60686

Change-Id: I27b8f1ed71dbb44f3598f7f4551bd881754ef945
2013-11-04 10:37:50 +08:00
David 'Digit' Turner
82703204a9 ndk: Add missing declaration for mkdtemp
The mkdtemp() function has always been implemented in the C library
(see [1] for proof) but was missing a declaration in <stdlib.h>, until
Android 4.0.1 [2]

This patch simply adds the missing declaration to former <stdlib.h>
versions. This makes it easier to build certain open-source programs
for Android, because auto-tools probing typically looks at the symbols
in libc.so to define HAVE_MKDTEMP, then the source fails to compile
because of the lack of declaration.

Note that the mkdtemp is also already listed in
platforms/android-*/arch-*/symbols/libc.so.functions.txt, which were
generated by parsing actual system libraries, and thus don't need to
be updated here.

[1] https://android.googlesource.com/platform/bionic/+/android-1.6_r1/libc/stdio/mktemp.c
    https://android.googlesource.com/platform/bionic/+/android-1.6_r1/libc/Android.mk

[2] ad1ff2fb26

Change-Id: I838b54bcb5cbfd2fed24cf7649897889ec7a5559
2013-10-28 18:46:54 +01:00
Ben Cheng
2e2d9927e5 Refresh sysroot headers for aarch64.
Change-Id: I2443ff351aec5d558cb7843885e5b3f8177527e8
2013-10-17 14:07:49 -07:00
Andrew Hsieh
5881b5cbe7 Add __NDK_FPABI__ to function taking/returning float/double
Allow user code to be compiled with "-mhard-float" for armeabi-v7a
(which implies -mfloat-abi=hard), and either link with
1. Android native APIs which use softfp, or
2. A customized libm_hard.a which is compiled with -mhard-float. Need
   -D_NDK_MATH_NO_SOFTFP=1

See tests/device/hard-float/jni/Android.mk for details and restriction
on Clang

Change-Id: I773a842c73368e08b9a6cda0441e95a96fa303b2
2013-10-17 19:15:22 +08:00
Andrew Hsieh
a36935be21 Merge "Add missing math functions" 2013-10-17 10:54:18 +00:00
Andrew Hsieh
e3f5a9c5dd Merge "Update libandroid.so for API9 .. API18" 2013-10-17 00:27:47 +00:00
Ben Cheng
bfd1ec82b4 Merge "Use updated uapi headers for aarch64." 2013-10-17 00:27:11 +00:00
Ben Cheng
6570d523c4 Use updated uapi headers for aarch64.
Change-Id: I6093b3908f26842524acd5ba845e083b8ad6a888
2013-10-16 17:24:18 -07:00
Andrew Hsieh
0df3e70b99 Add missing math functions
1. Add sincos, sincosf, and sincosl to API >= 9 (for ARM only,
   because X86 and MIPS have it already)
2. Add nan, nanf, nanl, and tgammaf to API >= 13 (11 actually,
   but we don't want to add another API which is not released)
3. Add log2, log2f, log2l, logbl, nexttoward, and nexttowardl to
   API >= 18

See b.android.com/38423

Change-Id: I0a756aeeddafc3862f3c0ae38218cb3301608231
2013-10-15 15:55:12 +08:00
Andrew Hsieh
0c147ba2dc Update libandroid.so for API9 .. API18
This CL update library.  See
f3c3a93bc4 for API13..18 header update

Add functions:

android-9:
  AMotionEvent_getHistoricalRawX
  AMotionEvent_getHistoricalRawY
  AMotionEvent_getHistoricalTouchMajor
  AMotionEvent_getHistoricalTouchMinor
  AMotionEvent_getHistoricalToolMajor
  AMotionEvent_getHistoricalToolMinor
  AMotionEvent_getHistoricalOrientation

android-13:
  AAsset_seek64
  AAsset_getLength64
  AAsset_getRemainingLength64
  AAsset_openFileDescriptor64
  AConfiguration_getScreenWidthDp
  AConfiguration_setScreenWidthDp
  AConfiguration_getScreenHeightDp
  AConfiguration_setScreenHeightDp
  AConfiguration_getSmallestScreenWidthDp
  AConfiguration_setSmallestScreenWidthDp
  AMotionEvent_getAxisValue
  AMotionEvent_getHistoricalAxisValue
  ANativeWindow_fromSurfaceTexture (removed in >=API16)
  android_getTtsEngine
  getTtsEngine

android-14:
  AMotionEvent_getButtonState
  AMotionEvent_getToolType

android-15:
  << none >>

android-16:
  Remove ANativeWindow_fromSurfaceTexture

android-17:
  AConfiguration_getLayoutDirection
  AConfiguration_setLayoutDirection

android-18:
  << none >>

Also
  1. remove android-16/include/android/native_activity.h which is the
     same as android-13's
  2. fix input.h comments and missing args, same as
     9d0136004f for android-9
  3. sort android-9's libandroid.so.functions.txt for easier comparison

See https://code.google.com/p/android/issues/detail?id=47150
    https://code.google.com/p/android/issues/detail?id=58528

Change-Id: Iaa88fe45d188482fd0905ca54180c635ab02dd95
2013-10-14 18:44:24 +08:00
Andrew Hsieh
dc5ecc7e3e Add arch-mips64 symlink
To build mips64el-linux-android-4.8
eg.
  ./build/tools/gen-platforms.sh --minimal --dst-dir=$NDK --ndk-dir=$NDK --overlay --arch=mips64
  ./build/tools/build-gcc.sh /tmp/ndk-$USER/src $NDK mips64el-linux-android-4.8 \
     --with-python=prebuilt --try-64

Change-Id: Ia1d4e12db2da18b1a20bcb00e754c23d8b5ba990
ToDo: Need to update platforms/android-9/arch-mips/src/crt*
2013-10-14 13:46:57 +08:00
Ben Cheng
6972ffa798 Merge "Initial set of minimal sysroot headers to build aarch64-gcc." 2013-10-08 23:50:05 +00:00
Ben Cheng
032d79d013 Initial set of minimal sysroot headers to build aarch64-gcc.
These files are copied over from arch-arm and to be used as boilerplates
only for now.

Change-Id: I61662e4fb9b7582174ef806e5d7eb8ed28e3a1f6
2013-10-08 15:48:50 -07:00
Andrew Hsieh
16af6afb9a Refresh include/sys/vfs.h
1. Sync bionic's, remove mips-specific one
2. Fix statfs.c to transfer the new f_flags too
3. Revise comment about --wrap=symbol

Change-Id: If68818e3dcb2a4056cd0b2e100fcfb8b2156c33a
2013-10-07 15:39:47 +08:00
Andrew Hsieh
f43a290c1b Update mips crtfiles from bionic with C versions
Copied from bionic but adding back .ctors and .dtors to be
compatible with old Android system linkers.  Otherwise
static executable may segfault.

Change-Id: If834123161744cd2387a2c031a2315e818c2f123
2013-08-05 14:21:06 +08:00
Andrew Hsieh
aecb5c6d65 Add boostrap lib to build multilib x86 GCC with OpenMP support
Build instructions:

  cd AOSP=<your-AOSP-path>
  cd $AOSP/bionic/libc
  ln -s arch-x86 arch-x86_64

  export NDK=$AOSP/ndk
  cd $NDK
  ./build/tools/gen-platforms.sh --dst-dir=$NDK --ndk-dir=$NDK --overlay --arch=x86_64

  # copy $NDK/platforms/android-9/arch-x86_64/usr/lib, lib64, and libx32 over

Change-Id: I021a34fa139456540bc0afdb1d9636df165f92fe
2013-08-02 14:34:01 +08:00
Pavel Chupin
e5c9f8ec5a Update x86 crtfiles from bionic with C versions
Files are copied as is from bionic head.
Also adding arch-x86_64 symlink to be able to generate arch-x86_64
crtfiles/libs.

Change-Id: I0b40c1c19bb4e3b24b25fa2bcb9236469fa32a3e
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-07-25 20:55:38 +04:00
David 'Digit' Turner
fe8625d401 ndk: Fix WCHAR_MIN / WCHAR_MAX definitions.
This fixes WCHAR_MIN / WCHAR_MAX to be signed / unsigned based on
the target ABI.

This only impacts ARM where wchar_t is really 'unsigned int'.
One can define _WCHAR_IS_ALWAYS_SIGNED to restore the old behaviour.

See http://b.android.com/55749

Change-Id: Idb63b7b11aecd3cfee37f5b6dd2eba78b308876f
2013-07-20 00:56:53 +02:00
Andrew Hsieh
f56a37e539 Fix wchar.h not to redefine WCHAR_MAX/WCHAR_MIN
Change-Id: I6c6f2e020b72cce4c8665133ea0a0c5db977e348
2013-06-21 11:11:35 -07:00
Andrew Hsieh
d166ec49f9 Add clone in x86
clone is already declared in header and exists in both arm/mips libc.
Add the missing one in libc.so and libc.a (*1) for x86.

(*) only updated bionic_clone.o and clone.o from build after
22d366cc09383956dc264ed4641572e609392eee

Change-Id: Ibcb39948d48b84398543d84304ead21dab534c40
2013-06-19 18:02:20 -07:00
Andrew Hsieh
5b1e1adadc Fix AMotionEvent_getHistorical* to take const AInputEvent* motion_event
See b.android.com/55873

Change-Id: I5ad9160ff286c291feece2deda647af66e251bb5
2013-05-27 12:12:53 +08:00
Andrew Hsieh
25c7f95934 Fix x86 endian.h
See https://code.google.com/p/android/issues/detail?id=54465
and https://android-review.googlesource.com/#/c/57242

Change-Id: Ib61fc0696e4979421f9bc6916c776a41fdc8be71
2013-04-22 11:25:41 +08:00
Andrew Hsieh
3ccf4f2c03 Deprecate __set_errno; Add #include <stdint.h> in elf.h
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
2013-03-27 10:44:19 -07:00
Andrew Hsieh
228a227967 Fix X86 sigsetjmp and siglongjmp
Both exist in header android-X/arch-<arch>/usr/include/setjmp.h
already.  Add to X86 to be consistent with header and other archs
ARM/MIPS

See https://code.google.com/p/android/issues/detail?id=19851

Change-Id: I635c6c0491f5bf2aaa9013f23cb4b1bf7cb57a40
2013-03-14 14:40:37 -07:00
Andrew Hsieh
1d1bc5287d Fix OpenSLES_AndroidConfiguration.h to be usable for C code
See https://code.google.com/p/android/issues/detail?id=53163

Change-Id: I0eaa3f93860134daf7d589696e47828166fbc899
2013-03-14 10:33:15 -07:00
Andrew Hsieh
c21a505044 Fix warnings in sample detected by NDK_ANALYZE=1
Change-Id: I999a96fb3de5225adde91eb014170ffd7b6092f6
2013-02-01 11:14:28 -08:00
Andrew Hsieh
253d234a29 Sync MIPS fenv.h
See d199017101dd124204fb949e46adb68a43e4785b

Change-Id: I657a8a4df26868bcf9cdab0dc0063c56bc085a85
2013-01-08 10:59:06 +08:00
Andrew Hsieh
d693e84421 Sync fenv.h
See See 0f7809d5c364565e210554ca2b5d8eedf8a57ec7
90e10d41c4271a5d517f60f4ff1d2891b8ccc034

Change-Id: Id59b6c24f74f03f7d4b0c420fdb59fb2ab98be0d
2013-01-03 12:12:39 +08:00
Andrew Hsieh
54e2794aba Add binaries to bootstrap GCC build with OpenMP
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
2012-12-26 15:11:56 +08:00
Andrew Hsieh
7980acf254 Remove duplicated definitions of size_t and ssize_t
See 3975cec694a0c9b42e3f7e671fcd678da92836c3

Change-Id: Ia40ff8de3ffe923fb983bb116b740942724c641a
2012-12-21 22:29:26 +08:00
Andrew Hsieh
9ca4e48605 Sync pthread.h and resolv.h
See 9831ad3ce6bd5b22da16a275ed67e7236eae3d1f and
23d3e6b21b4b6debff87da8c6558495e564cc38e

Change-Id: I22c7bbda1cd763e5f67410cc2e4054292e71af04
2012-12-20 19:08:54 +08:00
Andrew Hsieh
e4b3c7a31d Merge "Correct typo" 2012-12-12 15:02:04 -08:00
Andrew Hsieh
d30385fc7c Correct typo
Change-Id: I150ee24f93d1a4fe16de938dafb335a9f1a171b0
2012-12-12 10:34:21 +08:00
Andrew Hsieh
ab13dd0e7a Fix <endian.h> and <sys/endian.h>
See 4fa35d8ae80c175425e9525831d7b6a71a3ada60

Change-Id: Ia14386f2e762fd7c0a1fc8f3e7cf8c0ce05b1dd5
2012-12-12 10:04:53 +08:00