Commit Graph

69 Commits

Author SHA1 Message Date
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
c4e201a35c Added struct Elf32_auxv_t and Elf64_auxv_t
See https://code.google.com/p/android/issues/detail?id=38441

Change-Id: If06ec47d4e15639461c044248e3fe0020748b305
2013-03-13 19:21:56 -07:00
Andrew Hsieh
bbff7fbd64 Sync stddef.h
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
2013-01-09 17:33:13 +08:00
Andrew Hsieh
8e84a15fed Merge "Sync sys/limits.h and sys/sysconf.h" 2013-01-03 10:34:13 -08:00
Andrew Hsieh
75d889ea23 Sync sys/limits.h and sys/sysconf.h
See http://code.google.com/p/android/issues/detail?id=39680
and a55f63083fb16b2595f517a3260083e5f8cddd02

Change-Id: I2d1548814eb771c26b540f5fee57dabf54fcfdd6
2013-01-03 12:28:48 +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
7c9e2c6851 Fix wint_t in android-3 and android-8 to be consistent with android-9
Change-Id: Ia36557bfc6d1155ba8106c26bb3fd3c226ad779e
2012-12-24 14:14:55 +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
ab13dd0e7a Fix <endian.h> and <sys/endian.h>
See 4fa35d8ae80c175425e9525831d7b6a71a3ada60

Change-Id: Ia14386f2e762fd7c0a1fc8f3e7cf8c0ce05b1dd5
2012-12-12 10:04:53 +08:00
Andrew Hsieh
aa33ae38ae Merge "Refresh endian.h" 2012-12-05 21:28:13 -08:00
Andrew Hsieh
ef48154850 Fix a ENOTUP/ENOTSUP typo
See ecb53eab4b63a777c189f880e7f88ebbe0e8101b

Change-Id: Id0cd72f3ccc6e4ecb1bd57045e2f46be234378fa
2012-12-05 13:05:15 +08:00
Andrew Hsieh
7361c3c7bb Refresh endian.h
See http://code.google.com/p/android/issues/detail?id=39824
and b15c58bb0fe55f076751acd7a5d00ded0ec33963

Change-Id: I71858f6d15adb688e0b05685e55582f0f1ddae54
2012-12-05 12:42:18 +08:00
Andrew Hsieh
279fe064b1 Refresh header byteswap.h and dirent.h
Sync with bionic.  No new APIs.

Change-Id: Ie1f71d1c56ce2d0574d8b743f205115d2fbc68b4
2012-11-21 14:17:01 +08:00
Andrew Hsieh
2eb9332422 Fix limits.h to include page.h which provides PAGE_SIZE
See 6331db3fd251ddc350913cc1e8a7941740c25f63 and
http://code.google.com/p/android/issues/detail?id=39983

Change-Id: I85083d754fe9b722efcb8ea73f17d88d505c90d1
2012-11-20 16:14:06 +08:00
David 'Digit' Turner
db5a5ada90 ndk: Remove LONG_LONG_MIN/MAX hack from pthread.h
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
2012-10-16 09:49:10 +02:00
Andrew Hsieh
36ffaf5406 Replace __unused in linux/sysctl.h with __linux_unused
To avoid conflict with "#define __unused" in sys/cdefs.h

See
  https://android-review.googlesource.com/#/c/43479
  https://android-review.googlesource.com/#/c/43565

Change-Id: I6b8155570f4398b3ee8845d75bd231bca7f1d86f
2012-09-26 15:11:39 -07:00
Andrew Hsieh
c6427a73a2 Update NDK headers
Sync NDK headers with bionic's.  Most are new symbols.
The only big differences are in arch-mips/include/asm:

1) arch-mips/include/asm/unistd.h, see
   https://android-review.googlesource.com/#/c/40875
