Commit graph

24773 commits

Author SHA1 Message Date
Elliott Hughes
40a3e3b78c Merge "Start de-duplicating the regular and wide printf implementations."
am: 46621f43b0

Change-Id: I070b2ac9371c19fabb2683f7f867281ea07b2ccf
2017-11-02 15:49:03 +00:00
Elliott Hughes
46621f43b0 Merge "Start de-duplicating the regular and wide printf implementations." 2017-11-02 15:44:32 +00:00
Elliott Hughes
9ecd2cc0a2 Test __fpclassify/__isinf/__isnan.
These are obsolete aliases for equally obsolete functions, but apps built
with old versions of the NDK might still be emitting references to them.

Bug: N/A
Test: ran tests
Change-Id: I6eab910e3cd4d322604167799e83b5b7411c04c3
2017-11-01 22:17:26 -07:00
Chih-hung Hsieh
e87dda9b1b Merge "Use -Werror in bionic/tests"
am: 261dbdf1d0

Change-Id: I664f9c3297eb43ba54819ce12fc64cb69ca0ec8d
2017-11-02 02:21:45 +00:00
Chih-hung Hsieh
261dbdf1d0 Merge "Use -Werror in bionic/tests" 2017-11-02 02:16:46 +00:00
Elliott Hughes
2f9c8ce38a Start de-duplicating the regular and wide printf implementations.
This patch switches to C++ (in anticipation of needing it later), removes
a little duplication (via a macro for now), and ensures uniform support
for %C/%lc and %S/%ls between regular and wide (with new tests).

Since it's so hard to debug problems in printf (as the time I've wasted
already today will testify), that's all I want to do in this change. The
other 500 lines of diff can wait...

(Also merge "floatio.h" into "local.h" now all the users are in forked
code.)

Bug: http://b/67371539
Test: ran tests
Change-Id: I083353d89c32b9302d759ca6967cc6d8a62cd8a5
2017-11-01 18:13:36 -07:00
Josh Gao
539a2a099b Merge changes from topic "versioner_cpp"
am: 48228fb572

Change-Id: I1c60aca41344a54332c2a78b643f81ffa140ee1e
2017-11-01 22:54:43 +00:00
Treehugger Robot
48228fb572 Merge changes from topic "versioner_cpp"
* changes:
  versioner: compile headers in both C and C++ mode.
  versioner: follow __asm__ labels.
2017-11-01 22:33:10 +00:00
Chih-Hung Hsieh
b1cc5bd276 Use -Werror in bionic/tests
* Should not use -Wno-error

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I92552b0d9860835216500c4f57574cd2928b24f1
2017-11-01 14:13:24 -07:00
Elliott Hughes
6e765912d6 Merge "Add missing ELF constants from the spec."
am: 0cbbdaa5cf

Change-Id: I1908eec20adaddfd463aaa767dd98e8bd092b2d4
2017-11-01 15:35:31 +00:00
Elliott Hughes
0cbbdaa5cf Merge "Add missing ELF constants from the spec." 2017-11-01 15:32:39 +00:00
Elliott Hughes
0c45d2bdbd Merge "elf.h: add STN_UNDEF"
am: b1ba8cfffb

Change-Id: I7269086d7fcae3ffa2dae4c5faa227de9417b4e5
2017-11-01 00:27:35 +00:00
Elliott Hughes
a8a23f520e Add missing ELF constants from the spec.
Also add links to the relevant documentation.

Bug: N/A
Test: builds
Change-Id: I65b1a1ec0c63e1f07749ab4e4b0cf3905acc1df7
2017-10-31 17:26:48 -07:00
Elliott Hughes
b1ba8cfffb Merge "elf.h: add STN_UNDEF" 2017-11-01 00:23:57 +00:00
Elliott Hughes
3d878e72cc Merge "More missing _unlocked <stdio.h> functions."
am: 07e412419b

Change-Id: Ic9040365b27c1e770e31f798ec50bc825427ca42
2017-10-31 22:50:27 +00:00
Treehugger Robot
07e412419b Merge "More missing _unlocked <stdio.h> functions." 2017-10-31 22:43:34 +00:00
George Burgess IV
e7ac46e18d Merge "Rename the fortify compile-time diags test"
am: 555a6d19c8

Change-Id: I3131bc0cbe86ef3d14a0dc4e572091d5e604046f
2017-10-31 22:37:09 +00:00
Elliott Hughes
0d2120d057 Merge "clang-format the printf/scanf implementation."
am: c905afa1f2

