diff options
author | 2024-05-16 21:09:56 +0100 | |
---|---|---|
committer | 2024-05-28 12:53:00 +0000 | |
commit | 30e749b750f45f411d130b43d4221331c7c9d5fe (patch) | |
tree | 5357bde6c819689f84cbcabe617eeb5b8c5c2b14 | |
parent | 0833bf7e257d4d7ceae3eb43c2665e1b96ee522f (diff) |
Switch to the header-only library of libnativehelper in the tests.
To avoid a linker dependency on libnativehelper that we actually don't
use any symbols from.
Test: Build all bundled and standalone gtests
Bug: 247108425
Bug: 261703065
Change-Id: I2fbdefff77d16bc94a96c40f2037cc3c057c8e13
-rw-r--r-- | compiler/jni/jni_compiler_test.cc | 6 | ||||
-rw-r--r-- | test/Android.bp | 17 |
2 files changed, 8 insertions, 15 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 77ebff6da2..8a096d0744 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -14,11 +14,11 @@ * limitations under the License. */ +#include <math.h> + #include <memory> #include <type_traits> -#include <math.h> - #include "art_method-inl.h" #include "base/bit_utils.h" #include "base/casts.h" @@ -40,7 +40,7 @@ #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" #include "mirror/stack_trace_element-inl.h" -#include "nativehelper/ScopedLocalRef.h" +#include "nativehelper/scoped_local_ref.h" #include "nativeloader/native_loader.h" #include "oat/oat_quick_method_header.h" #include "runtime.h" diff --git a/test/Android.bp b/test/Android.bp index 85fafdd215..988dd3e5d7 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -260,18 +260,11 @@ art_cc_defaults { header_libs: [ "libnativeloader-headers", - ], - shared_libs: [ - // `libart(d)` (`art/runtime/jni/java_vm_ext.cc`) and `libnativehelper` - // (`libnativehelper/JniInvocation.c`) define symbols with the same name - // (e.g. `JNI_GetDefaultJavaVMInitArgs`). - // `JavaVmExtTest#*` tests require `libart(d)` implementation of these symbols. - // At the moment `libart(d)` is linked statically (through `libart(d)-gtest`) - // and these symbols are correctly resolved to `libart(d)`. - // If `libnativehelper` and `libart(d)` are both linked dynamically, - // `libart(d)` must be specified in shared_libs list before `libnativehelper`, - // so that its symbols have precedence over `libnativehelper`. - "libnativehelper", + // The full libnativehelper library has wrappers for the JNI APIs (e.g. + // `JNI_CreateJavaVM`) that are implemented in libart(d), so it + // shouldn't be linked into the tests where libart(d) is linked + // statically. + "libnativehelper_header_only", ], target: { android: { |