Commit graph

15742 commits

Author SHA1 Message Date
Hung-ying Tyan
0ebe2f07c3 Merge "Add /odm/lib to shared lib search path" 2015-11-19 16:38:51 +00:00
Junichi Uekawa
313632db57 Merge "Do not depend on host bits to get the right size to write." 2015-11-19 12:44:19 +00:00
Junichi Uekawa
ff35b1e659 Do not depend on host bits to get the right size to write.
x86_64 32-bit or 64-bit relocations do not depend on ELF bit size, they
are 32-bit or 64-bit respectively.

Known compiler that emits such code is nacl-clang which emits
R_X86_64_PC32 which should write 32 bits but ended up writing 64 bits.

Change-Id: Ibb6b484c0fea6a7e291362148e8ac749d6674529
2015-11-19 11:28:20 +09:00
Yabin Cui
2c09e5de29 Merge "Implement pthread spin." 2015-11-19 01:55:37 +00:00
Yabin Cui
ea5bb151af Merge "Avoid tsan warning about pthread_mutex_destroy." 2015-11-19 01:55:25 +00:00
Yabin Cui
fe3a83a934 Implement pthread spin.
In order to run tsan unit tests, we need to support pthread spin APIs.

Bug: 18623621
Bug: 25392375
Change-Id: Icbb4a74e72e467824b3715982a01600031868e29
2015-11-18 17:51:21 -08:00
Hung-ying Tyan
f74b041cce Add /odm/lib to shared lib search path
ODM's shared libs should live in /odm/lib on the ODM partition.

BUG: 25654402
Change-Id: I3f5c26f208af87ff2817e490e51d0b4f5b8ec98e
2015-11-18 23:45:25 +08:00
Dimitry Ivanov
63f0e0db76 Merge "Ignore target sdk version for the public namespace" 2015-11-18 03:43:59 +00:00
Dmitriy Ivanov
3cc35e224c Ignore target sdk version for the public namespace
This fixes the bug with using the libraries loaded
prior to android_set_target_sdk_version call.

Bug: http://b/22548808
Change-Id: I3ca2d367b0fa930a437bbb65f780834803d2ef0a
2015-11-17 18:45:12 -08:00
Yabin Cui
0307eee293 Avoid tsan warning about pthread_mutex_destroy.
If calling pthread_mutex_trylock from pthread_mutex_destroy, tsan
warns about an attempt to destroy a locked mutex.

Bug: 25392375
Change-Id: I5feee20e7a0d0915adad24da874ec1ccce241381
2015-11-17 16:17:44 -08:00
Yabin Cui
b804b9d67b Merge "Implement pthread barrier." 2015-11-17 00:22:54 +00:00
Dimitry Ivanov
3c8c16022a Merge "Remove the warning about empty LD_LIBRARY_PATH" 2015-11-16 22:25:50 +00:00
Dmitriy Ivanov
fbfba64068 Remove the warning about empty LD_LIBRARY_PATH
Change-Id: I3eca11512d8055ab94dd0a6badcd83ce6440d675
2015-11-16 14:23:37 -08:00
Yabin Cui
e7c2fffa16 Implement pthread barrier.
Bug: 24341262
Change-Id: I5472549e5d7545c1c3f0bef78235f545557b9630
2015-11-16 14:02:26 -08:00
Chih-hung Hsieh
949bfb9e3c Merge "Enable clang to compile more tests." 2015-11-16 21:31:36 +00:00
Dimitry Ivanov
61f186d067 Merge "Fix arm64 and x86 builds" 2015-11-16 21:23:18 +00:00
Dmitriy Ivanov
d9b08a0bc0 Fix arm64 and x86 builds
Change-Id: Ic3746b2f200f42218b6ac857c1631e873c767c17
2015-11-16 13:17:27 -08:00
Dimitry Ivanov
1f0ccbb59c Merge "Introducing linker namespaces" 2015-11-16 20:14:37 +00:00
Chih-Hung Hsieh
1e79540807 Enable clang to compile more tests.
* Disable optimization only in gtest.h of atexit_test.c for arm/aarch64
  to keep VTT for std::__1::basic_stringstream<char, std::__1::char_traits<char>,
  std::__1::allocator<char> > to link with g++ compiled modules.
