Statically link more libraries
In commit 4bff0d63e4ca621cb88fac5ff5d363edd6ead8de we modified TestApk
so that the payload statically linked most libraries. But then we
added MicrodroidIdleNativeLib which didn't follow the same pattern.
So,
- Move MicrodroidIdleNativeLib under testapk.
- Statically link its libc++.
- Get rid of libiobenchmark which seemed redundant.
I haven't attempted to remove libbase.so and libc++.so from the
benchmark APK; the files are used both in host & VM, and I suspect
doing so would be a net loss.
Bug: 255920361
Test: Manual: Build, check .so files contained in the APKs
Test: atest MicrodroidTests MicrodroidBenchmarkApp
Change-Id: I6620f179536da39bab3a4ebc4f288af333548562
diff --git a/tests/testapk/Android.bp b/tests/testapk/Android.bp
index 8972046..9b05080 100644
--- a/tests/testapk/Android.bp
+++ b/tests/testapk/Android.bp
@@ -55,3 +55,10 @@
srcs: ["src/native/testlib.cpp"],
stl: "libc++_static",
}
+
+cc_library_shared {
+ name: "MicrodroidIdleNativeLib",
+ srcs: ["src/native/idlebinary.cpp"],
+ header_libs: ["vm_payload_headers"],
+ stl: "libc++_static",
+}
diff --git a/tests/testapk/src/native/idlebinary.cpp b/tests/testapk/src/native/idlebinary.cpp
new file mode 100644
index 0000000..9499d94
--- /dev/null
+++ b/tests/testapk/src/native/idlebinary.cpp
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <unistd.h>
+#include <vm_main.h>
+
+extern "C" int AVmPayload_main() {
+ // do nothing; just leave it alive. good night.
+ for (;;) {
+ sleep(1000);
+ }
+}