Commit graph

7633 commits

Author SHA1 Message Date
Treehugger Robot
572791e027 Merge changes Id513b72a,I92cd0116,I62393b58,I90ac2224,I527f88ac
* changes:
  Provide fake definitions for libstdc++.
  Provide static inlines for in6addr things.
  Provide an inline __cmsg_nxthdr.
  Correct more fortify availability guards.
  Move strncpy fortify into android-21.
2016-09-09 01:13:27 +00:00
Dan Albert
cb0b14385b Provide fake definitions for libstdc++.
libstdc++ needs to be able to `using ::foo` these in the various C++
wrapper headers for the C library. The NDK long ago added fake
definitions. We need to keep the same.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: Id513b72a59eafcc823080631e07b21290d5e3b24
2016-09-08 16:13:28 -07:00
Dan Albert
69b26542de Provide static inlines for in6addr things.
mdnsresponder needs these and is built against a very old API level
since it is used in gmscore. The legacy NDK headers defined these
inline.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I92cd0116b3bde47e748ba648eaba94a7a3e3523e
2016-09-08 16:13:28 -07:00
Dan Albert
11f0e10c49 Provide an inline __cmsg_nxthdr.
This was defined as an inline in the legacy NDK headers. Keep that
here until we can get it into libandroid_support.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I62393b58e4fba3bc7337cc5ecf4ae1590b0e9917
2016-09-08 16:13:28 -07:00
Dan Albert
2990404206 Correct more fortify availability guards.
Test: make checkbuild
Bug: http://b/30465923
Change-Id: I90ac222483ecd39f1e7cc358babfb64e305cffcb
2016-09-08 16:13:27 -07:00
Elliott Hughes
2fc14a97e0 Don't use an anonymous label in arm's __bionic_clone.
All the other architectures name this label. Copy them.

(Following discussion of d30bc9e74b8ff3afceac973d334023564e64dbd2.)

Bug: https://llvm.org/bugs/show_bug.cgi?id=30308
Change-Id: I4f20163f569041180d87c79ce6ed856b70704271
2016-09-08 14:11:28 -07:00
Dan Albert
e5dd632e43 Move strncpy fortify into android-21.
__strncpy_chk2 wasn't added until android-21.

Test: make checkbuild
Bug: None
Change-Id: I527f88aca55ef5010e12ece18abbdce3d54ce252
2016-09-08 13:08:47 -07:00
Josh Gao
3afa18104b Merge "versioner: add support for __VERSIONER_NO_GUARD." 2016-09-08 18:48:52 +00:00
Josh Gao
fff29fe17a versioner: add support for __VERSIONER_NO_GUARD.
Add an attribute that tells the preprocessor not to guard a
declaration, primarily for use with symbols that get reexported by
libc++ of the form `namespace std { using ::wctrans; }`.

Bug: http://b/28178111
Change-Id: I08c8751214797e37e8f26e7f7416a19e81c2bb4c
2016-09-07 18:34:39 -07:00
Elliott Hughes
7f0849fd11 Fix sscanf/wcstod parsing of NaNs.
The parsefloat routines -- which let us pass NaNs and infinities on to
strto(f|d|ld) -- come from NetBSD.

Also fix LP64's strtold to return a NaN, and fix all the architectures
to return quiet NaNs.

Also fix wcstof/wcstod/wcstold to use parsefloat so they support hex
floats.

Lots of new tests.

Bug: http://b/31101647
Change-Id: Id7d46ac2d8acb8770b5e8c445e87cfabfde6f111
2016-09-07 15:01:54 -07:00
Tamas Berghammer
4bef28161f Fix unittests broken by 545808a
Change-Id: I590af5958e4dcb772b710be965ed6c99cd1d9234
2016-09-07 16:12:02 +01:00
MinSeong Kim
d30bc9e74b Fix "Unknown token error" when upstream clang is used.
Simple fix for the above error caused by the location
of a label "1:"

Change-Id: I9b1c816871e95f9bcf8135a5e0cc88de65771315
Signed-off-by: MinSeong Kim <minseong.kim@linaro.org>
2016-09-06 05:59:55 +01:00
Josh Gao
b3fbee449c Revert "Update getentropy_linux.c from upstream."
This reverts commit 5faef47e43.

