Commit graph

56 commits

Author SHA1 Message Date
dimitry
a808b1150a Enable native_bridge_support
Enable native bridge support for libbase, liblog,
libziparchive and libpropertyinfoparser.

This makes it possible to use them in binaries for translated
architectures.

Bug: http://b/77159578
Test: make
Change-Id: If67ce92288b17a052ea1e79a268e284f7d941439
2019-05-06 14:05:05 +02:00
Vic Yang
270f65ffdb Version liblog LL-NDK library
The system version of liblog has been versioned.  Do the same for
LL-NDK verison as well.

Test: Build and examine the dynamic symbols.
Change-Id: Ie63cc845c891d9372fb1990e713b3fe4f0f2f723
2019-04-02 12:22:50 -07:00
Tom Cherry
fe1f701761 liblog: add stubs variant
Ensure that only the symbols in liblog.map.txt can be used by the
platform.

Bug: 123349183
Test: build
Change-Id: I99ae5d0e8ba8f5061ec20701c941d861c9eb615d
2019-02-20 12:32:12 -08:00
Elliott Hughes
3c3bdc128f liblog: make liblog_headers truly stand-alone.
We don't want to imply dependencies on libc or libc++.

Bug: https://issuetracker.google.com/issues/119713191
Test: boots
Change-Id: I4abe312e73fad3ca8e96abd328b16387507baed4
2019-02-13 12:42:06 -08:00
Tom Cherry
2d9779e87b liblog: remove visibility macros
Visibility is managed through version scripts now.

Bug: 123349183
Test: build
Change-Id: Ia388611a2ec14d0ff9c3896cfe97ccdce17dbb8b
2019-02-08 11:48:19 -08:00
Tom Cherry
44f0023e81 Add a version script for liblog for the platform
liblog has a version script for the NDK and VNDK, however it doesn't
have symbols intended to be used by the platform.  This change adds
those symbols to the version script and enables it, hiding the rest of
the symbols.

Test: build
Change-Id: I494d048d78bb47d763482eb56a6f79babfe163f4
2019-01-17 11:46:31 -08:00
Tom Cherry
e181bf5116 Merge "Remove liblog/uio.c and <log/uio.h>" 2019-01-17 17:19:52 +00:00
Tom Cherry
6f6ef39b48 Remove liblog/uio.c and <log/uio.h>
readv() isn't used by anyone, writev() has one easily replaced user.
uio.h can be left as a private header for windows compatibility with
struct iovec.

Test: build
Change-Id: I33d4c6bdee6fd818271f78ae06abdd2aa09430f2
2019-01-16 14:26:36 -08:00
Tom Cherry
3b4bddc638 Remove liblog's rate limiting
After a few years of being available, there only ended up being one
user of this, so it is clear that logd's duplicate message mechanism
is the favored solution.

The one user of this rate limiting is questionable as is, since due to
the nature of storaged, the mainloop only runs once per minute by
default as is, so there is essentially nothing to be gained by rate
limiting any further.

Test: build
Change-Id: I0610d11efda1ce8b581b939bad11ff295cb2daa6
2019-01-16 10:37:14 -08:00
Tom Cherry
71ba16488b liblog: convert to C++
Bug: 119867234
Test: liblog, logcat, logd unit tests

Change-Id: I2a33b6fc37f9860c0041e3573bfb59ea389f623c
2019-01-15 15:57:33 -08:00
Tom Cherry
d1febd3316 liblog: remove LOGGER_LOCAL
No users ever signed up to use this, so remove it to ease the
refactoring of liblog/libbase.

Bug: 119867234
Test: liblog unit tests
Change-Id: I37b99644112bae7b4a2e3f4d06749db08de4ea14
2019-01-10 10:39:35 -08:00
Chih-Hung Hsieh
462df10d91 Work around b/24465209, do not pack relocation table.
Global flag --pack-dyn-relocs=android is used with clang lld.
For b/24465209, we need to override that with pack_relocations:false.

Bug: 24465209
Bug: 80093890
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I4edcdf49e184fa45ea2b6b6417654d81bcd09e1d
2018-05-24 09:34:54 -07:00
Chih-Hung Hsieh
0f975a2099 Work around b/24465209, do not use clang lld
See longer explanation in b/80093890.
Clang lld does not generate expected DT_REL and DT_RELA tags
with --hash-style=both and --pack-dyn-relocs=android.
I am not sure about the extent of b/24465209, so
I would rather not to use lld for these .so files for now.

