CTS: Compile JVMTI agents with NDK
Properly compile with the NDK instead of system.
Bug: 73206894
Test: mmma cts/hostsidetests/jvmti
Test: cts-tradefed run commandAndExit cts-jvmti
Change-Id: I8a411f2a0516653cd883c49f765fab8ea0efc8a0
diff --git a/hostsidetests/jvmti/attaching/app/jni/Android.mk b/hostsidetests/jvmti/attaching/app/jni/Android.mk
index 554fccf..a2c1db6 100644
--- a/hostsidetests/jvmti/attaching/app/jni/Android.mk
+++ b/hostsidetests/jvmti/attaching/app/jni/Android.mk
@@ -27,14 +27,15 @@
LOCAL_HEADER_LIBRARIES := libopenjdkjvmti_headers
LOCAL_SHARED_LIBRARIES := liblog \
- libdl
+ libdl \
+ libz
# The test implementation. We get this provided by ART.
# Note: Needs to be "whole" as this exposes JNI functions.
LOCAL_WHOLE_STATIC_LIBRARIES := libctstiagent
# Platform libraries that may not be available to apps. Link in statically.
-LOCAL_STATIC_LIBRARIES += libbase libcutils libutils
+LOCAL_STATIC_LIBRARIES += libbase_ndk
LOCAL_STRIP_MODULE := keep_symbols
@@ -58,6 +59,7 @@
-g \
-O0 \
-LOCAL_CXX_STL := libc++_static
+LOCAL_SDK_VERSION := current
+LOCAL_NDK_STL_VARIANT := c++_static
include $(BUILD_SHARED_LIBRARY)
diff --git a/hostsidetests/jvmti/base/jni/Android.mk b/hostsidetests/jvmti/base/jni/Android.mk
index 0ed5327..8ecf315 100644
--- a/hostsidetests/jvmti/base/jni/Android.mk
+++ b/hostsidetests/jvmti/base/jni/Android.mk
@@ -36,14 +36,15 @@
LOCAL_HEADER_LIBRARIES := libopenjdkjvmti_headers
LOCAL_SHARED_LIBRARIES := liblog \
- libdl
+ libdl \
+ libz
# The test implementation. We get this provided by ART.
# Note: Needs to be "whole" as this exposes JNI functions.
LOCAL_WHOLE_STATIC_LIBRARIES := libctstiagent
# Platform libraries that may not be available to apps. Link in statically.
-LOCAL_STATIC_LIBRARIES += libbase libcutils libutils
+LOCAL_STATIC_LIBRARIES += libbase_ndk
LOCAL_STRIP_MODULE := keep_symbols
@@ -67,6 +68,7 @@
-g \
-O0 \
-LOCAL_CXX_STL := libc++_static
+LOCAL_SDK_VERSION := current
+LOCAL_NDK_STL_VARIANT := c++_static
include $(BUILD_SHARED_LIBRARY)