Commit graph

25290 commits

Author SHA1 Message Date
Logan Chien
054106bb76 Merge changes from topic "single-gsi"
* changes:
  Use ro.vndk.lite to determine the ld.config.txt
  Extract ld.config.txt lookup code
2018-05-22 04:04:07 +00:00
Logan Chien
bcfe3cf06e Use ro.vndk.lite to determine the ld.config.txt
This commit adds an extra check on `ro.vndk.lite`.  If `ro.vndk.lite` is
true, the linker will pick `/system/etc/ld.config.vndk_lite.txt`.

The purpose of this change is to distinguish:

1. Master-GSI + Master-VENDOR (w/o BOARD_VNDK_VERSION for upgrading devices)
2. Master-GSI + O-MR1-VENDOR (w/ BOARD_VNDK_VERSION)

Bug: 78605339
Test: aosp_sailfish Master-SYSTEM + Master-VENDOR boots
Test: aosp_sailfish Master-GSI    + Master-VENDOR boots
Test: aosp_walleye  Master-SYSTEM + Master-VENDOR boots
Test: aosp_walleye  Master-GSI    + Master-VENDOR boots
Test: aosp_walleye  Master-GSI    + O-MR1-VENDOR boots
Change-Id: I34f243f73c173ca2e882d3738ccb81e3fad3a9da
Merged-In: I34f243f73c173ca2e882d3738ccb81e3fad3a9da
(cherry picked from commit dd18472e56)
2018-05-17 14:27:00 +08:00
Logan Chien
886b96ef9a Extract ld.config.txt lookup code
This commit extracts ld.config.txt lookup code into
`get_ld_config_file_path()`.

Bug: 78605339
Test: aosp_walleye-userdebug builds and boots
Change-Id: I129f19cd032de02a56bda57231521c02a4b4e4c0
Merged-In: I129f19cd032de02a56bda57231521c02a4b4e4c0
(cherry picked from commit 21e496cf29)
2018-05-17 14:26:54 +08:00
Tom Cherry
903e5702f4 Merge "Require vendor users and groups to start with vendor_" 2018-05-16 16:19:28 +00:00
Tom Cherry
c2b9fec50b Require vendor users and groups to start with vendor_
Require that users and groups found in /vendor/etc/{passwd,group}
start with vendor_.  This is needed to compliance with Treble as
without this prefix, it is possible for a new system image to create a
user/group name that a vendor has already used, causing a collision.

Bug: 79528966
Test: new unit test
Change-Id: I07500641e165f41526a8101592d83fa174e7a711
2018-05-15 14:10:21 -07:00
Elliott Hughes
af2eb6f40a Merge changes I8eae0c98,I09d32dcb
* changes:
  vdso should be available in all namespaces
  Unhardcode /system/lib
2018-05-12 15:51:10 +00:00
dimitry
8b142566e3 vdso should be available in all namespaces
vdso should be available in all namespaces when present. This
bug went undetected because the way libc currently uses vdso (it
does all the lookups itself). This makes it available for the
programs that want to take advantage by dlopening it.

Bug: http://b/73105445
Bug: http://b/79561555
Test: adb shell /data/nativetest/arm/bionic-unit-tests/bionic-unit-tests --gtest_filter=dl.exec_with_ld_config_file
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests --gtest_filter=dl*
Change-Id: I8eae0c9848f256190d1c9ec85d10dc6ce383a8bc
(cherry picked from commit 69c68c46ac)
2018-05-12 10:58:00 +02:00
dimitry
e0906d8f55 Unhardcode /system/lib
Default search path may be different for native bridged enviroments

Bug: http://b/73105445
Test: adb shell /data/nativetest/arm/bionic-unit-tests/bionic-unit-tests --gtest_filter=dl.exec_with_ld_config_file
Change-Id: I09d32dcb8a7a3f161ccc6d58c29252e79ea5fd3e
(cherry picked from commit 1280cf5fd8)
2018-05-12 10:57:46 +02:00
Elliott Hughes
3f185dc01e Merge changes I8693c641,I9efbc23b,Ifa03eb36
* changes:
  Switch to FreeBSD's actual sincos.
  Switch to FreeBSD catrigl.c for complex arc trig functions.
  Update libm from upstream.
2018-05-12 00:48:08 +00:00
Christopher Ferris
47eba63c5b Merge "Add support for cortex-a55/cortex-a75." 2018-05-11 17:56:12 +00:00
Christopher Ferris
4da58cf630 Add support for cortex-a55/cortex-a75.
Bug: 78133793
Bug: 78242072

Test: Builds and ran to verify best libc routines.
Change-Id: I2299b8f0f6379c9003072764978ea917b74aee4f
Merged-In: I2299b8f0f6379c9003072764978ea917b74aee4f
(cherry picked from commit 3162eb3b81)
2018-05-11 00:43:01 +00:00
Treehugger Robot
62a93ee1a0 Merge "Fix typo in comment" 2018-05-10 22:18:26 +00:00
Tom Cherry
e267f1a7aa Fix typo in comment
Test: n/a
Change-Id: I2a869ad920a9867fda9864e11fdaa0d66611b181
2018-05-10 20:41:44 +00:00
Treehugger Robot
182523798c Merge "Remove obsolete workaround." 2018-05-10 02:35:48 +00:00
Elliott Hughes
e332f658e0 Switch to FreeBSD's actual sincos.
Before:
  BM_math_sin_fast                48 ns         48 ns   14693053
  BM_math_sincos                  61 ns         61 ns   11470219