Bug: 80093890
Bug: 24465209
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I645dbe25c5b9975605e3af5e717ed36c276f14d4
2018-05-23 17:15:48 +00:00
Jiyong Park
612210c75b Mark as recovery_available: true
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. toybox) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.

Bug: 67916654
Bug: 64960723
Test: m -j
Change-Id: Ie59155c08890e96ce1893fa3687afcf763d7aea3
2018-05-15 09:47:04 +09:00
Ian Pedowitz
7bb9785a1d Fixing app compat issue b/72143978
Revert "Remove obsolete workaround."

This reverts commit 1f3ac7583f.

Bug: 72143978
Bug: 24465209
Test: Tested failing case on sailfish, reverted back all CL's since
Test: 3471433 for b/24465209 and apps open
2018-01-18 16:25:24 -08:00
Elliott Hughes
1f3ac7583f Remove obsolete workaround.
Bug: http://b/24465209
Test: manually ran the app.
Change-Id: I573d2480c70632b100096ba6b2029bfc335595d6
2018-01-09 14:43:00 -08:00
Steven Moreland
e1c834db04 Use override_export_include_dirs.
Bug: 62878521
Test: soong build system finds renamed attribute
Change-Id: I51e42f4378db366b8711cd373fb835fecda88416
2018-01-05 14:42:12 -08: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
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
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
Dan Willemsen
c8202dc5f7 Remove .(ll)ndk suffix from (ll)ndk_library
Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Change-Id: Ica4eedda51bb34db2f39d2c64ea436e1f633bfc3
2017-04-10 12:54:31 -07:00
Dan Willemsen
38b4a9265d Add LLNDK liblog stub library for the VNDK
This replaces the liblog_vndk_headers with a true stub library that
exports the vndk headers, and exports the vndk-specific set of symbols.

Test: generated NDK stub maps are the same before/after
Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j (with other changes)
Change-Id: I9037241963b3872a3bc7cf7ab36a70dd4ddcf9bc
(cherry picked from commit 28dab34cbb)
2017-04-07 20:35:02 -07:00
Mark Salyzyn
4d99c986d9 liblog: add LOGGER_STDERR frontend
Standalone, this logger provides no end-to-end capability.  Only
provides a writer, no reader transport.  All output goes, logcat-like,
into the stderr stream.  Output can be adjusted with environment
variables ANDROID_PRINTF_LOG and ANDROID_LOG_TAGS.

liblog_*.__android_log_bswrite_and_print___max print fails if a string
member is truncated with "Binary log entry conversion failed" and -1.
We expose the truncated content in the tests and in LOGGER_STDERR.

The purpose of this transport selection is for command-line tools,
providing a means to shunt the logs to be mixed in with the tool's
error stream.

Test: gTest liblog-unit-tests
Bug: 27405083
Change-Id: If344b6e3e67df2dc86ce317cfad8af8e857727b7
2017-03-08 07:17:31 -08:00
Mark Salyzyn
7100288532 liblog: add local_logger
- Create the local-only logger module
- Add LOGGER_LOCAL flag to android_set_log_frontend to enable
- Permit log reader for host compilation

android_set_log_frontend(LOGGER_LOCAL) will result in logs going
into application local memory.  logcat can not retrieve the data,
the user must utilize the log reading interface directly to
acquire their own logs.  Some local logger tests dropped as they
represent testing other liblog facilities.  Other local logger
tests dropped because we make the conscious decision to not
support LOG_ID_SECURITY logging.

ToDo: Some local logger tests dropped because of missing
      functionality associated with blocking reader.

Test: gTest libcutils-tests, logd-unit-tests, liblog-unit-tests,
      logcat-unit-tests, liblog-benchmarks and CtsLiblogTestCases_list
Bug: 27405083
Change-Id: Ia23b932af9e05756eaa60bab9139876b14faf72d
2017-02-08 15:07:06 -08:00
Mark Salyzyn
62d0d2d683 liblog: add logprint to host build
- cleanup of some style issues
- resolve a few minor bugs
- add -lrt for host so that clock_gettime can be issued
- enable write-only logging, logprint and event list
  handling tests for host consumption.

NB: CtsLiblogTestCases_list is only outlet for host testing of
    the interfaces, but it is not part of any automated testing

Test: gTest liblog-unit-tests, liblog-benchmarks and
      CtsLiblogTestCases_list && build mmma system/core/liblog
Bug: 27405083
Change-Id: I13db1f45f67569407587a5a909248de33809b8cf
2017-02-08 13:37:44 -08:00
Mark Salyzyn
bdac221cc3 Revert "Continue using the legacy NDK android/log.h."
Use refreshed android/log.h for NDK

