Commit graph

2162 commits

Author SHA1 Message Date
Elliott Hughes
575129886c Pre-size the vector in the pthread_create ENOMEM test.
Just to avoid the possibility of an unfortunate mmap occurring in order to
grow the vector.

Bug: N/A
Test: ran tests
Change-Id: I850740461d761916a0377272664159d010da7b84
2017-10-03 12:20:07 -07:00
Chih-Hung Hsieh
dfbff07c92 Merge "Use -Werror in bionic" am: 9385d778fd am: 7887421aed
am: a4fcd22ffd

Change-Id: I40302d02f9f70c2d020d029336c4c73816636de8
2017-10-02 22:28:38 +00:00
Treehugger Robot
9385d778fd Merge "Use -Werror in bionic" 2017-10-02 22:04:48 +00:00
Chih-Hung Hsieh
84f0dcd59e Use -Werror in bionic
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ic68141a5c50880c485646e38349f94b866267bd9
2017-10-02 13:21:22 -07:00
dimitry
0de4982099 Merge "Replace abort with exit(1) in __linker_cannot_link" am: 95f90784ea am: 2161b032e0
am: 4eae0fc50a

Change-Id: I3ffe725ed2977cb211ba96d02dca03e7d4046547
2017-09-29 20:05:17 +00:00
Treehugger Robot
95f90784ea Merge "Replace abort with exit(1) in __linker_cannot_link" 2017-09-29 19:53:17 +00:00
Elliott Hughes
fa1d5e473b Merge "Require getrandom(2)." am: b93f2631e4 am: 3e6a64901a
am: b1fbb46d00

Change-Id: I5eb10e80c40fb838df97a9263d90151aa8e6d8fc
2017-09-29 19:12:39 +00:00
dimitry
04f7a798cf Replace abort with exit(1) in __linker_cannot_link
Bug: http://b/67038409
Test: bionic-unit-tests
Change-Id: I7d39b44f2da8c5111ac8a9faf3416f19d5a35c05
2017-09-29 19:48:46 +02:00
Elliott Hughes
89794c4239 Merge changes I76dde1e3,I54fec461 am: b3639adf9c am: a76e668634
am: 5f3eb36898

Change-Id: Ifed38d4fa8c7835b3771ea8112ea8270bb5c31e5
2017-09-29 17:10:58 +00:00
Elliott Hughes
6a5dfebd41 Require getrandom(2).
It's almost 2018, Linux 3.17 -- the first kernel with getrandom(2) --
was released in October 2014, and being able to assume getrandom lets
us simplify and improve some security-related code in libc, and revert a
hack to getentropy that's been necessary in the meantime. Only the fugu
kernel doesn't have getrandom(2) at this point, and that's EOL.

Bug: http://b/67014255
Test: ran tests
Change-Id: I1736f4dd33d50fe99e7a524851180989f4c85a33
2017-09-29 09:01:01 -07:00
Elliott Hughes
b3639adf9c Merge changes I76dde1e3,I54fec461
* changes:
  Add <sys/random.h>.
  Run other maintenance scripts as part of the preupload hooks.
2017-09-29 15:39:29 +00:00
Dan Willemsen
48343a80a7 Merge "Remove default libraries" am: bd2754177f am: 19e2c5b81b
am: 719ba0c39d

Change-Id: I2ce8a61f8d57fff26d1cb3255c5db6a4fb07cd8e
2017-09-29 09:55:27 +00:00
Elliott Hughes
8465e968a8 Add <sys/random.h>.
iOS 10 has <sys/random.h> with getentropy, glibc >= 2.25 has
<sys/random.h> with getentropy and getrandom. (glibc also pollutes
<unistd.h>, but that seems like a bad idea.)

Also, all supported devices now have kernels with the getrandom system
call.

We've had these available internally for a while, but it seems like the
time is ripe to expose them.

Bug: http://b/67014255
Test: ran tests
Change-Id: I76dde1e3a2d0bc82777eea437ac193f96964f138
2017-09-29 05:31:35 +00:00
Dan Willemsen
ae407e522a Remove default libraries
libdl is part of system_shared_libs now. -ldl -lpthread -lm are now defaults
for host_ldlibs on Linux and Darwin. -lrt is a default for host_ldlibs on
Linux.

Test: m host
Test: mmma bionic
Change-Id: I966e2f88c24fba5e412bee6b6382045a2026a8e4
2017-09-28 16:16:14 -07:00
Elliott Hughes
f43c91a035 Merge "Add <glob.h>." am: b736c41ffe am: a9b9b12728
am: 6122258c90

Change-Id: I6a7d5cd1610b779c4dc91b7f376947804a6c4cc1
2017-09-28 17:27:38 +00:00
Elliott Hughes
b736c41ffe Merge "Add <glob.h>." 2017-09-28 17:01:06 +00:00
Elliott Hughes
f1c568d1ea Add <glob.h>.
This is the FreeBSD implementation, plus some tests. The FreeBSD
implementation includes the GNU extensions and seems to be what
iOS is using too, which should provide bug compatibility for app
developers.

The code unfortunately uses a lot of stack, and uses FreeBSD locale
implementation that we don't have, but it does seem better maintained
than the other BSDs.

Bug: http://b/29251134
Test: ran tests
Change-Id: Ie477b45e42a6df1319b25712098519d2b33adf67
2017-09-26 18:46:09 -07:00
dimitry
df775eda92 Merge "Link vdso before linking the main executable" am: 62767bc31d am: 348161ed3c
am: ce97d243f1

Change-Id: Ic65207315cd9cb03d77f305428d73d6cb0936bac
2017-09-26 17:20:29 +00:00
dimitry
c18de1bd47 Link vdso before linking the main executable
Also set linked flag after it is linked and
call constructors. Set RTLD_NODELETE flag to
prevent accidental unloads.

Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Change-Id: Ib2178849b918cbefd6f8fcfe6d1f78889fe0bf76
2017-09-26 14:34:18 +02:00
Kazuhiro Inaba
f7a8e95fe8 Fix fcntrl#tee test to use the same expected/actual buffer size.
Previously the test compared /proc/version read into expected[256]
with actual[BUFSIZ]. This CL aligns the both of the buffer sizes to
the same BUFSIZ, so that /proc/version longer than 256 bytes won't
result in a test failure.

Bug: 66872345
Test: fcntl#tee on a device with long /proc/version (Chromebook Plus)
Change-Id: I004dd2189565b0bdde1aa22a2f25fafe74560180
(cherry picked from commit 85a08ae9fead3f24daf108108257e4793a192e5f)
2017-09-25 23:34:19 +00:00
Jiyong Park
84bc230f27 Merge "Don't run exec_with_ld_config_file* tests on non-production devices" into oc-mr1-dev
am: 146fa6b458

Change-Id: Ife179503595f1652e3eaa0bc395e0a03bc1ffca5
2017-09-21 05:24:26 +00:00
TreeHugger Robot
146fa6b458 Merge "Don't run exec_with_ld_config_file* tests on non-production devices" into oc-mr1-dev 2017-09-21 05:17:21 +00:00
Jiyong Park
5e3d44100b Don't run exec_with_ld_config_file* tests on non-production devices
The tests that use LD_CONFIG_FILE environment variable shouldn't be run
on non-production devices because LD_CONFIG_FILE is only for debuggable
builds. We have used the build-time flag USE_LD_CONFIG_FILE, which is
set for the debuggable builds, to conditionally include or exclude the
tests. However, this can be a problem when 1) the device is not
debuggable but 2) the CTS itself is built with debuggable target. So,
instead of relying on the build-time flag USE_LD_CONFIG_FILE, the tests
now check the debuggability of the device and skip the tests when it
isn't debuggable.

