Commit graph

460 commits

Author SHA1 Message Date
Steven Moreland
9571234e22 libutils: remove subdirs
no longer used in Android

Test/Bug: none

Change-Id: I155d5ade02527bf47893a8bf8bcbb07b0aae53d8
2018-02-23 14:44:22 -08:00
Elliott Hughes
dc699a269f bpfmt.
Bug: N/A
Test: builds
Change-Id: I89ad00e1c4c7e0767bc80a7ac7935a4d55e090ac
2018-02-16 17:58:14 -08:00
Jiyong Park
a32678df55 libutilscallstack is private VNDK-SP
The library isn't intented to be exposed to vendors. It is a platform
private library.

Bug: 72471487
Test: Pixel 2016/2017 boots to the UI. Photo editing works.
Change-Id: Ib0479a43d66d988c2f882688240746bed3213dad
2018-01-25 14:02:08 +09:00
David Sehr
abfb9f3b99 Remove libziparchive dependency on libutils
Prevent future cyclic dependency from libunwind changes.

Bug: 66919073
Test: make -j 50
Change-Id: I2a4fa5b7c2c3a82db2073d0fa51940da6603be1f
2018-01-18 09:23:53 -08:00
Treehugger Robot
51c2088f3b Merge "Usage suggestions." 2017-12-19 20:32:29 +00:00
Steven Moreland
b8f152d3e2 Usage suggestions.
Providing alternative suggestions for using C++ stdlib types
instead of libutils types:
- higher interoperability
- fewer "legacy" quirks
- ability to use stl algorithms
- high optimization levels

Test: none
Change-Id: If81aa9982ca0ad229fa13c8142387906981b054d
2017-12-19 01:16:00 +00:00
Steven Moreland
8edb49060a Remove CompileTimeIfElse.
- not used anywhere
- equivalent to std::conditional

Test: none
Bug: none
Change-Id: Iffc00acb899d5159359d60c09443c7d2d7fdf2a0
2017-12-18 15:52:50 -08:00
Elliott Hughes
3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Dan Willemsen
829ecaa808 Merge "Fix / suppress new unused warnings for mingw+clang"
am: f106bb6bb8

Change-Id: I4e4ac1ff248bd437dd721cac8d55b4925e7af5a8
2017-11-30 22:43:14 +00:00
Dan Willemsen
f106bb6bb8 Merge "Fix / suppress new unused warnings for mingw+clang" 2017-11-30 22:31:54 +00:00
Dan Willemsen
528f144e77 Fix / suppress new unused warnings for mingw+clang
Bug: 69933068
Test: mmma system/core
Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
2017-11-29 21:37:28 -08:00
Logan Chien
d38831e107 Merge "libutils: Cleanup unused class declaration"
am: 23cc38d440

Change-Id: I93c1e2f9fc1d2c5ee6b1a6310952a4f7824b88a4
2017-11-28 02:22:03 +00:00
Logan Chien
20f7dc7041 libutils: Cleanup unused class declaration
This commit removes unused class declaration for SharedBuffer and
TextOutput.  SharedBuffer has become internal implementation details
since 282efae9c.  TextOutput usages have been removed since 9eb2a3b1.

Test: AOSP and master build w/o problems
Change-Id: I1871c4919a46f1ea8f41fb7eb79b4dc800b6f6f4
2017-11-22 18:31:10 +08:00
Xin Li
23e27db576 Merge commit 'a63ccea6abc7ea02e2d98e41c80793ca97237bd3' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: Ia33311cd1fd26dfaea59a69317b306fb91203c40
Merged-In: I03d06b10807e8a313c9654c2e1db36bfb59e3f99
2017-11-14 13:19:45 -08:00
Chih-Hung Hsieh
122352d983 Use -Werror in system/core
* Move -Wall -Werror from cppflags to cflags.
* Fix/suppress warning on unused variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I1e05e96a1d0bcb2ccef1ce456504b3af57167cc5
2017-11-01 11:32:55 -07:00
Treehugger Robot
b128c78aef Merge "libutils: Fix bug in strstr16." 2017-10-24 20:20:00 +00:00
Branislav Rankov
bf3fff1a9e libutils: Fix bug in strstr16.
In the original code when target is an empty string
strlen16() would start reading the memory until a
"terminating null" (that is, zero) character is found.
This may happen because "*target++", at line 300,
would increment the pointer beyond the actual string.