This effectively a modern revert of the commit
b7c3996f7c

Test: build
Bug: 30465923
Bug: 34250038
Change-Id: I7d4a5134bb711051283c36a2d5bc803436dca12e
2017-01-30 22:14:59 +00:00
Vijay Venkatraman
651f8383e6 Revert "Revert "Exporting C headers from system/core""
This reverts commit a3f2be2b73.

Test: compile
Change-Id: I04b3a8e47e1fa3eb9d80c14ae3a90c68a780e858
2017-01-25 12:50:29 -08:00
Vijay Venkatraman
22b7f76a00 Merge "Revert "Exporting C headers from system/core"" 2017-01-25 00:53:07 +00:00
Vijay Venkatraman
a3f2be2b73 Revert "Exporting C headers from system/core"
This reverts commit 3c6763ca21.

Change-Id: If3b3e106478d28a5df927d57649abdca0a99dd0e
2017-01-25 00:44:08 +00:00
Evgenii Stepanov
f38ae34bbc Merge "Don't disable all sanitizers in liblog, just asan." 2017-01-24 23:00:54 +00:00
Evgenii Stepanov
ffdabdc6f2 Don't disable all sanitizers in liblog, just asan.
ASan runtime library depends on liblog, so we have to disable ASan,
but nothing else.

Bug: 33091541
Test: SANITIZE_TARGET=address keeps working
Change-Id: I6e22925b7f1d5ec86fe1bd8c00dba4c3e86ddf3f
2017-01-24 12:57:23 -08:00
Vijay Venkatraman
3c6763ca21 Exporting C headers from system/core
Moved headers from include/libcutils and include/liblog to
libcutils/include and liblog/include respectively, so they can be
exported via these libs. They needed to be moved since Soong does
not allow export from external folder.

Added symlink from old locations. They are needed since Soong
includes system/core/include by default. Once all modules are
cleaned up to explicitly add the required libs, the symlinks will be
removed.

Also added liblog_vndk_headers that exports a special log/log.h for
VNDK.

Moved headers of libcutils to libcutils_headers. They should be used
by modules for header-only inlines. Added libcutils_headers as
dependency of libcutils.

Added libcutils_vndk_headers that exports a special cutils/log.h
deprecating usage of the file. A later CL will deprecate the one in
libcutils_headers

Test: Add above libs to shared lib of local module
Change-Id: I6e1f9c5f23d8b6eae13dc3b7e5dfe7fae93b8510
2017-01-22 19:45:38 -08:00
Dan Albert
9a41bcecc6 Unversion NDK stub libraries.
The system versions of these libraries aren't versioned yet.

Bug: https://github.com/android-ndk/ndk/issues/278
Test: make ndk
Change-Id: Icf5ff9921441d3e252771aef37002c772c08cbd0
2017-01-06 11:04:15 -08:00
Mark Salyzyn
fc148f7f33 liblog: add IF_ALOG_RATELIMIT
IF_ALOG_RATELIMIT()
    ALOGE("Only one message globally using IF_ALOG_RATELIMIT()"
          " in the process may appear ever ten seconds,"
          " (%s)", strerror(errno));

static time_t last; /* initial state zero */
IF_ALOG_RATELIMIT_LOCAL(60, &last)
    ALOGE("Only one message locally may appear every minute,"
          " (%s)", strerror(errno));

These new calls are guaranteed not to affect the value of a
non-zero errno to simplify logging of errors.  However, the
ALOGE calls in the above examples may update the errno value
upon their return.

Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_ratelimit
Bug: 33535908
Change-Id: Id8cc192fc7d14504ffd418933cf88ae945c089f2
2016-12-21 21:36:14 +00:00
Mark Salyzyn
774e04f779 liblog: move log_is_loggable.c to properties.c
Just makes sense cleanup

Test: gTest liblog-unit-tests
Bug: 33535908
Change-Id: I85de049f3cd73a473d56db5970d42eee5f9f70a8
2016-12-16 08:43:56 -08:00
Mark Salyzyn
ed9dc8abe2 liblog: switch event_tag_map.c to event_tag_map.cpp
NB: recent activities on event_tag_map.c were to allow
    this transition to be unremarkable.

Test: compile
Bug: 31456426
Change-Id: I13e1771a001874244711a5ac3023861c2a5f8c7d
2016-12-01 15:42:03 -08:00
Dan Willemsen
0910d2dbb9 Enable liblog on host bionic
Some of the __BIONIC__ checks were actually looking for an android
device. Host bionic has __BIONIC__, but not __ANDROID__.