Bug: 65842135
Test: 1) flash user build image to a 2017 pixel device.
2) build cts with 'userdebug' build target
3) CtsBionicTestCases pass on the device

Change-Id: Ib88e3b26d093e5479d52cd87db47dee5e108cac2
2017-09-21 11:57:38 +09:00
Elliott Hughes
bd8391f80d Merge "Improve pthread_create failure handling." am: e27d29cfaf am: 87c0bddba9
am: 30c907352c

Change-Id: I37cb864fbfae7ced32ef020816f03fc484fee4f5
2017-09-19 23:57:30 +00:00
Treehugger Robot
e27d29cfaf Merge "Improve pthread_create failure handling." 2017-09-19 23:44:23 +00:00
Evgenii Stepanov
4994552198 Extend cfi test to verify a range of target pointers.
Test: bionic device tests
Bug: 63400743
Bug: 65590288

(cherry picked from commit 1dfd76ac2c)

Change-Id: I33832ef9ab98baf52afe969ea7a03fe419f93cb2
2017-09-19 16:21:22 -07:00
Evgenii Stepanov
6b230cd2de Merge "Extend cfi test to verify a range of target pointers." am: 1ec162d392 am: 8f9268c0f3
am: 86abadb822

Change-Id: Ic676701b948b04b9d8afd07b785cf1a14f2249e2
2017-09-19 22:54:00 +00:00
Elliott Hughes
53dc9dd701 Improve pthread_create failure handling.
Return EAGAIN rather than aborting if we fail to set up the TLS for a new
thread.

Add a test that uses all the VMAs so we can properly test these edge cases.

Add an explicit test for pthread_attr_setdetachstate, which we use in the
previous test, but other than that has no tests.

Remove support for ro.logd.timestamp/persist.logd.timestamp, which doesn't
seem to be used, and which prevents us from logging failures in cases where
mmap fails (because we need to mmap in the system property implementation).

Bug: http://b/65608572
Test: ran tests
Change-Id: I9009f06546e1c2cc55eff996d08b55eff3482343
2017-09-19 14:02:50 -07:00
Evgenii Stepanov
1dfd76ac2c Extend cfi test to verify a range of target pointers.
Test: bionic device tests
Bug: 63400743
Bug: 65590288
Change-Id: Ic4ef9630a2db709cf4edcc7f76c791df3f349192
2017-09-19 13:59:34 -07:00
Elliott Hughes
1deb26e6ff Merge "Support larger guard regions." am: dacbb04cde am: 951f4af9ce
am: eadf51ccbe

Change-Id: Ib4e8e1d35be5fad89deb25ff284939dddb94dd01
2017-09-19 01:17:55 +00:00
Treehugger Robot
dacbb04cde Merge "Support larger guard regions." 2017-09-19 01:08:25 +00:00
Elliott Hughes
d6c678ca90 Support larger guard regions.
This also fixes a long-standing bug where the guard region would be taken
out of the stack itself, rather than being -- as POSIX demands -- additional
space after the stack. Historically a 128KiB stack with a 256KiB guard would
have given you an immediate crash.

Bug: http://b/38413813
Test: builds, boots
Change-Id: Idd12a3899be1d92fea3d3e0fa6882ca2216bd79c
2017-09-18 16:09:43 -07:00
Elliott Hughes
f810219ce7 Merge "Always log errno when aborting." am: 0c9ea17e0c am: 002b30843b
am: 5d1cf56ce5

Change-Id: I1999c656307aea0a0a0372248d65a05657546e59
2017-09-18 21:44:57 +00:00
Elliott Hughes
b89260790d Merge "Use __RENAME for long double functions." am: df862454b6 am: c4287cec82
am: 79dd9b7c0e

Change-Id: Icc362b01d39427f79cbea235cc54a14274df560e
2017-09-18 21:44:38 +00:00
Treehugger Robot
0c9ea17e0c Merge "Always log errno when aborting." 2017-09-18 21:33:54 +00:00
Elliott Hughes
df862454b6 Merge "Use __RENAME for long double functions." 2017-09-18 21:33:06 +00:00
Elliott Hughes
7b0af7ad82 Always log errno when aborting.
(Where errno is relevant.)