2) arch-mips/include/asm/*, see
   https://android-review.googlesource.com/#/c/43335
   https://android-review.googlesource.com/#/c/43440
   https://android-review.googlesource.com/#/c/43401

Change-Id: I8204f9b5f2f2c14a31dc28efc8a9d8c66cf73fe2
2012-09-24 12:31:43 -07:00
Andrew Hsieh
d0b834c7ad Rewrite ARM crtbegin* as C files
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
2012-09-06 15:27:56 +08:00
Andrew Hsieh
a2b32b3422 Merge "Update malloc.h" 2012-08-22 01:08:42 -07:00
Andrew Hsieh
58a4918b94 Update malloc.h
Remove functions never implemented in bionic from malloc.h

Related CLs:
  https://android-review.googlesource.com/#/c/41728
  https://android-review.googlesource.com/#/c/41731
  https://android-review.googlesource.com/#/c/41717

Change-Id: I06639071e3fb442e2389a932382a88a7318606b9
2012-08-21 18:18:00 +08:00
Andrew Hsieh
a5280d312d Enclosed functions in fenv.h with __BEGIN_DECLS/__END_DECLS
Those are C funcitons

Change-Id: I8f481f29b278b8f28d9ce04635d0f04e9e148cb5
2012-08-21 10:41:51 +08:00
Andrew Hsieh
7f26cea904 Merge "Update stdint.h; Refresh <arch>/include/machine/* stdint.h: https://android-review.googlesource.com/#/c/41714/ https://android-review.googlesource.com/#/c/40576/ <arch>/include/machine/*: to be consistent with bionic/libc/<arch>/include/machine/*" 2012-08-20 05:22:01 -07:00
Andrew Hsieh
e33ad3528d Merge "Remove linux-unistd.h" 2012-08-20 05:21:26 -07:00
Andrew Hsieh
61a3e1462c Update stdint.h; Refresh <arch>/include/machine/*
stdint.h: https://android-review.googlesource.com/#/c/41714/
            https://android-review.googlesource.com/#/c/40576/
  <arch>/include/machine/*: to be consistent with
     bionic/libc/<arch>/include/machine/*

Change-Id: Ieeb44c3e864bf64c4cad4d3c9d94024a7b520181
2012-08-20 18:32:15 +08:00
Pavel Chupin
51d4794277 Replace link.h for mips with new version for all platforms
Update from bionic/libc/include/link.h
For details see https://android-review.googlesource.com/#/c/41705

Change-Id: Ib9e658aa0606584b148e951ad199dc12c2f563c2
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2012-08-20 10:48:23 +04:00
Andrew Hsieh
7de8e93107 Remove linux-unistd.h
Change-Id: I95cc89bfacb05d92da658fa533cb75ac65d397bf
2012-08-18 16:08:51 +08:00
Andrew Hsieh
8bb4fd7683 Update/Copy fenv.h
Update from bionic/libm/arm/fenv.h
Copy from bionic/libm/mips/fenv.h

Related issue:
  http://code.google.com/p/android/issues/detail?id=36229

Change-Id: I4cba9523ecc466720927798e461fc167d6d6df7c
2012-08-17 19:02:58 +08:00
Andrew Hsieh
e395327a7c Add comments about why "call" instead of "jump" is used.
Related CL: https://android-review.googlesource.com/#/c/38651

Change-Id: I425e06f08fda90501a686c7e437d4e70fc1e4a1b
2012-07-25 15:39:00 -07:00
Andrew Hsieh
556182feb4 Fix SEGV when unwinding stack pasts __libc_init
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
2012-06-28 14:28:21 -07:00
Andrew Hsieh
62ef547786 ndk: Remove if_dl.h header
Remove AF_LINK and sockaddr_dl which are specpfic to BSD
(ie. doesn't exist in Linux)

Change-Id: I47fe4cdf76df14af99eaa17cfc366a65aee3f5ae
2012-06-12 10:38:00 +08:00
David 'Digit' Turner
5e7c4e6a57 ndk: Remove prebuilt C runtime objects. Add sources instead.
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=26911
http://code.google.com/p/android/issues/detail?id=23203
2012-05-31 10:58:57 +02:00
David 'Digit' Turner
ef0d31ec73 ndk: <signal.h>: Increase _NSIG definition to 64
This is a minor update to this NDK header to better match the upstream definition.
2012-04-02 18:03:00 +08:00
David 'Digit' Turner
015d0543d2 ndk: <pthread.h>: formatting + updates
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
2012-04-02 17:59:26 +08:00
David 'Digit' Turner
002d5366b6 ndk: <unistd.h>: minor cleanup
- 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
2012-04-02 17:54:27 +08:00
David 'Digit' Turner
3da072d28f ndk: <sys/cdefs.h> minor update
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)
2012-04-02 17:41:16 +08:00
David 'Digit' Turner
1fe0de682b ndk: minor header update
<net/ethernet.h>: new header
<netdb.h>: add EAI_ADDRFAMILY definition
2012-04-02 16:07:07 +08:00
David 'Digit' Turner
f4e62ff4a3 ndk: Fix ipv6 related headers
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>
2012-04-02 16:04:42 +08:00
David 'Digit' Turner
6c32dacf97 ndk: Fix <sys/atomics.h> declarations.
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.
2012-04-02 15:59:46 +08:00
David 'Digit' Turner
5704b40d70 ndk: minor update to <netinet/...> headers.
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.
2012-04-02 15:31:20 +08:00
David 'Digit' Turner
554c5eca78 ndk: libc: Add RLIM_RTTIME to <asm-generic/resource.h>
This is a back-port of a fix that was performed in 4.0.1 to all previous platforms.
2012-04-02 15:14:10 +08:00
David 'Digit' Turner
34c6c855bc ndk: arm: Update <asm/ptrace.h> and <asm/user.h>
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'
2012-04-02 15:11:02 +08:00
Martin Storsjo
6dd4b91b32 Make sure __u64 is defined even for strict ansi or -std=c99
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.
2012-01-27 17:54:02 +02:00
David 'Digit' Turner
7761beeb56 ndk: <time.h> Add missing clock_settime()/clock_nanosleep() declarations
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
2011-10-12 03:43:29 +02:00
David 'Digit' Turner
085e2b14d5 ndk: remove obsolete libthread_db.a binaries
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
2011-10-12 03:07:48 +02:00
David 'Digit' Turner
c63ce7a143 ndk: remove obsolete <android/api-level.h> headers
These are now auto-generated by the gen-platforms.sh NDK script

Change-Id: I5a38e956b58a34c5db96e24f2a46bc1ca1554376
2011-10-12 03:07:48 +02:00
David 'Digit' Turner
e872f4e101 ndk: Remove obsolete platform files
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
2011-10-10 21:52:17 +02:00
David 'Digit' Turner
02053eb7a1 ndk: separate functions and variables symbol lists
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
2011-10-10 21:52:09 +02:00
David 'Digit' Turner
bb3784d646 ndk: update JNIEXPORT declaration in <jni.h>
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
2011-08-23 16:08:17 +02:00