After:
  BM_math_sin_fast                48 ns         48 ns   14725120
  BM_math_sincos                  43 ns         43 ns   16329843

Bug: N/A
Test: ran tests, benchmarks
Change-Id: I8693c64135233c0641af5302c38748f47ac76737
2018-05-09 12:25:12 -07:00
Elliott Hughes
0364a4b446 Switch to FreeBSD catrigl.c for complex arc trig functions.
Bug: N/A
Test: ran tests
Change-Id: I9efbc23bc101fcf04a01334748461f5467dcf85e
2018-05-09 12:24:28 -07:00
Elliott Hughes
8da8ca4528 Update libm from upstream.
Bug: N/A
Test: ran tests
Change-Id: Ifa03eb36d412a2776208cd2921936be4724e5547
2018-05-09 12:24:21 -07:00
Elliott Hughes
c01b849c9a Remove obsolete workaround.
We removed the cast in question in
d390df1dbc.

Bug: N/A
Test: builds
Change-Id: I56a034432fd11aeca00c09cb11226bdae465366f
2018-05-09 09:54:30 -07:00
Elliott Hughes
68e1c5b752 Merge "Fix various ftw/nftw "shall fail"s from POSIX." 2018-05-09 15:27:50 +00:00
Lorenzo Colitti
84e253ad35 Merge "fchown DNS lookup sockets to AID_DNS." 2018-05-09 10:32:56 +00:00
Elliott Hughes
70a8f2272e Fix various ftw/nftw "shall fail"s from POSIX.
POSIX says ftw/nftw "shall fail" in various cases where BSD's fts_open
doesn't. Since our ftw/nftw are written in terms of fts_open, add a back
door so we can hint to ourselves when we should have the POSIX semantics.

Also pull several O_CLOEXEC and don't-null-check-before-free cleanups
from upstream, and add a couple of tests.

Bug: http://b/31152735
Test: ran bionic tests and LTP "nftw01" test
Change-Id: Ib05facacc1da4c8b2ab48e9ecce88f11a5406630
2018-05-08 15:20:07 -07:00
Lorenzo Colitti
5f02720c88 fchown DNS lookup sockets to AID_DNS.
Currently DNS lookups are all sent as UID 0. In N we added an
AID_DNS user, but we never used it. A separate UID allows us to
account for and route DNS traffic differently from other UID 0
traffic such as kernel-originated traffic.

Bug: 70673901
Test: DNS lookups continue to work
Test: netd_{unit,integration}_test pass
Change-Id: Ife3ca7df45de51b92437d2cfe627fb4703b672fb
2018-05-09 01:04:05 +09:00
Christopher Ferris
1d509bc878 Merge "Fix bug in --bionic_cpu option handling." 2018-05-07 18:14:48 +00:00
Evgeny Eltsin
ada3fef941 Merge "Add a warm up pass to pthread_leak.join test" 2018-05-07 13:07:13 +00:00
Evgeny Eltsin
284c4fdc39 Add a warm up pass to pthread_leak.join test
Bug: 73105445
Bug: 37920774
Test: bionic-unit-tests --gtest_filter=pthread_leak*
Change-Id: I227c999ecc13ee0a2136ff6b00a722f135dd48fe
(cherry picked from commit 775fb09621)
2018-05-07 13:16:16 +02:00
Christopher Ferris
bfb7c761d4 Fix bug in --bionic_cpu option handling.
Make sure that all the variables are properly initialized.

Remove the code that verifies the core to enable using get_schedaffinity
since that make it impossible to change the cpu for different tests.

Change the cpu_to_lock to an int, it really didn't need to be a long.

Fix a few missing tests.

Test: Ran unit tests.
Test: Built the tests and ran on different cpus, verifying that the
Test: chosen cpu was correct.
Test: Created an xml file that had different cpus for different tests
Test: and verified that it locked to each cpu properly.
Change-Id: Ie7b4ad8f306f13d6e968d118e71bb5dc0221552a
2018-05-04 17:34:35 -07:00
Elliott Hughes
7eb976e00d Merge "Document the historical dlopen issues." 2018-05-02 21:54:15 +00:00
Christopher Ferris
5a6c866dd5 Merge "Fix nullptr dereference during sort." 2018-05-02 20:18:18 +00:00
android-build-prod (mdb)
cf4b4706be Merge "Fix PROP_FILENAME_MAX overflow handling" 2018-05-02 05:24:50 +00:00
android-build-prod (mdb)
a48aa64e04 Merge "Fix async_safe_fatal overflow handling" 2018-05-02 02:57:41 +00:00
Ryan Prichard
d91285f166 Fix PROP_FILENAME_MAX overflow handling
Bug: b/79117743
Test: /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Change-Id: Idd5aa4d195abc13c06d3e5b57aef69a68c2a9a9d
2018-05-01 18:19:21 -07:00
Ryan Prichard
5258c2518e Fix async_safe_fatal overflow handling
Bug: b/79116392
Test: manual
Change-Id: I46cd1007be165489db27cdcd4b42ec69de40d645
2018-05-01 17:59:59 -07:00
Elliott Hughes
52aab72f33 Merge "Document FORTIFY." 2018-05-01 22:59:23 +00:00
Christopher Ferris
c151bc3078 Fix nullptr dereference during sort.
Add new unit test that will crash without this fix.