Change-Id: I92ccb3c4c7602afc637976791d1f7f9a9890c281
2017-10-31 22:36:30 +00:00
Treehugger Robot
555a6d19c8 Merge "Rename the fortify compile-time diags test" 2017-10-31 22:13:03 +00:00
Treehugger Robot
c905afa1f2 Merge "clang-format the printf/scanf implementation." 2017-10-31 22:11:46 +00:00
Greg Hackmann
8874d88083 elf.h: add STN_UNDEF
ELF uses index STN_UNDEF = 0 for undefined symbols.  glibc and musl
define this constant in elf.h, and it's needed to build the kernel's
vDSO selftest suite.

Test: Overwrite elf.h in standalone NDK toolchain, then
	cd $kernel/tools/testing/selftests/vDSO && \
	make CC="aarch64-linux-android-gcc -pie" vdso_test
Change-Id: I495586e9ca43d2f0d148ded9f4bd61ec8d14d53b
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2017-10-31 13:52:45 -07:00
Elliott Hughes
37ad959783 More missing _unlocked <stdio.h> functions.
Also simplify trivial one-liners like perror/puts/fputs, and clean up
fread/fwrite slightly.

Fix perror to match POSIX.

Add basic perror and *_unlocked tests.

Bug: N/A
Test: ran tests
Change-Id: I63f83c8e0c15c3c4096509d17421ac331b6fc23d
2017-10-31 13:23:41 -07:00
George Burgess IV
0086fc813e Rename the fortify compile-time diags test
Following up on comments from I40c66ff9e638b306878ada006bc2c98f2346e77a.
My best attempt at a name that conveys "a test that fails to compile in
N different ways with FORTIFY enabled, and is intended to be used with
either FileCheck, or as a cheap way to check that FORTIFY is getting
properly disabled given some set of flags."

Bug: None
Test: mma.
Change-Id: I6d62875bd1cabc5d01b10ae0f03accd5ee5c8c0a
2017-10-31 13:14:56 -07:00
Elliott Hughes
c8f2c520fa clang-format the printf/scanf implementation.
Bug: N/A
Test: builds
Change-Id: I490fdc1d568cba901c123b9efe0b9053b0d83b64
2017-10-31 13:07:51 -07:00
Elliott Hughes
6d91895472 Merge "Remove some always-on #ifdefery."
am: f6dfe57e41

Change-Id: Iadc9e8e8c76cdb512ddff1cb936878a8309449db
2017-10-31 18:39:32 +00:00
Treehugger Robot
f6dfe57e41 Merge "Remove some always-on #ifdefery." 2017-10-31 18:26:30 +00:00
George Burgess IV
aff2fea5a3 Merge "libc: Disable FORTIFY if we're using clang-tidy."
am: 9fe034b7bb

Change-Id: I5062ffa7b7d46a5d2cddfb12e2ae4c2760bde09a
2017-10-31 17:46:23 +00:00
Treehugger Robot
9fe034b7bb Merge "libc: Disable FORTIFY if we're using clang-tidy." 2017-10-31 17:36:18 +00:00
Elliott Hughes
d9a7de1b77 Remove some always-on #ifdefery.
Bug: N/A
Test: ran tests
Change-Id: I02d3c0a639f48ae9c415fb59f37ade015e6f46a2
2017-10-31 09:55:40 -07:00
George Burgess IV
e5d66eb86a libc: Disable FORTIFY if we're using clang-tidy.
Having FORTIFY enabled for clang-tidy adds no value, and breaks some
heuristics for recognizing standard library functions (see the bug).

This also disables FORTIFY for the static analyzer (which we use
through clang-tidy), because it presumably tries to recognize standard
library functions through similar heuristics.

Bug: 36664104
Test: mma with and without the patch to cdefs. New test breaks without.
Change-Id: I40c66ff9e638b306878ada006bc2c98f2346e77a
2017-10-30 22:30:40 -07:00
Elliott Hughes
996fa31441 Merge "Fork vfprintf.c/vfwprintf.c."
am: 8142b5c5b0

Change-Id: I8fa8faaf919c10567df4270d89df6deba664bd4f
2017-10-31 01:36:46 +00:00
Treehugger Robot
8142b5c5b0 Merge "Fork vfprintf.c/vfwprintf.c." 2017-10-31 01:28:21 +00:00
Josh Gao
ab25d0bd10 versioner: compile headers in both C and C++ mode.
Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Change-Id: Ib572a8fdcc00f6b88a25003a085b16ce9698d692
2017-10-30 12:47:24 -07:00
Josh Gao
38685e1887 versioner: follow __asm__ labels.
Attribute the versioning information on `void foo() __asm("bar")` to
bar, not foo.