Bug: http://b/31251721
Change-Id: I20a091f385fb77ccc68b8d9fb1d2aee3dec0d0ff
2016-09-02 08:39:29 +00:00
Josh Gao
5faef47e43 Update getentropy_linux.c from upstream.
Bug: http://b/29622562
Change-Id: Ia65c038effa6e806c325a8e93c1fe80c50a9f2c9
2016-08-31 18:00:47 -07:00
Christopher Ferris
ac04d34573 Merge "Update to kernel headers v4.7.2." 2016-08-29 19:14:10 +00:00
Christopher Ferris
106b3a8a7d Update to kernel headers v4.7.2.
Modify the kernel header update script to rename C++ keyword
struct members to something else. This fixes problems when including
these kernel files in C++ code.

Also, make a manual change to linux/fib_rules.h and comment out the
value FRA_PAD since it conflicts with a special android kernel value
FRA_UID_START that has not been upstreamed yet.

Test: Built aosp_angler, aosp_x86_64, aosp_mips (bionic only)
Test: Booted on angler and ran bionic unit tests
Test: Built these changes in internal master

Change-Id: Ia22b7e3ca409404696dba76311f49157f4a9ceed
2016-08-29 12:07:13 -07:00
Dimitry Ivanov
864f3ec186 Initialize __abort_message_ptr in linker's copy of libc
The linker calls to __libc_fatal resulted in tombstones
with missing abort message. This commit fixes it by
initializing __abort_message_ptr for the linker's copy
of libc.

Bug: http://b/31095185
Change-Id: I883d654d7fd0ef309c80f8021202b6bfd5d5cea5
2016-08-26 17:03:01 -07:00
Christopher Ferris
0b1a282650 Merge "Fix a typo in the debug malloc usage info" 2016-08-26 17:58:10 +00:00
Treehugger Robot
6313116b74 Merge "Revert "Switch back to the BSD exec for now."" 2016-08-26 17:54:48 +00:00
Elliott Hughes
e19c672a06 Revert "Switch back to the BSD exec for now."
This reverts commit 18c31d7f4c.

63615066d9 fixed the bug.

Change-Id: I1d59c4be6ad1a05b23dce0198737f0789d7e034a
2016-08-26 16:15:57 +00:00
Elliott Hughes
6395a3047a Merge "Fix execvp/execvpe behavior with absolute paths and ENOEXEC." 2016-08-26 16:14:52 +00:00
Tamas Berghammer
545808a608 Fix a typo in the debug malloc usage info
Change-Id: I010fdc6c228a5f64edfef1c267cde7a2eef5190b
2016-08-26 12:34:16 +01:00
Elliott Hughes
63615066d9 Fix execvp/execvpe behavior with absolute paths and ENOEXEC.
Bug: http://b/31091962
Change-Id: Id0b3d41868f5e3ed1ccf618bfefb46609367bc9a
2016-08-25 17:40:27 -07:00
Elliott Hughes
18c31d7f4c Switch back to the BSD exec for now.
Bug: http://b/31091962
Change-Id: Ia155c4aa0d6db7b91d7486433c3c01a841b0e509
2016-08-25 17:25:31 -07:00
Elliott Hughes
3c1159024c Fix execvpe ENOEXEC behavior.
The special case for absolute paths wasn't handling ENOEXEC.

Also add more extensive tests for execvpe.

Also switch to manually doing the fork in ExecTestHelper::Run because
ASSERT_EXIT doesn't actually return, meaning we were only running the
first part of each test.

Bug: http://b/31073104
Change-Id: I7a4640afc6d290c51ba2e66fc1b9bb6b0fc174f7
2016-08-24 22:56:52 -07:00
Treehugger Robot
fac56897f8 Merge "Rewrite the exec family." 2016-08-24 21:21:43 +00:00
Elliott Hughes
1b40aafe3f Rewrite the exec family.
* Removes duplication.
* Removes fixed PATH_MAX limit.
* Adds basic tests.

Bug: http://b/30032507
Change-Id: I4087a9de3e53884ac3297ebafbec4e6f8a9871b6
2016-08-24 13:03:04 -07:00
Elliott Hughes
723a2e6d78 Merge "Fix mips build."
am: 685ed4467c

Change-Id: If3bc475a3397c79ba1b7583110eb92b3c1ff8ba7
2016-08-19 02:44:09 +00:00
Elliott Hughes
1878ea08de Fix mips build.
Tests still pass on arm/aarch64/x86/x86-64.

Change-Id: I6a17b5bca356dbc7273b5427c68d538c0dd6deed
2016-08-18 18:25:07 -07:00
Elliott Hughes
a0a3a8c3b6 Merge "Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>."
am: 7d4e28a486

Change-Id: Idbf296a5a4342b4a9816f6cd3a4db896a80854a5
2016-08-19 00:03:27 +00:00
Elliott Hughes
7d4e28a486 Merge "Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>." 2016-08-18 23:58:43 +00:00
Elliott Hughes
7c59f3f6f3 Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>.
Also fix <sys/ipc.h>.

Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.

