Commit Graph

80 Commits

Author SHA1 Message Date
Andrew Hsieh
09073f3d88 Add minimal supports to build multilib x86 toolchain with OpenMP
Change-Id: I095c15d2a2de11992890c2a03be0f90332d372de
2013-08-02 17:06:40 +08:00
Andrew Hsieh
65675341ac Add TCP_INFO state enum values.
See b.android.com/38881 and fix in bionic
0dff43cab41e4a0bd5bd018584952c68cb224977

Change-Id: I2417fe3cf43919bf363f36c337ea6813f13699d8
2013-07-29 20:15:57 -07: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
56de69b35b Merge "ndk: <sys/cdefs.h>: make wchar_t 32-bit for all API levels." 2013-07-08 22:59:16 +00:00
David 'Digit' Turner
f85e243cdb ndk: <sys/cdefs.h>: make wchar_t 32-bit for all API levels.
This patch ensures that wchar_t is a 32-bit number when targetting
API level < 9 (i.e. Froyo or older).

You can restore the previous (and broken) behaviour by defining
_WCHAR_IS_8BIT at compile time. See http://b.android.com/57267
for more context.

BUG=57267

Change-Id: Ib334e8fe95a3f592d5d4bb157b0f123984133597
2013-07-04 16:30:41 +02:00
David 'Digit' Turner
530a3ca575 Fix <inttypes.h> declaration for pointer-related PRI/SCN macros.
This ports the following Bionic libc fix to the NDK header:

  https://android-review.googlesource.com/#/c/61703/2

BUG=57218

Change-Id: I0c5fef17f0c1bb3a89c00edf51f494cbf7bda435
2013-07-03 15:13:49 +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
9100913446 Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)" 2013-06-19 20:30:02 +00:00
David 'Digit' Turner
bb37dac9fa Fix malloc_usable_size() declaration.
This doesn't break the ABI.

See https://android-review.googlesource.com/#/c/59195 for corresponding
fix in the C library.

See http://b.android.com/55725 for details.

Change-Id: Id01e38ef7951368897b9bbaae09741fa927fd548
2013-05-23 10:08:44 +02:00
Andrew Hsieh
3c10a2037e Fix sys/un.h to be included on its own
See https://code.google.com/p/android/issues/detail?id=53711
https://android-review.googlesource.com/#/c/42763

Change-Id: Ibd8a445dfde752cddab61b3ae53ad077738701ea
2013-04-01 14:02:06 +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
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
Sergey Melnikov
e3b1ac14bd stdint.h header is not fully compatible with C99(ISO9899:1999)
1. stdint.h doesn't provide macros:
  * SIG_ATOMIC_MIN
  * SIG_ATOMIC_MAX
  * WCHAR_MIN
  * WCHAR_MAX
  * WINT_MIN
  * WINT_MAX
2. stdint.h provides macros with incorrect type:
  * UINT8_C
  * UINT16_C
  * UINT8_MAX
  * UINT16_MAX

Change-Id: I3f4da907eaee8f46d8eb956950230ca2eb04a3ea
Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
2013-01-17 09:58:16 +04: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