* bionic-unit-tests source files are not affected by clang x86_64 fp128 bug
  so they can be compiled with clang.

BUG: 25643775
Change-Id: I3da2a0de61edcdca07b7fcd73a16de9da4a1f7d6
2015-11-16 11:36:15 -08:00
Dmitriy Ivanov
42d5fcb9f4 Introducing linker namespaces
Bug: http://b/22548808
Change-Id: Ia3af3c0a167f1d16447a3d83bb045d143319b1e1
2015-11-15 12:09:16 -08:00
Elliott Hughes
1b42c54471 Merge "Improve libc time zone fallback behavior." 2015-11-13 18:24:41 +00:00
Elliott Hughes
d1c28a361b Improve libc time zone fallback behavior.
We should fall back to GMT if neither the environment variable nor the
system property is set. This is the case if you wipe a WiFi-only device,
because we currently only take the time zone from cell networks.

Bug: http://b/24773112
Change-Id: I90d236d4d492b6562d75021bd312030b91c1e298
2015-11-13 08:38:48 -08:00
Elliott Hughes
5780f9d809 Merge "Fix strftime if tm_zone is null." 2015-11-13 02:58:30 +00:00
Nick Kralevich
4ea67f6950 Merge "FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc" 2015-11-13 01:09:44 +00:00
Elliott Hughes
a9cac4c87a Fix strftime if tm_zone is null.
Upstream tzcode said "On platforms with tm_zone, strftime.c now assumes it
is not NULL". Which is fine for any struct tm generated by tzcode, but not
necessarily true of a struct tm constructed by arbitrary code. In particular,
Netflix on Nexus Player was failing to start because they format "%Z" with
a struct tm whose tm_zone is null (the other fields are valid, but, yeah,
that's probably not intentional).

glibc takes a null tm_zone to mean "the current time zone", so let's do that
too. (Historically Android would use the empty string, and POSIX doesn't
clarify which of this is the appropriate behavior when tm_zone is null.)

Bug: http://b/25170306
Change-Id: Idbf68bfe90d143aca7dada8607742905188b1d33
2015-11-12 16:51:31 -08:00
Nick Kralevich
2ed1b29d00 FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc
The default compiler is clang. We need to explicitly indicate
that we should use gcc.

Change-Id: I37859c2e303f2a86a2565fe72eda1fda7c557a59
2015-11-12 15:55:13 -08:00
Chih-hung Hsieh
7c10ee9473 Merge "Still cannot compile with clang on arm64." 2015-11-12 20:45:48 +00:00
Chih-Hung Hsieh
c04647f8c2 Still cannot compile with clang on arm64.
When __cxa_thread_atexit_impl.cpp is compiled with clang on arm64,
Android cannot boot up.

BUG: 25662915
Change-Id: If997b544f43e956172ce605d86fe147d42fd39e0
2015-11-12 12:39:13 -08:00
Chih-hung Hsieh
0c447053de Merge "Enable clang for modules failed with TLS." 2015-11-12 01:04:51 +00:00
Elliott Hughes
dbc6398e95 Merge "Clean up pthread_gettid_np test." 2015-11-12 00:59:08 +00:00
Chih-Hung Hsieh
5058a005b8 Enable clang for modules failed with TLS.
New 3.8 clang/llvm can compile TLS code now.
* For x86_64, still disable clang due to f128 bug.
* For b/25643775, arm and arm64, disable clang in unit tests.
* Fix thread_local_test.cpp to compile with clang and
  limit gcc workaround only to arm and aarch64.

BUG: 25643775

Change-Id: Iecd006bf1fc417dbcce2c63343a59c4bf1fa77ea
2015-11-11 16:22:38 -08:00
Josh Gao
b03e6bf924 Merge "Add 100 column limit to .clang-format." 2015-11-11 22:22:59 +00:00
Josh Gao
615f3aa8b4 Add 100 column limit to .clang-format.
Change-Id: I3c3fa5e61cfb2af7f2888dcee56229692ec1479c
2015-11-11 14:21:09 -08:00
Elliott Hughes
f208361b2b Clean up pthread_gettid_np test.
Change-Id: I0fad26c7824981bfa3ad3a8a0b28a1984062dcd1
2015-11-11 13:32:28 -08:00
Elliott Hughes
ffe5c24c86 Merge "Fix potential race condition on CTS TC pthread_gettid_np" 2015-11-11 21:21:33 +00:00
Junjie Hu
de1246202a Fix potential race condition on CTS TC pthread_gettid_np
Root cause:
If start_routine thread exits before pthread_gettid_np is invokded, the "tid" field
will be cleared so that pthread_gettid_np will get "0" (which is cleared by kernel, 
due to the flag "CLONE_CHILD_CLEARTID" is set while calling clone system call inside
pthread_create).

Proposed patch:
Use a mutex to guarantee pthread_gettid_np will be invoked and returned before the
start_routine exits

Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>

Change-Id: I22411f1b0f7446d76a0373cef4ccec858fac7018
(cherry picked from commit 4f80102935)
2015-11-11 21:21:21 +00:00
Nick Kralevich
6209b99a73 Merge "libc_init_common.cpp: Clarify when environment stripping occurs" 2015-11-11 02:06:59 +00:00
Nick Kralevich
2fb02651c8 libc_init_common.cpp: Clarify when environment stripping occurs
The current comment implies that we only strip sensitive
environment variables on executing a setuid program. This is
true but incomplete. The AT_SECURE flag is set whenever a
security transition occurs, such as executing a setuid program,
SELinux security transition, executing a file with file capabilities,
etc...

Fixup the comments.

Change-Id: I30a73992adfde14d6e5f642b3a1ead2ee56726be
2015-11-10 16:45:49 -08:00
Tom Cherry
2a7f1b335d Merge "Refactor prop_area into a class" 2015-11-10 21:54:39 +00:00
Tom Cherry
926ebe1094 Refactor prop_area into a class
Bug 21852512

Change-Id: I432bf592f1a71a046c32616fc334ad77c220f0ca
2015-11-09 17:22:44 -08:00
Josh Gao
11b3916b83 Merge "Fix test failure." 2015-11-10 00:08:09 +00:00
Josh Gao
09fac86ca3 Fix test failure.
Bug: http://b/25596173
Change-Id: I0cf8f550837d4a936d6a784063a0ec9509150358
2015-11-09 16:04:50 -08:00
Dan Willemsen
704e048cbf Merge "Update Android.bp with latest Android.mk changes" 2015-11-09 22:28:18 +00:00
Dan Willemsen
dc6b0a7b93 Update Android.bp with latest Android.mk changes
Change-Id: I45f6292fcc4d4559519d88f948b4478204b08f25
2015-11-09 14:03:46 -08:00
Yabin Cui
0e6542b75b Merge "Add fileno_unlocked to support thread sanitizer." 2015-11-07 00:24:52 +00:00
Yabin Cui
fb994f4c04 Add fileno_unlocked to support thread sanitizer.
Bug: 25392375
Change-Id: If3f92a0e08a53f4b59e01397e8efa307d8572349
2015-11-06 16:13:47 -08:00
Elliott Hughes
8b5b2c4672 Merge "fix the mremap signature" 2015-11-06 21:18:08 +00:00
Daniel Micay
4200e260d2 fix the mremap signature
The mremap definition was incorrect (unsigned long instead of int) and
it was missing the optional new_address parameter.

Change-Id: Ib9d0675aaa098c21617cedc9b2b8cf267be3aec4
2015-11-06 13:14:43 -08:00
Dimitry Ivanov
3482613685 Merge "linker: cleanup solist after unsuccessful read" 2015-11-06 19:00:24 +00:00
Dmitriy Ivanov
fd7a91e692 linker: cleanup solist after unsuccessful read
Bug: http://b/25560017
Change-Id: I03c5a1d7aed34c480d341aacfb3b1afdfa037b99
2015-11-06 10:44:37 -08:00