The various long double functions in <math.h> run into this.

Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Test: m
Change-Id: Idd3681ddbd006b4705608449935c9cfacfa3556e
2017-10-30 12:47:24 -07:00
Elliott Hughes
9c7b218082 Merge "Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32."
am: 82e6ad1242

Change-Id: Icc16561fdd31edd2355e1d35a7f6d3b1810069a7
2017-10-30 18:49:24 +00:00
Elliott Hughes
3a589c2362 Fork vfprintf.c/vfwprintf.c.
Future changes will start reducing the duplication...

Bug: http://b/67371539
Test: ran tests
Change-Id: I477afea34f9e1f41817823984bd0548944ee5eec
2017-10-30 11:43:58 -07:00
Elliott Hughes
82e6ad1242 Merge "Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32." 2017-10-30 18:34:31 +00:00
Elliott Hughes
7a66066e66 Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32.
LP32 continues to ignore failures to set scheduler attributes for
backwards compatibility with pre-Honeycomb bugs :-(

Bug: http://b/68486614
Test: ran tests (32-bit and 64-bit!)
Change-Id: I18a012cdf2f3c5bb63a5367bca2bac2de7f53ae2
2017-10-30 09:26:06 -07:00
Elliott Hughes
7920e02b95 Merge "Preserve historical pthread_create scheduler behavior better."
am: e379a20250

Change-Id: I01751f190a8c927502833794b58013161b710062
2017-10-28 17:26:51 +00:00
Elliott Hughes
e379a20250 Merge "Preserve historical pthread_create scheduler behavior better." 2017-10-28 17:19:06 +00:00
Elliott Hughes
38f01e05ef Preserve historical pthread_create scheduler behavior better.
At the cost of two flag bits for what POSIX thinks should be a boolean
choice, plus somewhat confusing behavior from pthread_attr_getinheritsched
depending on when you call it/what specific scheduler attributes you've
set in the pthread_attr_t, we can emulate the old behavior exactly and
prevent annoying SELinux denial spam caused by calls to sched_setscheduler.

Bug: http://b/68391226
Test: adb logcat on boot contains no sys_nice avc denials
Change-Id: I4f759c2c4fd1d80cceb0912d7da09d35902e2e5e
2017-10-27 15:40:15 -07:00
dimitry
4e156b5f52 Merge "Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols"
am: dfece7a3ee

Change-Id: Ia5222f6835af817ec8b3a93e7696112b6a8f1265
2017-10-27 17:57:27 +00:00
Treehugger Robot
dfece7a3ee Merge "Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols" 2017-10-27 17:47:32 +00:00
dimitry
4c7d6b6c88 Merge "Log dlclose calls and library unloads"
am: 6bffdad25b

Change-Id: If3ec22068dd9f00224dc80932c8f81a8f9e42f2b
2017-10-27 17:43:59 +00:00
Treehugger Robot
6bffdad25b Merge "Log dlclose calls and library unloads" 2017-10-27 17:32:13 +00:00
dimitry
c92ce715c5 Log dlclose calls and library unloads
Bug: http://b/29458203
Bug: http://b/68262627
Test: make && run bionic-unit-tests
Test: set debug.ld.all to dlopen and check the logs
Change-Id: I9a5495843a4145f267cc3a4714294d05b1e1fe90
2017-10-27 15:38:15 +02:00
dimitry
fa432524a6 Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols
To make it easier for Native Bridge implementations
to override these symbols.

Bug: http://b/67993967
Test: make
Change-Id: I4c53e53af494bca365dd2b3305ab0ccc2b23ba44
2017-10-27 10:01:46 +02:00
Elliott Hughes
09d4391076 Merge "Don't allow LIBC_DEBUG_MALLOC_OPTIONS to cross security boundaries."
am: ae7483db2a

Change-Id: I6cb8344d234b79475b3d668b17e2c97a54f3ec54
2017-10-27 03:40:37 +00:00
Treehugger Robot
ae7483db2a Merge "Don't allow LIBC_DEBUG_MALLOC_OPTIONS to cross security boundaries." 2017-10-27 03:28:23 +00:00
Elliott Hughes
343d1c4953 Don't allow LIBC_DEBUG_MALLOC_OPTIONS to cross security boundaries.
Bug: http://b/68003719
Test: LIBC_DEBUG_MALLOC_OPTIONS=isbad1 MALLOC_CONF=isbad2 su 0 /system/bin/sh -c '/system/bin/echo opt=$LIBC_DEBUG_MALLOC_OPTIONS conf=$MALLOC_CONF'
Change-Id: I796cc21b230a96cb0ed87d02ddcb1706a7749a90
2017-10-26 18:25:19 -07:00