Commit graph

44 commits

Author SHA1 Message Date
Dan Willemsen
3e963f9df7 Convert more modules to Android.bp
Test: cd system/core; mma
Test: check for mkbootfs in build artifacts
Test: out/host/linux-x86/nativetest64/libcrypto_utils_test/libcrypto_utils_test
Test: out/host/linux-x86/nativetest64/libnativebridge-tests/*_test
Change-Id: I71141bd85f052d5d86763a8b79b219cc4c46aafb
2018-10-31 21:53:37 -07:00
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
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
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
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
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
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
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
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
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
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
59a719c466 Add code cache tests to libnativebridge.
Bug: 18027433
Change-Id: Ie5369c0d5bd147af412174dc0753d8a314196643
2014-10-28 16:02:38 +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
Andreas Gampe
3bfa57e1e3 am f0699c11: am 68c19686: Merge "Fix mac build for nativebridge tests."
* commit 'f0699c11debade875e87efad27d37ddf6fa83ed6':
  Fix mac build for nativebridge tests.
2014-09-29 22:01:58 +00: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
Andreas Gampe
e3448987c4 am aa1f512b: am 3496e327: Merge "LibNativeBridge: Add testing"
* commit 'aa1f512b93ada06d76c5b2d2692e1a131b38bfd0':
  LibNativeBridge: Add testing
2014-09-26 20:14:18 +00:00
jgu21
b3facbfdec LibNativeBridge: Add early init & env setup
Add a method to set up /proc/cpuinfo with enough privileges. Set
up the environment for an app in InitializeNativeBridge().

Turn on -Wall for libnativebridge.

(cherry picked from commit 962eb40abb)
(cherry picked from commit ab0da5a9a6)
(cherry picked from commit 2f71cb24fa)
(cherry picked from commit 04054e28e2)
(cherry picked from commit 4390a63236)

Bug: 17671501
Change-Id: Id4f4127d82737b5e56a77175e1068ff5cea60f9d
2014-09-26 13:04:36 -07:00
Andreas Gampe
04054e28e2 LibNativeBridge: Add testing
Change PreInitializeNativeBridge to have a different path for
the host to allow testing. Add a test (needs root privileges).

Add a test for NeedsNativeBridge.

Change error reporting to use strerror.

Change-Id: Id2d488f0484ff8b0438863b48ef43770e784505f
2014-09-25 23:18:31 -07:00
Andreas Gampe
25bacb3ab7 Revert "DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen"
This reverts commit f00de413ed.

Bug: 17645833
Change-Id: Ie5480de9cf4da2c9167db2e6137679019a29f867
2014-09-25 21:46:56 +00:00
Andreas Gampe
2a0f42b58d resolved conflicts for merge of 64884bb1 to lmp-dev-plus-aosp 2014-09-24 15:56:29 -07:00
Andreas Gampe
0eed2eb64a Revert "DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen"
This reverts commit f00de413ed.
2014-09-24 15:53:39 -07:00
jgu21
ab0da5a9a6 LibNativeBridge: Add early init & env setup
Add a method to set up /proc/cpuinfo with enough privileges. Set
up the environment for an app in InitializeNativeBridge().

Turn on -Wall for libnativebridge.

Change-Id: I0b93da93251c6b4638de786bf98cf99df07c3fc2
2014-09-23 20:08:25 -07:00
Andreas Gampe
f00de413ed DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen
Bug: 17440362
Change-Id: Ifceeecd39d4ffd948f62212ebb5280ebec9bf6ff
2014-09-10 05:09:21 +00:00
Andreas Gampe
41df668c7b NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload.

(cherry picked from commit 035bd7541e)

Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
2014-09-08 11:12:13 -07:00
Andreas Gampe
035bd7541e NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload.

Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
2014-09-04 12:57:54 -07:00
Andreas Gampe
049249ce7a NativeBridge: Tighten security on libnativebridge
Do not allow arbitrary paths for the native bridge - only allow
simple names.

Do not allow re-setup of the native bridge.

Bug: 16404669

(cherry picked from commit cd2ef4c1af)

Change-Id: Ie22de356d2307fe2758f9094a85d44e61a4098a1
2014-08-22 01:44:06 -07:00
Andreas Gampe
cd2ef4c1af NativeBridge: Tighten security on libnativebridge
Do not allow arbitrary paths for the native bridge - only allow
simple names.

Do not allow re-setup of the native bridge.

Bug: 16404669
Change-Id: Ie22de356d2307fe2758f9094a85d44e61a4098a1
2014-08-21 14:33:44 -07:00