Signed-off-by: Branislav Rankov <branislav.rankov@arm.com>
Signed-off-by: Tamas Petz <tamas.petz@arm.com>
Test: libutils_tests --gtest_filter=UnicodeTest.strstr16*
Change-Id: I213ffe061057c7fa8f34b68881e106a709557dcd
2017-10-24 10:36:00 -07:00
Dan Willemsen
abb3521abe Merge "Use target.linux for all linux kernel based targets" am: ab62265fa1
am: f973417005

Change-Id: I6bba9b0849075fe0703032d2c8f258b5ea86547f
2017-10-18 22:56:19 +00:00
Dan Willemsen
f973417005 Merge "Use target.linux for all linux kernel based targets"
am: ab62265fa1

Change-Id: I11e4bd0dae56c350a9839f95b1e85bf30490701d
2017-10-18 22:50:48 +00:00
Steven Moreland
0567c0e386 Add vendor_available to liblog_headers.
Renamed NDK headers to "liblog_ndk_headers"
(these names aren't used anywhere).

libutils_headers now properly export liblog_headers.

Test: with BOARD_VNDK_VERSION=current
Merged-In: I3a85385f588b84393c57fd6d1bcac620f708f0f1
Change-Id: I3a85385f588b84393c57fd6d1bcac620f708f0f1
(cherry picked from commit 42b485cc53)
2017-10-17 08:02:20 +00:00
Steven Moreland
c956b182e5 libutils: liblog export headers
- make liblog dependency for all library builds (this is required
    for files like String8.cpp)
- export liblog headers (because they are used in many header files).

Test: less libraries fail with BOARD_VNDK_VERSION := current
Merged-In: Iecb9cd00deb3a9056ea63c4a087afdb80a51a2b8
Change-Id: Iecb9cd00deb3a9056ea63c4a087afdb80a51a2b8
(cherry picked from commit 43e20cac7b)
2017-10-17 08:01:48 +00:00
Dan Willemsen
bdddcab3bd Use target.linux for all linux kernel based targets
Now in Android.bp files, target.linux applies to all targets running a
linux kernel (android, linux_glibc, linux_bionic). So common
flags/sources/etc can be combined instead of copying them to each
target.

Test: m
Change-Id: If7ad138ea1c540c160731f86b6ccc0daa5c69b83
2017-10-16 20:55:39 -07:00
Steven Moreland
95d7cbb77a Add vendor_available to liblog_headers.
Renamed NDK headers to "liblog_ndk_headers"
(these names aren't used anywhere).

libutils_headers now properly export liblog_headers.

Test: with BOARD_VNDK_VERSION=current
Merged-In: I3a85385f588b84393c57fd6d1bcac620f708f0f1
Change-Id: I3a85385f588b84393c57fd6d1bcac620f708f0f1
(cherry picked from commit 42b485cc53)
2017-10-17 12:09:50 +09:00
Steven Moreland
1f64241e2d libutils: liblog export headers
- make liblog dependency for all library builds (this is required
    for files like String8.cpp)
- export liblog headers (because they are used in many header files).

Test: less libraries fail with BOARD_VNDK_VERSION := current
Merged-In: Iecb9cd00deb3a9056ea63c4a087afdb80a51a2b8
Change-Id: Iecb9cd00deb3a9056ea63c4a087afdb80a51a2b8
(cherry picked from commit 43e20cac7b)
2017-10-17 12:08:33 +09:00
Dan Willemsen
60a410d606 Merge changes from topic "linux_glibc" am: 7b3d4da91a
am: 348a082469

Change-Id: Ia203b8b7bf807385b90232fedf91cef80f040279
2017-10-03 03:19:45 +00:00
Dan Willemsen
348a082469 Merge changes from topic "linux_glibc"
am: 7b3d4da91a

Change-Id: I1cb69992882db5a265234ac808d408f1f136f0e5
2017-10-03 03:03:52 +00:00
Dan Willemsen
7b3d4da91a Merge changes from topic "linux_glibc"
* changes:
  Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
  Move host flags from linux -> host
2017-10-03 02:30:06 +00:00
George Burgess IV
84b998f437 Merge "Silence a use-after-free warning from the analyzer" am: 8c853c43cc
am: 584853bdb0

Change-Id: I355b80ad7e59daeba569e6f9bb8eea853121acf9
2017-10-02 22:42:19 +00:00
George Burgess IV
584853bdb0 Merge "Silence a use-after-free warning from the analyzer"
am: 8c853c43cc

Change-Id: I053089d33c2e46da12c6e8d72252fd73bea0debf
2017-10-02 22:40:42 +00:00
George Burgess IV
6753bc4433 Silence a use-after-free warning from the analyzer
The analyzer is known to be very conservative in the face of atomic
operations (e.g. https://bugs.llvm.org/show_bug.cgi?id=34365); this case
is no different.

It's concerned that `delete this;` might read a different value for
`flags`, and proceed to delete `refs`. Since there are many comments
explaining why this won't happen (and it all looks sane to me), use a
NOLINT to silence this warning.

Analyzer warning:
system/core/libutils/RefBase.cpp:445:5: warning: Use of memory after it
is freed

Bug: 27101951
Test: mma. Use-after-free warning is gone.
Change-Id: Ic1623971bd1bad546fbb12a79439116c89a6762d
2017-10-02 19:50:39 +00:00
Dan Willemsen
4852933707 Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
In the future, target.linux will apply to all targets running a linux kernel
(android, linux_glibc, linux_bionic). So move all current users to the specific
linux_glibc.

There will be another cleanup pass later that will move some instances back to
target.linux if the properties should be shared with target.android and
target.linux_bionic, but target.linux needs to be removed first.

Test: out/soong/build.ninja identical before/after
Change-Id: I72ef34689c60ce547cab2898e354b027e335f6a1
Exempt-From-Owner-Approval: build system cleanup
2017-10-02 10:44:29 -07:00
Dan Willemsen
55181f7cdd Merge "Remove default libraries" am: 8b7feee38f
am: a0113de2f3

Change-Id: I1db625d1dcf0a7d55dedc9986d527d92412e5444
2017-09-30 23:34:31 +00:00
Dan Willemsen
a0113de2f3 Merge "Remove default libraries"
am: 8b7feee38f

Change-Id: Ic39ecabd37ffe06ba3a119410b5dcd4885fb584c
2017-09-30 23:32:45 +00:00
Dan Willemsen
1e45d533b3 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
Change-Id: I0b3c147b00a8ab6ff289b85db55b88836c905f5c
Exempt-From-Owner-Approval: build system cleanup
2017-09-29 13:17:06 -07:00
Jeff Sharkey
a915e99e04 Merge "Add "operator bool" overload to android::sp." am: 28ebfe18fb
am: 56c22732c6

Change-Id: I0068bb0fee78b62abe97175b2594b579b6fc8f81
2017-09-13 23:14:06 +00:00
Jeff Sharkey
56c22732c6 Merge "Add "operator bool" overload to android::sp."
am: 28ebfe18fb

Change-Id: Idc8a68835c6a13ab92ffce44507360c2d8e6d9e5
2017-09-13 22:47:21 +00:00
Treehugger Robot
28ebfe18fb Merge "Add "operator bool" overload to android::sp." 2017-09-13 20:35:38 +00:00
Jeff Sharkey
147b881ca9 Add "operator bool" overload to android::sp.
This matches the overload on std::unique_ptr and friends.

Test: builds, boots
Bug: 13758960
Change-Id: Ieed9faa6b162c2a10fa7cf2b135c9b17564f6c88
2017-09-13 11:06:07 -06:00
Adam Vartanian
571cf65594 Fix integer overflow in utf{16,32}_to_utf8_length am: 47efc676c8
am: 6e2bf89dc7

Change-Id: I15b9e020b389066973dab623a22b1d6eda981d02
2017-09-11 09:30:41 +00:00
Adam Vartanian
6e2bf89dc7 Fix integer overflow in utf{16,32}_to_utf8_length
am: 47efc676c8

Change-Id: Id54a1e644fc02a2923c6bf165205d16e43cf5eb2
2017-09-11 09:26:42 +00:00
Adam Vartanian
47efc676c8 Fix integer overflow in utf{16,32}_to_utf8_length
Without an explicit check, the return value can wrap around and return
a value that is far too small to hold the data from the resulting
conversion.

No CTS test is provided because it would need to allocate at least
SSIZE_MAX / 2 bytes of UTF-16 data, which is unreasonable on 64-bit
devices.

Bug: 37723026
Test: run cts -p android.security
Change-Id: I56ba5e31657633b7f33685dd8839d4b3b998e586
2017-09-07 10:36:19 +01:00
Steven Moreland
25db8dc21b Add vendor_available to liblog_headers.
Renamed NDK headers to "liblog_ndk_headers"
(these names aren't used anywhere).

libutils_headers now properly export liblog_headers.

Test: with BOARD_VNDK_VERSION=current
Change-Id: I7b2d9e77e313e3f2ef362a19a03f4c23874d589a
Merged-In: I3a85385f588b84393c57fd6d1bcac620f708f0f1
2017-09-06 12:55:32 -07:00
Jiyong Park
bab16584ce Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime

Bug: 37629934
Test: build
Change-Id: I992eac637f373b204aa161b0b26f5563e952c27e
2017-09-06 13:04:57 +09:00
Justin Yun
9ca92458e2 Mark the modules as VNDK-SP in Android.bp
As a VNDK-SP module, Android.bp must have 'vndk' tag as well as
'vendor_available: true'.

The 'vndk' tag for VNDK-SP formated as follows:
vndk: {
    enabled: true,
    support_system_process: true,
},

VNDK-SP modules will be installed both in system/lib(64) as normal
and in system/lib(64)/vndk-sp as a vendor variant.

Bug: 63866913
Test: build and boot with BOARD_VNDK_VERSION=current
Merged-In: I51fe0859f63ad58b7b91909e7d7d4206443228cd
Change-Id: I51fe0859f63ad58b7b91909e7d7d4206443228cd
(cherry picked from commit aeb68e86e4)
2017-08-23 17:56:13 +09:00
Steven Moreland
7170d5bf24 Merge "Remove TODOs for std::string removal."
am: ceb7814c86

Change-Id: Iab64291aec5edd44ebf8856fb2d24c6d0e779bed
2017-08-02 20:49:46 +00:00
Treehugger Robot
ceb7814c86 Merge "Remove TODOs for std::string removal." 2017-08-02 20:35:45 +00:00
Chih-Hung Hsieh
dfaa20c069 Merge "Fix misc-macro-parentheses warnings in system/core."
am: e4bd153e55

Change-Id: I6b38149a0fa15874eff68cbf7ee62e4acd41c595
2017-08-01 23:26:06 +00:00
Chih-Hung Hsieh
85244e8bc2 Fix misc-macro-parentheses warnings in system/core.
Add NOLINT comment to work around clang-tidy
error in checking macro arguments used in
type expressions.

Bug: 28705665
Test: make with WITH_TIDY=1 WITH_TIDY_CHECKS=-*,misc-macro-* \
      WITH_TIDY_FLAGS=-header-filter=system/core/.*

Change-Id: I7619978c1804e151a11a8b0477e80076bcf21cab
2017-08-01 22:12:57 +00:00
Steven Moreland
c8ddc2bad0 Remove TODOs for std::string removal.
This is baked into too many prebuilts. Perhaps
eventually it can be removed, but this is very
unlikely.

Change-Id: Ie3f0095a7b48c8b60e548cf2d32d2d95c108b5fb
Fixes: 35363681
2017-07-31 17:53:13 -07:00