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/benchmark/Android.bp b/tests/benchmark/Android.bp
index e6f39f8..a92c4ed 100644
--- a/tests/benchmark/Android.bp
+++ b/tests/benchmark/Android.bp
@@ -28,20 +28,11 @@
}
cc_library_shared {
- name: "MicrodroidIdleNativeLib",
- srcs: ["src/native/idlebinary.cpp"],
- header_libs: ["vm_payload_headers"],
- shared_libs: [
- "libbase",
- ],
-}
-
-cc_library_shared {
name: "MicrodroidBenchmarkNativeLib",
- srcs: ["src/native/benchmarkbinary.cpp"],
+ srcs: ["src/native/*.cpp"],
+ local_include_dirs: ["src/native/include"],
static_libs: [
"com.android.microdroid.testservice-ndk",
- "libiobenchmark",
],
shared_libs: [
"libbase",
@@ -50,12 +41,3 @@
"libvm_payload",
],
}
-
-cc_library {
- name: "libiobenchmark",
- srcs: ["src/native/io_vsock.cpp"],
- export_include_dirs: ["src/native/include"],
- shared_libs: [
- "libbase",
- ],
-}
diff --git a/tests/benchmark/src/native/idlebinary.cpp b/tests/benchmark/src/native/idlebinary.cpp
deleted file mode 100644
index 9499d94..0000000
--- a/tests/benchmark/src/native/idlebinary.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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);
- }
-}