Bug: 78900050

Test: Ran unit tests.
Change-Id: I73e1b89e965a7b399822c3a6f25cbc70d2d355e2
2018-05-01 14:49:15 -07:00
Elliott Hughes
07f62385b6 Document FORTIFY.
Hilariously, our blog post didn't actually say how to turn it on :-)

Bug: N/A
Test: N/A
Change-Id: I6e773e88c32a70b0f8b8b6d105fce74d68ebf5cd
2018-05-01 13:13:47 -07:00
Elliott Hughes
dc66073417 Document the historical dlopen issues.
Bug: https://groups.google.com/forum/#!topic/android-ndk/OJxg_550eHE
Test: N/A
Change-Id: Ife066dcd3af89952f81f0aefc33351c59b83be9b
2018-05-01 11:27:46 -07:00
Dimitry Ivanov
a27cadfa5f Merge "Libraries without dt_soname are inaccessible" 2018-04-30 09:13:23 +00:00
dimitry
7217a092a6 Libraries without dt_soname are inaccessible
When linker tries to check if a library without dt_soname is accessible
it crashes. This change fixes this problem to return false instead
(making them inaccessible from other namespaces)

This went unnoticed because vendor libraries on current
devices all have dt_soname set. This was only discovered
on one of the newer devices which has a vendor prebuilt
library without a soname.

Bug: http://b/78661414
Bug: https://issuetracker.google.com/77287902
Test: cts-tradefed run commandAndExit cts -m CtsJniTestCases
Change-Id: Idb192b4ed7a810840ba2a9177bad2360ffbb75e2
(cherry picked from commit 94f7a87510)
2018-04-29 13:39:46 +02:00
Elliott Hughes
8602538a15 Merge "Fix sysconf errno for unknown names." 2018-04-26 18:09:31 +00:00
Elliott Hughes
d6f57306d2 Fix sysconf errno for unknown names.
The code (and comment) have been like this since the initial commit, but
there was never a test of this, and glibc seems to have been returning
EINVAL (as POSIX says it should) since long before Android existed.

Bug: http://b/31154352
Test: ran tests
Change-Id: Ica1ea836a4a5699ef0d956fe9c0f322e567de34d
2018-04-25 22:13:14 -07:00
Christopher Ferris
6c4e77dd4a Merge "Remove ion.h from bionic uapi headers." 2018-04-25 21:00:59 +00:00
Christopher Ferris
5ed15ba733 Remove ion.h from bionic uapi headers.
Bug: 77976082

Test: Ran the generate script and verified ion.h is deleted.
Change-Id: I33b3aeef66f08f35dd496a073931b2fe2c80a1d6
2018-04-24 13:33:30 -07:00
Treehugger Robot
67b5979930 Merge "Add __libc_add_main_thread and mark it weak" 2018-04-22 17:27:34 +00:00
Evgeny Eltsin
47e41c8d24 Add __libc_add_main_thread and mark it weak
This complements __libc_init_main_thread in setting up main thread
under native bridge.

Test: run_tests
Bug: 77877742
Change-Id: I53efab66f285a1b9f0ab36d44386fa1e2621e4ba
(cherry picked from commit 4c9504aa6c)
2018-04-22 17:55:50 +02:00
Treehugger Robot
97ef43553a Merge "Revert "Add 64-bit slm optimized strlcpy and srlcat."" 2018-04-20 22:35:11 +00:00
Treehugger Robot
56aa9cb041 Merge "Fix posix_memalign introduced tag." 2018-04-20 19:38:05 +00:00
Dan Albert
e219cefc17 Fix posix_memalign introduced tag.
Apparently this didn't make it to all android-16 devices. As far as
we know it did make it for all android-17 devices.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/647
Change-Id: I2f07cfb1254e2a203c1c10b91b0be46bf37ea853
2018-04-20 10:46:16 -07:00
Treehugger Robot
6880f93617 Merge "Disable lld, failed to link bionic/linker." 2018-04-16 23:04:06 +00:00
Treehugger Robot
6c1d847514 Merge "Disable lld, libc_malloc_debug failed to boot." 2018-04-16 19:20:39 +00:00
Chih-hung Hsieh
f0abf07034 Merge "allow_undefined_symbols to link libelf-tls-library" 2018-04-16 17:54:50 +00:00