Commit graph

66 commits

Author SHA1 Message Date
Martin Stjernholm
53aec482aa Remove unnecessary dynamic dependency on libbase.
This code only uses android-base/macros.h.

Bug: 118374951
Test: mmma system/core/libnativebridge && for f in out/host/linux-x86/nativetest{,64}/*/*; do $f; done
Change-Id: Ifa5a5a3c9370bd128ddd301ea352746699715929
2018-10-24 16:11:45 +01:00
dimitry
3150f7c7af Add error_msg argument to CloseNativeLibrary
error_msg is set when dlclose/NativeBridgeUnloadLibrary fails.

Bug: https://issuetracker.google.com/79126103
Test: make
Change-Id: I043580209538ff47320e8d9a304a21c00c4b149f
2018-09-12 01:36:06 +02:00
Elliott Hughes
dc699a269f bpfmt.
Bug: N/A
Test: builds
Change-Id: I89ad00e1c4c7e0767bc80a7ac7935a4d55e090ac
2018-02-16 17:58:14 -08:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Chih-Hung Hsieh
048df230ab Use -Werror in system/core/libnativebridge
* Fix unused static variable warning.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I9c3a2031ac49368a1833a9d46af8174c3c9cd32e
2017-10-31 15:55:40 -07: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
dimitry
b6ba817de4 Define current ABI string in android-base/macros.h
Test: make
Change-Id: I8200d7b3232edba43a583c5ff1e1b0f78c768f69
2017-08-23 20:46:38 +02:00
Lennart Wieboldt
cd15fc7ba8 Remove LOCAL_CLANG and clang: true
clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: I34adaeef2f6558a09f26027271222bad94780507
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-07-25 14:29:50 +02:00
Steven Moreland
b2b88e35ea Move libnativebridge headers into the module.
Test: links
Change-Id: I2e19d1ba7845b4b3d3fee934fcb1c90151fd7192
2017-07-06 11:23:16 -07:00
Dimitry Ivanov
882cad2d87 Load vendor public libraries to sphal namespace
Load vendor public libraries to sphal namespace
if it exists - preserve old behavior of loading
these libraries to default namespace if sphal
namespace is not present on the device.

Bug: http://b/37410104
Test: cts-tradefed run singleCommand cts --skip-preconditions -m CtsJniTestCases
      on marlin (with enabled sphal configuration) and on angler where ld.config.txt
      is not present.

Change-Id: Iaa3fa437ba2900acc2e5b9c78039fe1553e4c9dd
(cherry picked from commit af0264bbe9)
2017-05-25 10:30:55 -07:00
Tomasz Wasilczyk
e38d3a60bc Convert libnativebridge[23]?-dummy to soong.
Bug: 37512442
Test: mmm system/core/libnativebridge/tests
Change-Id: Ib1ca9ef830f58041095226c2ba18d1302c7833b4
2017-05-08 15:29:10 -07:00
Zhenhua WANG
e8fb11dfa1 NativeBridge: add "linked namespace" semantic corresponding to linker
For dynamic linking perspective, semantics of NativeBridge needs to
align with dynamic linker. This patch adds "linked namespace" semantic
which shares some libraries from one namespace to another.

Test: make test-art-host-run-test-115-native-bridge
Change-Id: I71ce1dde19d61363d5eb9731fd4795a8c315b3a0
2017-03-29 17:34:11 -07:00
Calin Juravle
bac9807247 Set libnativebridge style to clang-format-2
Test: clang-format.py ...
Change-Id: Ie08ae6a056f0381590e202a597042fb2490af530
2017-03-29 17:29:57 -07:00
Mark Salyzyn
30f991f251 liblog: use log/log.h when utilizing ALOG macros
Test: compile
Bug: 30465923
Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2017-01-11 09:31:15 -08:00
Dimitry Ivanov
d836ab005a Allow different namespace types for different classloaders
An app should be able to make cross-arch calls to different apps
via other app's Context.getClassLoader()

Bug: 32542970
Test: Boot fugu. Check that there are no linker-namespace
      related errors in the log.

Change-Id: I1593f4688bcde0121a5e24a707441a4935fa7dc4
2016-11-04 15:21:13 -07:00
Zhenhua WANG
f2804e5985 Upgrade native bridge to version 3 to support namespace
Native bridge implements namespace related interfaces in version 3.
The namespace semantic here is same as Android dynamic linker's.
Native loader wraps library loading functions of dynamic linker and
native bridge. Thus, Android runtime is able to load native library
of different ISA on one device by calling native loader directly.

Bug: http://b/28242460
Test: mm && make test-art-host -j48
Change-Id: Idde2b9d99fb6ebe547407c716b5478a231f745a7
Signed-off-by: Zhenhua WANG <zhenhua.wang@intel.com>
2016-10-25 11:11:38 -07:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Elliott Hughes
36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -07:00
Mark Salyzyn
66ce3e08c5 system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2016-09-30 12:47:05 -07:00
Dan Willemsen
45f05240c2 Convert more Android.mk files to Android.bp
These modules have their dependencies satisfied, and aren't doing
anything strange.

Change-Id: I72039a15256cbd5e5eee0d79a15d66d74a6c087d
2016-07-13 17:41:45 -07:00
Dan Willemsen
ee2da03e26 Remove invalid uses of -l and -I
LOCAL_LDLIBS should only be used with -l flags for NDK and some host
libraries. Other uses should use LOCAL_SHARED_LIBRARIES.

LOCAL_LDFLAGS should not contain -l entries, they should be in
LOCAL_LDLIBS instead.

LOCAL_CFLAGS should not contain -I entries, those should use
LOCAL_C_INCLUDES instead.

Change-Id: Ic901aa14651572ac682166becd4f0cd86baecc34
2016-06-01 13:41:23 -07:00
Douglas Leung
d10e01775b Add Mips64 Runtime ISA type.
Change-Id: I8d8d1ab10787899e91abafe269b59ee535e85653
2016-02-08 14:02:47 -08:00
Calin Juravle
5e11a2936b Revert "nativebrige: log code_cache access errors to stderr as well"
This reverts commit 6d5017803e.

Bug: 26675310

Change-Id: Id56b5e832c85f01fca0a2198499d24224c5a6878
2016-01-27 17:53:20 +00:00
Calin Juravle
6d5017803e nativebrige: log code_cache access errors to stderr as well
115-native-bridge is a flaky tests. This will help tracing the flakiness
cause.

Change-Id: I7b8000738cd97b9cdb1055a0480ff9acbd85cae6
2016-01-12 12:24:16 -08:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
jgu21
cef898fa8f Allow native bridge to work without a code cache
In isolatedProcess, the app_code_cache_dir is not needed
for native bridge. This commit allows native bridge to work
without a code cache in isolatedProcess.

Change-Id: I8580268d5ec6ca8d44e4500c3fafe10408e1e0d3
Signed-off-by: jgu21 <jinghui.gu@intel.com>
2015-07-10 11:22:09 +08:00
Calin Juravle
28042b5627 Add static versions for libbacktrace and libnativebridge. Bug fixes.
Change-Id: Ic68ac15b2676e4f475330c8e7bb34e0d48783686
2015-07-02 02:09:20 +01:00
Andreas Gampe
a6ac9ce98b LibNativeBridge: Version 2
Add a callback function to retrieve "signal handler" from the bridge,
if the bridge wants it to be managed by the runtime. The signal handler
will be invoked after the runtime's own one, and before any other
chained handler.

Add a callback function to check compatibility of the bridge with the
library.

Add a function to expose the native bridge version. Add a test for this
function.

Bug: 20217701
Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23
2015-05-14 20:20:49 -07:00
Narayan Kamath
851f3aa51c am 0d385d1c: Merge "Track renaming of initUnchangeableSystemProperty."
* commit '0d385d1c625a5ef3ffdeab3f63a2171eecbb1e44':
  Track renaming of initUnchangeableSystemProperty.
2015-02-10 16:54:35 +00:00
Narayan Kamath
484c55b37f Track renaming of initUnchangeableSystemProperty.
It's now setUnchangeableSystemProperty.

Change-Id: Ib42f8ac9f074230dfb7af2eb633e0a536ab7d4b7
2015-02-10 15:43:41 +00:00
Nick Kralevich
1935663248 am 24dfaac4: am c6dead70: Merge "maybe fix mac build"
* commit '24dfaac494de3a31e1cd106becc2b2ad38e13bbe':
  maybe fix mac build
2014-11-02 14:32:19 +00:00
Nick Kralevich
24dfaac494 am c6dead70: Merge "maybe fix mac build"
* commit 'c6dead707de7c03bd9759b61143dd33cb1435cbc':
  maybe fix mac build
2014-11-02 14:25:08 +00:00
Nick Kralevich
bcd1a834d4 maybe fix mac build
system/core/libnativebridge/tests/CodeCacheExists_test.cpp:30:15: error:  use of undeclared identifier 'ENOENT'
      ASSERT_EQ(ENOENT, errno);

Change-Id: I188074b878a7ec3955a9f4b5dc7d1bfc56e2ccbc
2014-11-02 06:13:53 -08:00
Calin Juravle
792e269127 resolved conflicts for merge of 7a1abfe3 to lmp-mr1-dev-plus-aosp
Change-Id: Ie5db9f745e01bd24faa317af0cd8874e1099ebdf
2014-10-29 19:51:04 +00:00
Calin Juravle
83c29aea2f resolved conflicts for merge of 4de4e6de to lmp-mr1-dev-plus-aosp
Change-Id: Ie5c1c814ccd819a592d834879173edb8af15a52d
2014-10-29 17:32:31 +00:00
Calin Juravle
7a1abfe3b5 am 64989126: Merge "Add code cache tests to libnativebridge."
* commit '649891267f3b0db1c6c37152fc570a4824d6aa39':
  Add code cache tests to libnativebridge.
2014-10-29 12:32:21 +00:00
Narayan Kamath
182f33db82 am 8cf2ce10: Merge "Don\'t allow SUPPORTED_ABIs to be set by the native bridge."
* commit '8cf2ce1064847d5fed0ec728ef6e916e238767c0':
  Don't allow SUPPORTED_ABIs to be set by the native bridge.
2014-10-28 19:28:30 +00:00
Calin Juravle
4de4e6defc resolved conflicts for merge of e3c22c41 to stage-aosp-master
Change-Id: I566aeb2e2de15813ee199d4635098029457fdf3d
2014-10-28 19:09:50 +00:00
Calin Juravle
9ef4fa4c2c Add code cache tests to libnativebridge.
Bug: 18027433

(cherry picked from commit 59a719c466)

Change-Id: I32bcf3ae0d4569d4d8b88168e6c36ddff70b8f7d
2014-10-28 16:06:43 +00:00
Calin Juravle
649891267f Merge "Add code cache tests to libnativebridge." 2014-10-28 16:06:15 +00:00
Calin Juravle
59a719c466 Add code cache tests to libnativebridge.
Bug: 18027433
Change-Id: Ie5369c0d5bd147af412174dc0753d8a314196643
2014-10-28 16:02:38 +00:00
Narayan Kamath
8cf2ce1064 Merge "Don't allow SUPPORTED_ABIs to be set by the native bridge." 2014-10-27 16:16:02 +00:00
Calin Juravle
1402fbb135 Handle code_cache dir creation in libnativebridge
Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

(cherry picked from commit f9d9e2a2d9)

Change-Id: I9ce578949dbe522d5033465df7ca49fdd3aa3cbf
2014-10-27 15:37:32 +00:00
Calin Juravle
f9d9e2a2d9 Handle code_cache dir creation in libnativebridge
Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

Change-Id: I39f74c93580f2e224080dd3df2ffaa9cf9f8cd9c
2014-10-27 15:03:13 +00:00
Narayan Kamath
dd22aeff73 Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device
support, and must not vary depending on whether or not an app
is emulated.

bug: 18061712

(cherry picked from commit 66f0d93c26)

Change-Id: I99cea3a56228dac43ae310c295881881e5a77c31
2014-10-22 18:56:32 +01:00
Narayan Kamath
66f0d93c26 Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device
support, and must not vary depending on whether or not an app
is emulated.

bug: 18061712
Change-Id: I3ec3897d23e37c645b4d9d9e6e32aae9afff952c
2014-10-21 18:33:27 +01:00
Calin Juravle
c3eb4314b7 Use initUnchangeableSystemProperty for initializing os.arch.
Bug: 17713104

(cherry picked from commit 00851a53be)

Change-Id: Ibddc535248a10e3534586eafb76c074332e025c4
2014-10-01 21:16:16 +01:00
Calin Juravle
00851a53be Use initUnchangeableSystemProperty for initializing os.arch.
Bug: 17713104
Change-Id: Ic847579981efcd2fd0526c994d786ee8b7a8a316
2014-10-01 18:57:59 +01:00
Calin Juravle
c00994df05 Fix mac build for nativebridge tests.
Bug: 17671501

(cherry picked from commit 2e5e8cc92081da6b0af658d12a60334acea441a1)

Change-Id: Id0d729a25a5cea2fed5005cdea750e9e94f46d21
2014-09-29 07:58:15 -07:00
Calin Juravle
7e5a0aca2c Fix mac build for nativebridge tests.
Bug: 17671501

Change-Id: Id0d729a25a5cea2fed5005cdea750e9e94f46d21
2014-09-29 15:57:43 +01:00