Bug: 31559095
Test: Test linux_bionic compile
Change-Id: Ia0ca36fc9486fe8ea7e5d1b2e26ab0491903723c
2016-11-29 13:39:55 -08:00
Dan Albert
286b2eaa52 Add license to ndk_headers.
Test: make ndk
Bug: None
Change-Id: Iaba7368b89ec446b5c65c7c127a98914bd949496
2016-10-20 10:18:27 -07:00
Dan Albert
b7c3996f7c Continue using the legacy NDK android/log.h.
system/core/android/log.h needs some work before it can be included in
the NDK. It defines a *lot* of macros that previously were usable
names in NDK sources that used android/log.h. As an example, the
following file defines LOG_TAG as a variable, but the variable name
gets macro replaced if we use the current android/log.h.
4adc1515f8/framework/platform/android/tcuTestLogParserJNI.cpp (41)

For now, we keep a copy of the old NDK android/log.h in
legacy-ndk-includes.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I8ce942d1ee2f8f0d4c27130802c03992a1b85ec4
2016-10-14 13:12:29 -07:00
Mark Salyzyn
9633b919d7 liblog: Move liblog tag from 1005 to 1006
Allow logd to add another "consecutive" log tag

Test: gTest liblog-unit-tests, check for liblog in logcat afterwards
Bug: 31456426
Change-Id: I0c25e038878ec9a0cf368a33a63f8345c68749c3
2016-09-30 12:47:05 -07:00
Mark Salyzyn
004cd3c55d liblog: logd: logcat: deprecate log/log_read.h
Always used in combination with log/logger.h except in log_time.cpp,
and not used externally.  As a result liblog has to support stl, a
small price to pay since goal is to convert liblog to C++ internally.

Test: compile
Bug: 31456426
Bug: 26552300
Bug: 31289077
Change-Id: I72828ec807d0a2c8e40bbdebd7a69f147a7ca5a9
2016-09-30 12:47:05 -07:00
Dan Albert
ddce8c70c4 Migrate liblog to ndk_library.
Test: make native
Bug: http://b/30465923
Change-Id: I3db7ede817a57b3505c0556ea28f08b9e8331e1a
2016-09-23 15:43:23 -07:00
Dan Willemsen
9ce49be616 Merge "Fix liblog logtags" am: 59e6afc617
am: 6b5255722e

* commit '6b5255722e7497fc7c854cf1ae9e51322bc7ceae':
  Fix liblog logtags

Change-Id: I6225d8fd338b9ffc5b4406d5dbb92e2816bcaaad
2016-06-01 23:47:45 +00:00
Dan Willemsen
d119101807 Fix liblog logtags
This was broken because we didn't have logtags support in Soong.

Bug: 28989759
Change-Id: I8370a73cf14703b86aafd85e7ea74fc570c3ff0f
2016-06-01 15:32:35 -07:00
Colin Cross
c4dcc38e44 Merge "Update sanitize property format" am: 0652728
am: 9ba3f6d

* commit '9ba3f6db392f0f9b25cc5b3ad03c984fdc76094f':
  Update sanitize property format

Change-Id: I7ac818440c50c7166921d74dfb3b6c10af19ee09
2016-04-19 22:51:08 +00:00
Colin Cross
5d35ce649c Update sanitize property format
Change-Id: I81c299609ece7a1c7f27093f563d5df08efe989b
2016-04-15 16:33:21 -07:00
Mark Salyzyn
33aecaa784 Merge "liblog: suppress pmsg on user builds" am: 0858071
am: 24967e5

* commit '24967e5f5e87e5079f416d3cbc3d6a5dba7e8865':
  liblog: suppress pmsg on user builds

Change-Id: Ic4f2c02e227ee3c0dc29eb11757dc024aae3b950
2016-03-31 21:07:32 +00:00
Mark Salyzyn
7ef5249afa liblog: suppress pmsg on user builds
- add optimized & cached LIBLOG_HIDDEN __android_log_is_debuggable()
- check when writing, either LOG_ID_SECURITY, SafetyNet or
  debuggable when pushing content to the pmsg buffer.

Bug: 27566046
Change-Id: I85f1b55ec329b38e00f4183836b6ed53046c323d
2016-03-29 13:52:21 -07:00
Mark Salyzyn
93101bea8b liblog: update Android.bp
Update Android.bp to match the version in AOSP.

Change-Id: I93aba0f93a7a8d255073661331f1d966a53e20aa
(cherry picked from commit c457a4b73e)
2016-03-24 13:45:00 -07:00