Also consistently use -1 as the fd for anonymous mmaps. (It doesn't matter,
but it's more common, and potentially more intention-revealing.)

Bug: http://b/65608572
Test: ran tests
Change-Id: Ie9a207632d8242f42086ba3ca862519014c3c102
2017-09-15 16:18:49 -07:00
Bill Yi
5828840e72 Merge remote-tracking branch 'aosp/oreo-cts-dev' into HEAD 2017-09-15 13:44:31 -07:00
Elliott Hughes
50cda38f1d Use __RENAME for long double functions.
We can cut a lot of stuff out of the NDK's libandroid_support with this,
and reduce unnecessary relocations for all LP32 code. LP64 code should
be unaffected.

Bug: https://issuetracker.google.com/64450768
Bug: https://github.com/android-ndk/ndk/issues/507
Test: ran tests, plus manual readelf on the _test.o files
Change-Id: I3de6015921195304ea9c829ef31665cd34664066
2017-09-14 16:10:43 -07:00
Lennart Wieboldt
9deb345edd Merge "Remove clang: true" am: 7e6f98b93d am: af4de40428
am: fbf0f50632

Change-Id: I9b11125cf544029b93f28e943a1b0ddfa0fb6bc4
2017-09-11 22:04:13 +00:00
Lennart Wieboldt
af4de40428 Merge "Remove clang: true"
am: 7e6f98b93d

Change-Id: Ib97ff76648505fa29d7e764ecaeabe2a1ea84906
2017-09-11 21:48:09 +00:00
Treehugger Robot
7e6f98b93d Merge "Remove clang: true" 2017-09-11 21:39:41 +00:00
Lennart Wieboldt
2286b9f5ae Remove clang: true
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: Id8b5361d18c1b2febb2dc6cc44502feaa08f605c
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-09-11 21:43:58 +02:00
Elliott Hughes
3cf002aef5 Merge "Finish <search.h>." am: 4c9d528a25 am: 9b0889c7bd
am: 886d1b5b63

Change-Id: I1d74385fe8f6a09b621097dd92c21b3daee79a6d
2017-09-11 18:50:51 +00:00
Elliott Hughes
9b0889c7bd Merge "Finish <search.h>."
am: 4c9d528a25

Change-Id: I39f10ca14b88d4c9075e83105f3b7101da610269
2017-09-11 18:40:59 +00:00
Elliott Hughes
4c9d528a25 Merge "Finish <search.h>." 2017-09-11 18:39:30 +00:00
Elliott Hughes
df71545eba Merge "Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions." am: 60103831eb am: 5398ead784
am: c7ad49251e

Change-Id: Ib7cdf6e0671ed4966b62611f9368ac22dd05ab52
2017-09-08 20:03:07 +00:00
Elliott Hughes
5398ead784 Merge "Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions."
am: 60103831eb

Change-Id: I5542305cc9142072613267346f4bdfad8748a2a0
2017-09-08 19:43:06 +00:00
Elliott Hughes
00d8a8b779 Trivial tests for <inttypes.h>/<stdlib.h> *abs and *div functions.
Because I want something to copy & paste into the NDK support library test
that's slightly better than taking the address of the function...

Bug: https://github.com/android-ndk/ndk/issues/502
Test: ran tests
Change-Id: If43089d16691d6a4dcf5d972450b14ed85bbca81
2017-09-07 17:01:37 -07:00
Elliott Hughes
5702c6ff45 Finish <search.h>.
I'm unable to find a bug, but we've had requests for this internally
once or twice (though I pointed those folks at the STL), and there's
code we build for the host or in our bootloaders that would use this,
and there's reasonable-looking FreeBSD implementation ready and waiting.

Bug: N/A
Test: ran tests
Change-Id: I6ddee4b71bea4c22ed015debd31d3eaac4fcdd35
2017-08-31 17:38:51 -07:00
Elliott Hughes
cfffa48498 Merge "Add an extra test for a POSIX iconv requirement." am: b20c246fc9 am: 44022d3d1d
am: eee0f02f11

Change-Id: Ide2dd71edc5d0e2869e3b95c76c23bbfdfc12d8c
2017-09-01 00:00:03 +00:00
Elliott Hughes
44022d3d1d Merge "Add an extra test for a POSIX iconv requirement."
am: b20c246fc9

Change-Id: Iec293ed1cc9b0b7611f76f02839a69ba6495787f
2017-08-31 23:52:35 +00:00
Treehugger Robot
b20c246fc9 Merge "Add an extra test for a POSIX iconv requirement." 2017-08-31 23:45:27 +00:00
Elliott Hughes
d40a833ab0 Add an extra test for a POSIX iconv requirement.
Bug: N/A
Test: ran tests
Change-Id: If211bf2a74ac3a6e8e84375c88f6c2580c392d50
2017-08-31 14:14:16 -07:00
Jiyong Park
7f1e941ab6 Make dlext.ns_shared be independent of default namespace config
am: 917d34a84f

Change-Id: I1b459654147912c5a8169126773e585bc5364f2a
2017-08-31 18:13:05 +00:00
Jiyong Park
917d34a84f Make dlext.ns_shared be independent of default namespace config
dlext.ns_shared creates a child namespace, which is isolated & shared,
from the default namespace. It then checks whether a lib that was loaded
in the parent(=default) namespace *after* the child namespace is created
is not accessible to the child namespace. Because this test is using the
default namespace as a parent namespace, the test result is dependent on
the specific configuration of the default namespace, which isn't
desirable.

Specifically, since ANDROID_NAMESPACE_TYPE_SHARED now copies search
paths and permitted paths of the parent namespace to the child namespace,
a lib that is accessible to the former is also accessible to the latter
even if the lib hasn't been shared when creating the latter. So, the
result of the test varies depending on whether the default namespace has
permitted paths or not. (if it is configured as an isolated namespace
and has permitted paths, then the test fails).

In order to make this test be independent from how the default namespace
is configured, a parent namespace is explicitly created and the child
namespaces are created from the parent namespace, not from the default
namespace.

Bug: 65189955
Test: bionic-unit-tests --gtest_filter=dlext.ns_shared successful
Test: the same test successful when the default namespace is configured
as follows
namespace.default.isolated = true
namespace.default.permitted_paths = ...:/data

Change-Id: Ifa33c6c42f8c327b2b1c380c7abba8e8f1afee82
2017-08-31 14:11:49 +09:00
Jiyong Park
e1c82be90b Merge "Don't run disable_ld_config_file test on non-production devices"
am: 7f9f1b6f91

Change-Id: I256ad6da2e890d4b50b5aaa9ae47a3e64253538e
2017-08-31 00:08:29 +00:00
Treehugger Robot
7f9f1b6f91 Merge "Don't run disable_ld_config_file test on non-production devices" 2017-08-30 23:57:40 +00:00
Jiyong Park
ac184dd383 Merge "Don't run disable_ld_config_file test on non-production devices" into oc-mr1-dev
am: 4ce79ba154

Change-Id: I517179e1b527dfe8d88f9048f6c9fcf6b7252b56
2017-08-30 19:06:53 +00:00
Elliott Hughes
f4eb1c7554 Merge "Use have_dl to guard all tests that rely on icu4c." am: b3aea2bb9a am: 6446acf814
am: b1958d2277

Change-Id: I94ffc7a1e4c1bb9b42359eec805a475618cc6749
2017-08-30 18:47:23 +00:00
Elliott Hughes
6446acf814 Merge "Use have_dl to guard all tests that rely on icu4c."
am: b3aea2bb9a

Change-Id: Ib5c30b73698e98e54fc4e2a9f0287683a2923caa
2017-08-30 18:33:33 +00:00
Treehugger Robot
b3aea2bb9a Merge "Use have_dl to guard all tests that rely on icu4c." 2017-08-30 18:22:37 +00:00
Jiyong Park
4945d8f121 Don't run disable_ld_config_file test on non-production devices
The test always fails when run on non-production devices. Silence the
expected failure.

Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.

Merged-In: Icd24a356dfbc62f540e3263070434a4fd065bfbc
Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
(cherry picked from commit 157655dc67)
2017-08-31 01:42:55 +09:00
Elliott Hughes
ded2e6c7bb Merge "Add tests for all C11 headers." am: 76a4bb980c am: ed7a15453d
am: 6b1f428dd3

Change-Id: I6b2e61a1f7776f83e7d4b21479df72dea2a160a8
2017-08-30 16:23:25 +00:00
Elliott Hughes
966d8a321e Use have_dl to guard all tests that rely on icu4c.
Bug: http://b/65138342
Test: ran tests
Change-Id: Iddded068a2481e8b15e102c8705545a886ae2772
2017-08-30 16:17:40 +00:00
Elliott Hughes
ed7a15453d Merge "Add tests for all C11 headers."
am: 76a4bb980c

Change-Id: I44c85180e90d5f635ecd2223a8de011a007d4214
2017-08-30 16:07:53 +00:00
Jiyong Park
157655dc67 Don't run disable_ld_config_file test on non-production devices
The test always fails when run on non-production devices. Silence the
expected failure.

Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.

Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
2017-08-30 11:30:53 +09:00
Elliott Hughes
45da326324 Add tests for all C11 headers.
Well, all except <threads.h> which we have no current plans to implement.

The only thing this turned up is that clang's <float.h> doesn't define
FLT_HAS_SUBNORM/DBL_HAS_SUBNORM/LDBL_HAS_SUBNORM, so for now we assert
that those are missing so that when we get a fixed clang, we notice.

Also the <tgmath.h> is utterly perfunctory, but seems like an appropriate
amount of effort to put in.

Bug: N/A
Test: ran tests
Change-Id: I7f7a7040b3271ceda625bee8a40a9d8cef52ee44
2017-08-29 15:32:18 -07:00
Elliott Hughes
0977c8baa1 Merge "Implement <iconv.h>." am: d615a06068 am: 94e366e616
am: 01987bfc77

Change-Id: I1c9a36ed0123db89aec989e74ddd40cd789760ab
2017-08-25 21:16:07 +00:00
Elliott Hughes
94e366e616 Merge "Implement <iconv.h>."
am: d615a06068

Change-Id: I22e3bf2d373c752115c27f0d5c9cb6a9b1ea3c76
2017-08-25 21:11:39 +00:00
Elliott Hughes
a648733cb7 Implement <iconv.h>.
Bug: http://b/32978596
Test: ran tests
Change-Id: I56b6ae3d9c5a3a56d2b4afba33fb8f9e964bf7b9
2017-08-25 08:47:41 -07:00
Elliott Hughes
1a61d3e26b Merge "Add syncfs(2)." am: fa3d3291e1 am: 1d1f15ab1b
am: cbea75b46b

Change-Id: Ic2a4c90bf1cfadc72cfba60558f751bc9604a2c5
2017-08-25 15:06:06 +00:00
Elliott Hughes
1d1f15ab1b Merge "Add syncfs(2)."
am: fa3d3291e1

Change-Id: I6ac91294e9cf5ff8d0b44fc3ddc46b6ee3fbd9bf
2017-08-25 14:56:34 +00:00
Elliott Hughes
896362eb0e Add syncfs(2).
GMM calls this system call directly at the moment. That's silly.

Bug: http://b/36405699
Test: ran tests
Change-Id: I1e14c0e5ce0bc2aa888d884845ac30dc20f13cd5
2017-08-24 16:31:49 -07:00
George Burgess IV
bc67a8422a Merge "tests: explain how to debug FileCheck failures" am: 96c577c482 am: 2b5441276c
am: 4c63cd1158

Change-Id: Icae45f024a1ad25b59c450ca6d9f4b0c41ec119e
2017-08-24 18:19:54 +00:00
George Burgess IV
2b5441276c Merge "tests: explain how to debug FileCheck failures"
am: 96c577c482

Change-Id: Ie7b823205860b047c36148fdf73434b3a8a4b58f
2017-08-24 18:10:24 +00:00
George Burgess IV
c7bd90ff6f tests: explain how to debug FileCheck failures
As requested by enh@ in Ie9ed1fbcc794e14a0c9bba13b5307ad677949613.

Bug: None
Test: mma
Change-Id: I3beb97fb500faa50d79f9355898bf778ab1184bd
2017-08-24 00:36:15 +00:00
Logan Chien
7b7eea1e3d Merge "Fix wchar.wcstold_hex_floats on arm64" am: 96ba713f73 am: dbe3d36999 am: afea670564
am: 07b15a3f74

Change-Id: I6abdedc7c77a3c3a0a0b2382742f5b7652b95492
2017-08-23 07:32:58 +00:00
Logan Chien
afea670564 Merge "Fix wchar.wcstold_hex_floats on arm64" am: 96ba713f73
am: dbe3d36999

Change-Id: I356c1475adf2950988fa238ae81b8b8b833720ba
2017-08-23 07:26:57 +00:00
Logan Chien
96ba713f73 Merge "Fix wchar.wcstold_hex_floats on arm64" 2017-08-23 07:16:34 +00:00
Christopher Ferris
1f17049808 Merge "Refactor BufferOutputStream." am: 1b3fe44e3d am: a3c50668cf am: 3884fe23ba
am: 476cff09e6

Change-Id: I3a53acc5bf834792c6ddc85658bf6dc903d59c6e
2017-08-22 23:40:09 +00:00
Christopher Ferris
3884fe23ba Merge "Refactor BufferOutputStream." am: 1b3fe44e3d
am: a3c50668cf

Change-Id: Ia6d7243f1791fb47e62e67044a068e48774c180a
2017-08-22 23:21:29 +00:00
Christopher Ferris
1b3fe44e3d Merge "Refactor BufferOutputStream." 2017-08-22 22:50:32 +00:00
Christopher Ferris
9247640711 Refactor BufferOutputStream.
- Rewrite BufferOutputStream to handle 0 sized buffers and to get rid
  of an unnecessary loop.
- Add tests to verify overflow corner cases.
- Implement async_safe_format_buffer to call async_safe_format_buffer_va_list
  instead of duplicate the code.

Test: Ran new unit tests, booted on angler.
Change-Id: I7fb13e209f5b7443d212f55aab4b05ff2e0e8219
2017-08-22 13:17:28 -07:00
Logan Chien
0288dbb739 Fix wchar.wcstold_hex_floats on arm64
This commit fixes wchar.wcstold_hex_floats on arm64.  On AArch64
(ARM64), the `long double` type has 128 bits and is more precise then
`double` type (64-bit).  As a result, `1e100L` is slightly different
from `static_cast<long double>(1e100)`.

This commit fixes the regression by adding 'L' after the floating point
literals.  This should work because casting from a higher precision
to lower precision won't lose any precisions.

Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests \
  --gtest-filter=wchar.wcstold_hex_floats
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests

Change-Id: Ibd7b6a5d46c38338b4ca56838d9d272c710b32f6
2017-08-22 17:52:02 +08:00
George Burgess IV
d9e9dcc559 Merge "Disable FORTIFY on ASAN builds" am: 7ac99d3ff6 am: 411814e0a9 am: 8060209ab2
am: a07c6a9680

Change-Id: I6db0200a35221a24067780b38caead5f69060b5f
2017-08-18 23:05:11 +00:00
George Burgess IV
8060209ab2 Merge "Disable FORTIFY on ASAN builds" am: 7ac99d3ff6
am: 411814e0a9

Change-Id: Ia5ef40f1402fedb6946654033b5c2c4e8ef2c4e3
2017-08-18 23:00:10 +00:00
George Burgess IV
411814e0a9 Merge "Disable FORTIFY on ASAN builds"
am: 7ac99d3ff6

Change-Id: Ib469956edc364bd0d4af59dc5a79439528bf5efd
2017-08-18 22:58:12 +00:00
George Burgess IV
d9551db089 Disable FORTIFY on ASAN builds
FORTIFY's *_chk functions mess with ASAN's library function
interceptors, which can apparently result in false-positives.

Since adding even more complexity to every run-time check condition in
FORTIFY doesn't seem like a great idea, and the majority of our builds
will still use FORTIFY anyway, turning FORTIFY off here seems
reasonable.

Bug: 63104159
Test: checkbuild on internal master + CtsBionicTestCases. No new
failures.

Change-Id: Id32e551e28ee70a9815ad140c3253b86f03de63f
2017-08-18 13:33:45 -07:00
Evgenii Stepanov
115e0e785a [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803

(cherry picked from commit 97c16f8dca)

Change-Id: Ia82152f568e3a80deb902d02fa400e88e3f556bc
2017-08-17 17:34:52 -07:00
Evgenii Stepanov
fbf9c064ad Merge changes from topic "cfi-shadow-size" am: fc89237b77 am: 62adbbf5e8 am: b502d57d7f
am: 0730f0ce6d

Change-Id: Ib33ab43015edefb91c930b4a0a3453aeb905fe78
2017-08-17 00:54:07 +00:00
Evgenii Stepanov
b502d57d7f Merge changes from topic "cfi-shadow-size" am: fc89237b77
am: 62adbbf5e8

Change-Id: I8efeadc018b296b6875f3837e62bdbd8fab2f75d
2017-08-17 00:42:14 +00:00
Evgenii Stepanov
62adbbf5e8 Merge changes from topic "cfi-shadow-size"
am: fc89237b77

Change-Id: I34c706c542e338616d07035e5209d727a43c69bb
2017-08-17 00:37:59 +00:00
Treehugger Robot
fc89237b77 Merge changes from topic "cfi-shadow-size"
* changes:
  Revert "Revert "arm64: expand CFI shadow to cover 48-bit virtual addresses""
  [cfi] Export __cfi_shadow_size.
2017-08-17 00:16:56 +00:00
George Burgess IV
0f2f92c5c8 Merge "libc fortify: error on realpath(NULL, foo)" am: 6beab08440 am: 87fcfefe26 am: ff69b4fefc
am: fdc35cb9f4

Change-Id: I553b2237a1c4b949d9e4741506fdf4980776212c
2017-08-15 18:12:04 +00:00
George Burgess IV
ff69b4fefc Merge "libc fortify: error on realpath(NULL, foo)" am: 6beab08440
am: 87fcfefe26

Change-Id: I289b496e80533d3fe45781f9b86d000e25c5dfbd
2017-08-15 17:50:31 +00:00
George Burgess IV
87fcfefe26 Merge "libc fortify: error on realpath(NULL, foo)"
am: 6beab08440

Change-Id: I50cf25955d28df10661e08579fac001f7abdab5f
2017-08-15 17:45:01 +00:00
George Burgess IV
95bd4884b5 libc fortify: error on realpath(NULL, foo)
I've half a mind to make this a warning instead, since this sort of
call isn't UB. That said:
- if the user really wants this (I can't imagine why they would), they
  can just put NULL in a non-const variable,
- we're slowly moving to -Werror ~everywhere anyway, and
- it's presumably easier to change this from an error to a warning than
  the other way around

Bug: 12231437
Test: m checkbuild on bullhead internal master. No new
CtsBionicTestCases failures.

Change-Id: Ie8bf5a3455f663686fda4a7450fb35d147fa745e
2017-08-14 14:48:55 -07:00
Elliott Hughes
68ab54444a Fix the sysconf _SC_2_VERSION test.
Not sure how this ended up broken. Too many branches!

Bug: http://b/64565873
Test: ran tests

(cherry picked from commit 6c135f4c41)

Change-Id: Ie7078541d2a75fb2fbcf03e78a49707307b674c0
2017-08-10 14:33:15 -07:00
Dan Albert
f95cedade4 Merge changes I36924c4b,Ib6bdd09e am: 32f719ad1a am: 2104cf6795 am: 12dc66bceb
am: e5ba6f1adb

Change-Id: I3ef7554da3689455877a0f51e1bb92d73206bf06
2017-08-10 02:20:56 +00:00
Dan Albert
12dc66bceb Merge changes I36924c4b,Ib6bdd09e am: 32f719ad1a
am: 2104cf6795

Change-Id: I863c54ec6efa981c0cb6c9478bfa7937ed011cc9
2017-08-10 02:15:25 +00:00
Dan Albert
2104cf6795 Merge changes I36924c4b,Ib6bdd09e
am: 32f719ad1a

Change-Id: I5da04c1304ca69e9fbae4d1a559c2b6ccf428b1b
2017-08-10 02:12:57 +00:00
Treehugger Robot
32f719ad1a Merge changes I36924c4b,Ib6bdd09e
* changes:
  Expand swprintf tests.
  Expand wcsto* tests.
2017-08-10 02:07:34 +00:00
Dan Albert
cfd192bbcb Merge "Fix include to be file-relative." am: e8658b3022 am: e7c0abea6b am: 1d5d31ebdf
am: e3d5208a67

Change-Id: Ib4071bc85162ff245a5526c0d5381e39502a6851
2017-08-10 00:30:13 +00:00
Dan Albert
1d5d31ebdf Merge "Fix include to be file-relative." am: e8658b3022
am: e7c0abea6b

Change-Id: I571b71a579795c21a735900ae4851acab41073a7
2017-08-09 22:39:42 +00:00
Dan Albert
e7c0abea6b Merge "Fix include to be file-relative."
am: e8658b3022

Change-Id: I6eb9aee12056817ee656cc54b0e36ac07fe415fe
2017-08-09 22:31:49 +00:00
Dan Albert
9601f162f4 Expand swprintf tests.
Test: bionic unit tests
Bug: None
Change-Id: I36924c4bdd2fa2c25e50ef7fef5500a365721a05
2017-08-09 14:59:33 -07:00
Dan Albert
6805c2db39 Expand wcsto* tests.
Test: bionic unit tests
Bug: None
Change-Id: Ib6bdd09ea2b30274f5312d2edd63ba9e727e9b9c
2017-08-09 14:55:27 -07:00
Dan Albert
b2ca03140d Fix include to be file-relative.
Discovered while trying to build this with the NDK.

Test: make checkbuild
Bug: None
Change-Id: Id5289065d7a1b36f20b0963b38b6ef4dc1d461b9
2017-08-07 16:28:13 -07:00
Tom Cherry
1342527b57 Remove a check for AIDs in the OEM range. am: c2c36b661c
am: fe1dc33b28

Change-Id: Ic2107c9550f368db0ada5cc3f680bf289734a812
2017-08-04 21:31:58 +00:00
Tom Cherry
fe1dc33b28 Remove a check for AIDs in the OEM range.
am: c2c36b661c

Change-Id: Ic99c543a3cf5eaad251fc07957262f144c5f7b97
2017-08-04 21:25:57 +00:00
Tom Cherry
5736dfca2e Merge "Remove a check for AIDs in the OEM range." am: f631e5a001 am: 76f68b3357 am: d85afe5f34
am: df34f7091d

Change-Id: I5ac0fc5f3ed39db739b6869f1e6f98004431a9ac
2017-08-04 20:58:10 +00:00
Tom Cherry
d85afe5f34 Merge "Remove a check for AIDs in the OEM range." am: f631e5a001
am: 76f68b3357

Change-Id: I5676fec81a02bb90acff278991743fb097c9e453
2017-08-04 20:45:26 +00:00
Elliott Hughes
b2c23b7265 Merge "With O_TMPFILE, open(2) takes a mode argument." am: 2fdefadcee am: 212ea2b74e am: ff6f1697ec
am: 06701782a2

Change-Id: I70a6e0b016abda50aafc969c2a9452b1195a9a57
2017-08-04 20:39:18 +00:00
Tom Cherry
76f68b3357 Merge "Remove a check for AIDs in the OEM range."
am: f631e5a001

Change-Id: I712af017b833facad83e9d1e21d0c691c02e9559
2017-08-04 20:38:56 +00:00
Tom Cherry
c2c36b661c Remove a check for AIDs in the OEM range.
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.

Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
(cherry picked from commit a14485adde)
2017-08-04 13:30:21 -07:00
Tom Cherry
f631e5a001 Merge "Remove a check for AIDs in the OEM range." 2017-08-04 20:28:05 +00:00
Elliott Hughes
ff6f1697ec Merge "With O_TMPFILE, open(2) takes a mode argument." am: 2fdefadcee
am: 212ea2b74e

Change-Id: I17a248316365bc0872e15e3ed72915be5f3cc269
2017-08-04 20:27:13 +00:00
Elliott Hughes
212ea2b74e Merge "With O_TMPFILE, open(2) takes a mode argument."
am: 2fdefadcee

Change-Id: I5cd1f9103b4b5f20f18fd3f7f5be2511e2b1990f
2017-08-04 20:20:38 +00:00
Tom Cherry
a14485adde Remove a check for AIDs in the OEM range.
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.

Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
2017-08-04 18:15:58 +00:00
Elliott Hughes
b115aefbb3 With O_TMPFILE, open(2) takes a mode argument.
Strictly, the mode isn't really meaningful unless you supply O_EXCL,
but the kernel will take it and fstat will return it even if you
never give the file a name.

Also warn for O_TMPFILE without a mode at compile time where possible.

Bug: N/A
Test: ran tests
Change-Id: I729b6d6e6190676fd017a1190b6200bf9abdbfd8
2017-08-04 10:20:18 -07:00
George Burgess IV
86e3711ea2 Merge "libc fortify: warn on open() with useless mode bits" am: cc3639b3ee am: afaabfe5ea am: 22838b563d
am: d82e094cc4

Change-Id: I0b85fbf2796d362a0236351cfe7533f89bde19c5
2017-08-04 08:02:06 +00:00
George Burgess IV
22838b563d Merge "libc fortify: warn on open() with useless mode bits" am: cc3639b3ee
am: afaabfe5ea

Change-Id: I4fe0bb7b6ab7c103f9da8c06ed35bbff7ea45381
2017-08-04 07:49:38 +00:00
George Burgess IV
afaabfe5ea Merge "libc fortify: warn on open() with useless mode bits"
am: cc3639b3ee

Change-Id: I8df1df02ef729eb79af4030c43b508ec79858def
2017-08-04 07:43:36 +00:00
Treehugger Robot
cc3639b3ee Merge "libc fortify: warn on open() with useless mode bits" 2017-08-04 07:32:27 +00:00
Jiyong Park
34a4acd801 linker: the global group is added to all built-in namespaces
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.

This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.

Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful

Merged-In: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
(cherry picked from commit 02586a2a34)
2017-08-04 14:14:09 +09:00
George Burgess IV
4e37d53f29 libc fortify: warn on open() with useless mode bits
Bug: 64132680
Test: checkbuild on bullhead internal master; no new CtsBionicTestCases
fail.

Change-Id: I98762bbee0ecdd7b4ffc21135992f2eed320317f
2017-08-03 22:04:19 -07:00
Evgenii Stepanov
97c16f8dca [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803
Change-Id: Icd7164f96aa7115b3585c21c0f68529cd2f07c11
2017-08-03 14:04:15 -07:00
George Burgess IV
6193718340 Merge "libc fortify: make string.h use diagnose_if" am: b1b125ead1 am: 5869bbe1d0 am: eaf1c56481
am: 0a1d5ac5d4

Change-Id: Ia5b0c46f94a943899f23de3fa98fae999da21b1f
2017-08-03 03:44:13 +00:00
George Burgess IV
eaf1c56481 Merge "libc fortify: make string.h use diagnose_if" am: b1b125ead1
am: 5869bbe1d0

Change-Id: I20f3e27bdfb4e4ef7d6ff2eccae5493100009454
2017-08-03 03:33:42 +00:00
George Burgess IV
5869bbe1d0 Merge "libc fortify: make string.h use diagnose_if"
am: b1b125ead1

Change-Id: I9e4508c73a83987bbd21550538ff77d6cb65cace
2017-08-03 03:29:34 +00:00
Treehugger Robot
b1b125ead1 Merge "libc fortify: make string.h use diagnose_if" 2017-08-03 03:18:44 +00:00
Jiyong Park
d741e5ef43 Merge "linker: the global group is added to all built-in namespaces" am: c9fb66209d am: ec8c79aaa1 am: 0a51b36ad6
am: e247953f1b

Change-Id: I26521ec9cc11b9ee9ce55a61ac2bfe3152a0dd7f
2017-08-03 02:47:38 +00:00
Jiyong Park
0a51b36ad6 Merge "linker: the global group is added to all built-in namespaces" am: c9fb66209d
am: ec8c79aaa1

Change-Id: Ie74a986381fe1dc7a7a5b148511a999f828dd829
2017-08-03 02:37:38 +00:00
Jiyong Park
ec8c79aaa1 Merge "linker: the global group is added to all built-in namespaces"
am: c9fb66209d

Change-Id: I9c45ba3b6878a9a098634eae4b9cb97360161495
2017-08-03 02:32:37 +00:00
Treehugger Robot
c9fb66209d Merge "linker: the global group is added to all built-in namespaces" 2017-08-03 02:23:53 +00:00
Elliott Hughes
e21ab62ead Merge "Add some <sched.h> tests." am: 26c59f7082 am: bc6d5e9288 am: 3ba8c376e8
am: 638f94522e

Change-Id: Ibff3c123814c29cec14ebedb740eef28a2cfa4f2
2017-08-02 19:56:11 +00:00
Elliott Hughes
3ba8c376e8 Merge "Add some <sched.h> tests." am: 26c59f7082
am: bc6d5e9288

Change-Id: I5f012e6a7bd5969fd9e1120e54a711d809c7271d
2017-08-02 19:47:13 +00:00
Elliott Hughes
bc6d5e9288 Merge "Add some <sched.h> tests."
am: 26c59f7082

Change-Id: I5423c0d614e7fee238f0f2980956878111604efe
2017-08-02 19:43:58 +00:00
Elliott Hughes
26c59f7082 Merge "Add some <sched.h> tests." 2017-08-02 19:28:38 +00:00
Jiyong Park
02586a2a34 linker: the global group is added to all built-in namespaces
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.

This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.

Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful

Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
2017-08-03 01:02:07 +09:00
Elliott Hughes
2950f13eef Add some <sched.h> tests.
I was intending to change our behavior to match POSIX, but reality convinced
me otherwise.

Also add missing argument names to the header file on the assumption they'll
be shown in Studio one day.

Bug: http://b/26203902
Test: ran tests
Change-Id: I2aaea48a88d408a32925033fc8f17448fb63252e
2017-08-02 09:01:42 -07:00
Elliott Hughes
762735d91c Merge "Finish <stdio_ext.h>." am: 316a44f33c am: 8f2608aba9 am: 46214ae7c1
am: e009c48b95

Change-Id: Icf5a30fc5f477ab95e53cfaddf1dd960d381784f
2017-08-02 15:21:22 +00:00
Elliott Hughes
46214ae7c1 Merge "Finish <stdio_ext.h>." am: 316a44f33c
am: 8f2608aba9

Change-Id: Ic45c4e49f90d7148e9beff562375e133b3365d0b
2017-08-02 15:13:20 +00:00
Elliott Hughes
8f2608aba9 Merge "Finish <stdio_ext.h>."
am: 316a44f33c

Change-Id: I5ec959f2a1f4090ca3852c2ec453759e5676d93c
2017-08-02 15:09:50 +00:00
Elliott Hughes
316a44f33c Merge "Finish <stdio_ext.h>." 2017-08-02 15:00:38 +00:00
George Burgess IV
f5f06d2840 Merge "libc fortify: make fcntl.h use diagnose_if" am: 5ac5a7c083 am: 96eb6cbf9a am: f7c19622a3
am: 81f733ff7c

Change-Id: I7f08342023fbb91e4ec8876e51092adadff6cd39
2017-08-02 08:26:29 +00:00
George Burgess IV
f7c19622a3 Merge "libc fortify: make fcntl.h use diagnose_if" am: 5ac5a7c083
am: 96eb6cbf9a

Change-Id: I383158d43d7cc65ef6d48c3aa8d5c9a7a264d639
2017-08-02 08:17:28 +00:00
George Burgess IV
96eb6cbf9a Merge "libc fortify: make fcntl.h use diagnose_if"
am: 5ac5a7c083

Change-Id: I2db3f6d42cbb07c703f142665fd2a0c5059f78bc
2017-08-02 08:12:28 +00:00
Treehugger Robot
5ac5a7c083 Merge "libc fortify: make fcntl.h use diagnose_if" 2017-08-02 08:06:20 +00:00
George Burgess IV
3ac2fc3f68 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" am: a821283d22 am: 1ede4abc4a am: e1ba44a473
am: b494e0b92c

Change-Id: I160fa1c1d352249b79ce88edfbdf7d562e6ae21f
2017-08-02 07:57:57 +00:00
George Burgess IV
332b8a3df2 Merge "libc fortify: make stdio.h use diagnose_if" am: 6e0de9da49 am: ced73cda27 am: 79e01ac0e6
am: 3d4a560cfd

Change-Id: Ie01ab86594beadc3e8bd81fbb38ad4efbd7b2d00
2017-08-02 07:48:57 +00:00
George Burgess IV
e1ba44a473 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" am: a821283d22
am: 1ede4abc4a

Change-Id: Iea3842667bb674cf1a9dfbec0ef3d755801d1209
2017-08-02 07:48:56 +00:00
George Burgess IV
1ede4abc4a Merge "libc fortify: make socket.h and stdlib.h use diagnose_if"
am: a821283d22

Change-Id: I818da183356943d72e96d1e2264747de6fe6a066
2017-08-02 07:43:56 +00:00
George Burgess IV
79e01ac0e6 Merge "libc fortify: make stdio.h use diagnose_if" am: 6e0de9da49
am: ced73cda27

Change-Id: I144dd0b3ad3a27394592e3ee391fbc792450a9f6
2017-08-02 07:38:56 +00:00
Treehugger Robot
a821283d22 Merge "libc fortify: make socket.h and stdlib.h use diagnose_if" 2017-08-02 07:37:46 +00:00
George Burgess IV
ced73cda27 Merge "libc fortify: make stdio.h use diagnose_if"
am: 6e0de9da49

Change-Id: Ic847d12c7822f7f8e25ec5a40e6cf7143417dad9
2017-08-02 07:33:55 +00:00
Treehugger Robot
6e0de9da49 Merge "libc fortify: make stdio.h use diagnose_if" 2017-08-02 07:27:23 +00:00
George Burgess IV
f4618c7d49 Merge "libc fortify: make poll.h and stat.h use diagnose_if" am: cff14d9e3e am: f5b6f13394 am: 910c9ec619
am: 6aee92afad

Change-Id: I8027dc2517821accf7965dfbfe5ef03602619728
2017-08-02 07:05:23 +00:00
George Burgess IV
910c9ec619 Merge "libc fortify: make poll.h and stat.h use diagnose_if" am: cff14d9e3e
am: f5b6f13394

Change-Id: I55e54e5aee89e9deb7c01f0f43fdfefe33217c45
2017-08-02 06:55:53 +00:00
George Burgess IV
f5b6f13394 Merge "libc fortify: make poll.h and stat.h use diagnose_if"
am: cff14d9e3e

Change-Id: I4cd2863d8f9d859e8441da7cc54f2fc15294b42e
2017-08-02 06:50:53 +00:00
Treehugger Robot
cff14d9e3e Merge "libc fortify: make poll.h and stat.h use diagnose_if" 2017-08-02 06:44:41 +00:00
George Burgess IV
b6300463a8 libc fortify: make string.h use diagnose_if
This also has a handful of style fixups, to make this file more
consistent. And removes __bionic_zero_size_is_okay_t, since there's a
better workaround available.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I75a020630dbab0ce828563502900cba14ae992d1
2017-08-01 22:41:11 -07:00
George Burgess IV
54f5d8331f libc fortify: make socket.h and stdlib.h use diagnose_if
Since realpath no longer needs to be overloaded, we can restore the
upstream source to purity. We'll be able to do this with most of the
other functions when we pull a newer clang in.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I484221bba0b291273fece23d2be2f5f9fd713d2c
2017-08-01 22:32:15 -07:00
George Burgess IV
23dbf82132 libc fortify: make stdio.h use diagnose_if
This also throws in some reformatting to match the GCC FORTIFY style in
this file (e.g. 4 space standard indent).

Per b/36984245, some function protos are unwrapped beyond 100 chars, as
well.

Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I6dce60ec14d5cd703d9e724699634a197ca11023
2017-08-01 22:02:31 -07:00
George Burgess IV
52dde5fb1c libc fortify: make poll.h and stat.h use diagnose_if
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I7dbdeca12c46d1ee3804f13546b11c3f3b3a7596
2017-08-01 21:32:12 -07:00
George Burgess IV
0df4c3787d libc fortify: make fcntl.h use diagnose_if
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.

Change-Id: I4a31d9e65ed5820a581261a7e8f63a83e44936c3
2017-08-01 19:55:02 -07:00
George Burgess IV
2c533726fd Merge "libc fortify: make unistd.h use diagnose_if" am: 0ec52ce15b am: a28402b431 am: d8fdc7b2b8
am: dbbc70d52d

Change-Id: I7db4b5459789b99e24d83cb6c27875d6a5cb0e5d
2017-08-01 23:29:58 +00:00
George Burgess IV
d8fdc7b2b8 Merge "libc fortify: make unistd.h use diagnose_if" am: 0ec52ce15b
am: a28402b431

Change-Id: I2732c95e39ebb3236d30cc777b2de16a0bbb46b0
2017-08-01 23:21:55 +00:00
George Burgess IV
a28402b431 Merge "libc fortify: make unistd.h use diagnose_if"
am: 0ec52ce15b

Change-Id: I1361011fc3f466f681d651f85e8e828228c77b41
2017-08-01 23:18:59 +00:00
Treehugger Robot
0ec52ce15b Merge "libc fortify: make unistd.h use diagnose_if" 2017-08-01 23:06:09 +00:00
Elliott Hughes
5ba2c21159 Finish <stdio_ext.h>.
Implement __freading and __fwriting, and clarify the documentation that was
the cause of these not being implemented for years.

Bug: http://b/17157253
Test: ran tests
Change-Id: I89542c8131b13889e2585417a024050ecf2abcb7
2017-08-01 15:27:27 -07:00
George Burgess IV
16c173935f libc fortify: make unistd.h use diagnose_if
Also:
- remove a NULL check. The bug that's been working around has been
  fixed since clang r298431, and our compiler is built from r300080, and
- unwrap some function prototypes, per b/36984245.

If you're interested, here's what a new error versus an old one looks
like: https://drive.google.com/file/d/0B-8OBPboNJ_4MVdlYXdJbUFBYUk/view

Bug: 12231437
Test: m checkbuild on bullhead internal master; CtsBionicTestCases show
no new failures.

Change-Id: Ibafe61198988b4c8bee8391bcdf01bcbc04233de
2017-08-01 20:55:30 +00:00
Elliott Hughes
54ee0025d5 Merge "Clean up some <stdio.h> constants." am: 7f86f1dd15 am: 84136f4be7 am: a67457ed3c
am: bb55a6f71f

Change-Id: Iac3e03d7d8d7f88c2cf311c54c59c892259354b9
2017-08-01 18:28:33 +00:00
Elliott Hughes
a67457ed3c Merge "Clean up some <stdio.h> constants." am: 7f86f1dd15
am: 84136f4be7

Change-Id: I9b12b7be23eac57adccfedec7d4490d1c9134156
2017-08-01 18:18:02 +00:00
Elliott Hughes
84136f4be7 Merge "Clean up some <stdio.h> constants."
am: 7f86f1dd15

Change-Id: I917e76ed6786ce08fac63f887e84c04b20cd02b8
2017-08-01 18:14:00 +00:00
Elliott Hughes
b15feb7024 Clean up some <stdio.h> constants.
And actually test an assertion rather than just state it in a comment.

Bug: N/A
Test: ran tests
Change-Id: I07699483aca4aac4e089d8b99123cb5bde9b3c63
2017-07-31 17:20:18 -07:00
Elliott Hughes
81740bfa4a Merge "POSIX getlogin_r/LOGIN_NAME_MAX/TTY_NAME_MAX." am: 8aa4bc7c55 am: b82a2d0bd5 am: a2dc76353e
am: 49006cea4d

Change-Id: I1376b39a347bf4393ae9a7189f0539fe5a98217e
2017-07-29 15:07:16 +00:00
Elliott Hughes
a2dc76353e Merge "POSIX getlogin_r/LOGIN_NAME_MAX/TTY_NAME_MAX." am: 8aa4bc7c55
am: b82a2d0bd5

Change-Id: I7ed5cd170a4b3d937ab035a08c693dc117e104c6
2017-07-29 15:01:45 +00:00
Elliott Hughes
b82a2d0bd5 Merge "POSIX getlogin_r/LOGIN_NAME_MAX/TTY_NAME_MAX."
am: 8aa4bc7c55

Change-Id: I578d3e5c096401b0447f9ed7223d3e20ffb5b19e
2017-07-29 14:59:15 +00:00
Elliott Hughes
8aa4bc7c55 Merge "POSIX getlogin_r/LOGIN_NAME_MAX/TTY_NAME_MAX." 2017-07-29 14:56:02 +00:00
Elliott Hughes
5cfc61a80b Merge "Fix the sysconf _SC_2_VERSION test." am: 3e183a5d30 am: 105e768638 am: 620e250511
am: 152d922cb6

Change-Id: Ibabdcb1465d9f7d38da066905e589306a1974ce4
2017-07-29 07:15:48 +00:00
Elliott Hughes
620e250511 Merge "Fix the sysconf _SC_2_VERSION test." am: 3e183a5d30
am: 105e768638

Change-Id: I815b4c7c6d72cd577f3f5f69ed6e36108e50dd3f
2017-07-29 07:10:16 +00:00
Elliott Hughes
105e768638 Merge "Fix the sysconf _SC_2_VERSION test."
am: 3e183a5d30

Change-Id: I384fc20676715a1385a182428e5bbd17d4e3d8e8
2017-07-29 07:07:47 +00:00
Elliott Hughes
6c135f4c41 Fix the sysconf _SC_2_VERSION test.
Not sure how this ended up broken. Too many branches!

Bug: N/A
Test: ran tests
Change-Id: Ieef1e8170c9aaf139d9e0664475ccb08b8fcdeba
2017-07-28 16:53:32 -07:00
Elliott Hughes
06bd5862b1 POSIX getlogin_r/LOGIN_NAME_MAX/TTY_NAME_MAX.
Bug: N/A
Test: ran tests
Change-Id: I97c8ecc82fb09c3fa4bb5e6f000d46f04f3d1702
2017-07-28 16:34:38 -07:00
Elliott Hughes
57ed25e792 Merge "Implement wcwidth(3) in terms of icu4c." am: bafa1985ec am: a97079d94e am: 771f21aa3d
am: c1e3784bc5

Change-Id: I55a20846f6e6124a0eed9ed847a94bf1ce43e21f
2017-07-28 22:33:10 +00:00
Elliott Hughes
771f21aa3d Merge "Implement wcwidth(3) in terms of icu4c." am: bafa1985ec
am: a97079d94e

Change-Id: I173f75c4080a61bce178ded9b2a13a1a1ba63dfc
2017-07-28 21:53:53 +00:00
Elliott Hughes
a97079d94e Merge "Implement wcwidth(3) in terms of icu4c."
am: bafa1985ec

Change-Id: Ia7e74b6124206fe5f2c5bf372c03ee5246045462
2017-07-28 21:50:26 +00:00
Elliott Hughes
c41b560f5f Implement wcwidth(3) in terms of icu4c.
Based on com.google.i18n.CharWidth by the icu-team folks.

Bug: N/A
Test: ran tests
Change-Id: Ia9d818ec4ae60f2f3978533195330d00699397c5
2017-07-27 17:08:24 -07:00
Elliott Hughes
3df35ff108 Merge "Use O_APPEND for stdio append mode." am: 38bcf2b704 am: 72f06ce7fe am: c98c910bd9
am: 7f6463e0c8

Change-Id: I3a931ca598ed18088a0be1418698f94f41499b87
2017-07-27 15:50:04 +00:00
Elliott Hughes
c98c910bd9 Merge "Use O_APPEND for stdio append mode." am: 38bcf2b704
am: 72f06ce7fe

Change-Id: I66d66f210091334c6579ecdecea6944d8dab4593
2017-07-27 15:45:08 +00:00
Elliott Hughes
72f06ce7fe Merge "Use O_APPEND for stdio append mode."
am: 38bcf2b704

Change-Id: I4e1274d93adafffc6c4795cbcb5755735533c4de
2017-07-27 15:42:52 +00:00
Elliott Hughes
33a8cb1d1a Use O_APPEND for stdio append mode.
"Although not explicitly required by this volume of POSIX.1-2008, a good
implementation of append (a) mode would cause the O_APPEND flag to be set."

Yeah, about that...

Bug: N/A
Test: ran tests
Change-Id: I23c4bc5c1ebc92e0cb44025d2d313f321f9ffa68
2017-07-25 18:11:23 -07:00
Elliott Hughes
0b18b180aa Make xfail passes not failures. am: b09c4fc957
am: 9a1df36a07

Change-Id: I3b7b93492eab22e901ada3161771b132181a580b
2017-07-25 19:23:40 +00:00
Elliott Hughes
9a1df36a07 Make xfail passes not failures.
am: b09c4fc957

Change-Id: Ie5b2746ac6be0a140c1f15679038a95b33505d08
2017-07-25 19:20:10 +00:00
Elliott Hughes
5878926f4a Merge "tests: clean up bionic-unit-tests-static linking" am: b8115bdf4f am: c5c7bee025 am: 9826cbe123
am: 25d14c2694

Change-Id: I9758d57f21499646fb4a8a721f829546b28ebd9c
2017-07-25 15:20:58 +00:00
Elliott Hughes
9826cbe123 Merge "tests: clean up bionic-unit-tests-static linking" am: b8115bdf4f
am: c5c7bee025

Change-Id: I60427adc07ffcd5e9bce33cf7e14842a911ecb49
2017-07-25 15:06:54 +00:00
Elliott Hughes
c5c7bee025 Merge "tests: clean up bionic-unit-tests-static linking"
am: b8115bdf4f

Change-Id: I851293e85617365eacdc0aa811473d5a6ebfbb1d
2017-07-25 15:00:25 +00:00
Elliott Hughes
f32d484ace tests: clean up bionic-unit-tests-static linking
Adding libc++_static explicitly is not needed when it is specified
via stl:, and was the real reason we needed --allow-multiple-definition.

Bug: N/A
Test: ran static tests (32- and 64-bit)
Change-Id: I254a4b8c4f7955a17c970d31b427b05c1a2e0acf
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
2017-07-24 16:22:17 -07:00