x86 -- which works differently to everything else -- tested on the host.

Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
2016-08-18 15:23:38 -07:00
Elliott Hughes
4321522b66 Merge "Be more restrictive about max frame size."
am: a6b73d36ef

Change-Id: I635cae0c7147aad3d6e6a36e889ddc90e1db44d6
2016-08-17 17:39:57 +00:00
Treehugger Robot
a6b73d36ef Merge "Be more restrictive about max frame size." 2016-08-17 17:29:25 +00:00
Elliott Hughes
74600ce304 Merge "Document that our getnameinfo(3) prototype is unfixably wrong."
am: f74eb2609f

Change-Id: Ie9bd6e383ba5143242453a467234d91cb77a04a0
2016-08-17 00:32:50 +00:00
Elliott Hughes
8e547bde4b Be more restrictive about max frame size.
exec and realpath both have PATH_MAX buffers (which is a bug in its own
right, since PATH_MAX isn't a real limit). The printf/scanf implementation
has a few large functions, and the DNS implementation is a complete 1970s
C nightmare.

Bug: http://b/30032507
Change-Id: I4b9daa552123c16bbe84f0632b2b32eba17a9dbd
2016-08-16 15:57:47 -07:00
Elliott Hughes
5c730feb44 Merge "Add missing <sys/stat.h> macros."
am: fe4ab7dc30

Change-Id: Iebe7bd3970e16796493b2804b11621d744108baa
2016-08-16 22:18:20 +00:00
Elliott Hughes
daf7506af7 Merge "Fix various <sys/socket.h> prototypes."
am: c8476bb7ad

Change-Id: I383ececb2f1757b15c804737dc0ceba6ec80e056
2016-08-16 22:18:17 +00:00
Elliott Hughes
d29747f935 Merge "mprotect and msync take void*, not const void*."
am: 1df81cd177

Change-Id: I41a5ae96481e09a1de238d5cd361f32c65dc1e7c
2016-08-16 22:18:14 +00:00
Elliott Hughes
ecb7611538 Document that our getnameinfo(3) prototype is unfixably wrong.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html

We could fix it for LP32, but that's probably just more confusing and
inconvenient.

Change-Id: Ic37c60fe3665a309cc35c89961712b484dbdaa4c
2016-08-16 15:05:57 -07:00
Treehugger Robot
fe4ab7dc30 Merge "Add missing <sys/stat.h> macros." 2016-08-16 21:59:16 +00:00
Treehugger Robot
c8476bb7ad Merge "Fix various <sys/socket.h> prototypes." 2016-08-16 21:57:31 +00:00
Treehugger Robot
1df81cd177 Merge "mprotect and msync take void*, not const void*." 2016-08-16 21:39:21 +00:00
Elliott Hughes
c8d967f0ec Merge "Fix memmem behavior with empty needles."
am: ce8a5b4b9d

Change-Id: I82a48a9fdd872fdb4ced7846a6912a44530bbed1
2016-08-16 21:02:38 +00:00
Elliott Hughes
2b9605fec4 Fix various <sys/socket.h> prototypes.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html

Interestingly, recvmmsg/sendmmsg do actually return int, unlike their
recv/recvmsg/sendv/sendvmsg siblings.

The generated assembler stubs don't actually change.

Change-Id: If71cd02431903774de9bbce77fbedf6b03f90c0f
2016-08-16 13:37:24 -07:00
Elliott Hughes
9288761a26 Add missing <sys/stat.h> macros.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Change-Id: I8c31f3a6fae2c4955c5fba3d880a416d03dfafb7
2016-08-16 13:26:35 -07:00
Elliott Hughes
9dff0d05b5 mprotect and msync take void*, not const void*.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html

Change-Id: Ie26195e2e382c1387037c7ee5cd90b3963220328
2016-08-16 13:25:13 -07:00
Elliott Hughes
cae33ade6c Fix memmem behavior with empty needles.
Change-Id: I8b893d80c27b548652d843af9520d7adc8ba8902
2016-08-16 12:28:58 -07:00
Elliott Hughes
b3ed1c5202 Merge "Fix mktime's errno behavior."
am: 228e747b6c

Change-Id: I1f70691679023dd1e187ac8d4d41674272ac4688
2016-08-15 20:17:20 +00:00
Treehugger Robot
228e747b6c Merge "Fix mktime's errno behavior." 2016-08-15 20:06:57 +00:00