Commit Graph

15979 Commits

Author SHA1 Message Date
Yabin Cui
c9a659c57b Use FUTEX_WAIT_BITSET to avoid converting timeouts.
Add unittests for pthread APIs with timeout parameter.

Bug: 17569991

Change-Id: I6b3b9b2feae03680654cd64c3112ce7644632c87
2015-11-19 13:42:03 -08:00
Hung-ying Tyan
ce77e47b2f Merge "Add /odm/lib to shared lib search path"
am: 0ebe2f07c3

* commit '0ebe2f07c35d4b764bc5d8b5226004e3db46da91':
  Add /odm/lib to shared lib search path
2015-11-19 16:45:08 +00:00
Hung-ying Tyan
0ebe2f07c3 Merge "Add /odm/lib to shared lib search path" 2015-11-19 16:38:51 +00:00
Daniel Micay
c22a7de798 extend the PTRDIFF_MAX size check to mremap
This removes another way to obtain objects larger than PTRDIFF_MAX. The
only known remaining hole is now jemalloc's merging of virtual memory
spans.

Technically this could be wrapped in an __LP64__ ifndef since it can't
occur on 64-bit due to the 1:1 split. It doesn't really matter either
way.

Change-Id: Iab2af242b775bc98a59421994d87aca0433215bd
2015-11-19 08:57:47 -05:00
Junichi Uekawa
1ab4088062 Merge "Do not depend on host bits to get the right size to write."
am: 313632db57

* commit '313632db574d101275206ca025d21a5a3cd62150':
  Do not depend on host bits to get the right size to write.
2015-11-19 12:51:01 +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
f091c1f2f1 Merge "Implement pthread spin."
am: 2c09e5de29

* commit '2c09e5de299ca87a9e68807e2b4af41ba61710f3':
  Implement pthread spin.
2015-11-19 02:03:24 +00:00
Yabin Cui
9d4bd6f0ca Merge "Avoid tsan warning about pthread_mutex_destroy."
am: ea5bb151af

* commit 'ea5bb151af5e1e364968cb1eac70c8a2c13ca7a7':
  Avoid tsan warning about pthread_mutex_destroy.
2015-11-19 02:03:13 +00: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
3f539a1655 Merge "Ignore target sdk version for the public namespace"
am: 63f0e0db76

* commit '63f0e0db768ea9be4db3dd6a2fb62ea942afb9d6':
  Ignore target sdk version for the public namespace
2015-11-18 03:52:50 +00: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
a36158a77d Fix pthread_test according to tsan report.
1. Fix leak threads and data races related to spin_flag.
2. Increase stack size to run under tsan.

This doesn't pass all pthread tests, as some tests are used
to run intentionally in race situations.

Bug: 25392375
Change-Id: Icfba3e141e7170abd890809586e89b99adc8bd02
2015-11-16 21:15:58 -08:00
Yabin Cui
278fe431b6 Merge "Implement pthread barrier."
am: b804b9d67b

* commit 'b804b9d67b9e3a8c63471ff9892f6abea2a58684':
  Implement pthread barrier.
2015-11-17 00:28:20 +00:00
Yabin Cui
b804b9d67b Merge "Implement pthread barrier." 2015-11-17 00:22:54 +00:00
Dimitry Ivanov
159c3d617f Merge "Remove the warning about empty LD_LIBRARY_PATH"
am: 3c8c16022a

* commit '3c8c16022a513a32eb6b92cf23f4ef43ccf7ad6d':
  Remove the warning about empty LD_LIBRARY_PATH
2015-11-16 22:30:32 +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
4d87f17621 Merge "Enable clang to compile more tests."
am: 949bfb9e3c

* commit '949bfb9e3cceac7913fe1debc39617c9ec01ae5e':
  Enable clang to compile more tests.
2015-11-16 21:36:51 +00:00
Chih-hung Hsieh
949bfb9e3c Merge "Enable clang to compile more tests." 2015-11-16 21:31:36 +00:00
Dimitry Ivanov
b061c9250d Merge "Fix arm64 and x86 builds"
am: 61f186d067

* commit '61f186d067a3efb6a86450092a567fb18c1641c3':
  Fix arm64 and x86 builds
2015-11-16 21:25:31 +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
2616cdcdb9 Merge "Introducing linker namespaces"
am: 1f0ccbb59c

* commit '1f0ccbb59cd32dfad0e6d9fd9619905e067076a6':
  Introducing linker namespaces
2015-11-16 20:21:05 +00: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
69536213d6 Merge "Improve libc time zone fallback behavior."
am: 1b42c54471

* commit '1b42c544711316281e09c5da25850fac531b27cb':
  Improve libc time zone fallback behavior.
2015-11-13 18:28:57 +00: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
5187baa387 Merge "Fix strftime if tm_zone is null."
am: 5780f9d809

* commit '5780f9d80963fbe7b93f501dd3dd7edc7fab46b0':
  Fix strftime if tm_zone is null.
2015-11-13 03:04:31 +00:00
Elliott Hughes
5780f9d809 Merge "Fix strftime if tm_zone is null." 2015-11-13 02:58:30 +00:00
Nick Kralevich
bb725f7b77 Merge "FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc"
am: 4ea67f6950

* commit '4ea67f695066b73796b24563d83e8b5a9190334d':
  FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc
2015-11-13 01:12:41 +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
a2e9d90811 Merge "Still cannot compile with clang on arm64."
am: 7c10ee9473

* commit '7c10ee9473b5c46da733b2d3d24cf90fb8ac7672':
  Still cannot compile with clang on arm64.
2015-11-12 20:51:05 +00: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
c0116bd3db Merge "Enable clang for modules failed with TLS."
am: 0c447053de

* commit '0c447053de4b87d50ebec260c7e1d949fe934065':
  Enable clang for modules failed with TLS.
2015-11-12 01:09:37 +00:00
Chih-hung Hsieh
0c447053de Merge "Enable clang for modules failed with TLS." 2015-11-12 01:04:51 +00:00
Elliott Hughes
fd57638117 Merge "Clean up pthread_gettid_np test."
am: dbc6398e95

* commit 'dbc6398e95df44a18715ce5ba19b8e1a93b969d4':
  Clean up pthread_gettid_np test.
2015-11-12 01:04:38 +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