gpuservice: move some libs from shared to static
These libraries are only used by this process on a device and gain no
benifit from being included as shared libraries.
Moving them to static saves disk space, memory, and cpu cycles from the
dynamic linker.
With 3 reboots before and after I'm seeing average savings of 230KB of
storage space from installed files, 44KB private dirty memory,
176KB PSS from libraries/binary only, and 160KB PSS from everything in showmap.
go/shared-to-static for more info on how this was determined.
Test: m
Bug: 280829178
Change-Id: I798171dafac3344b6b49123014e73c98c10c26ad
diff --git a/services/gpuservice/Android.bp b/services/gpuservice/Android.bp
index 052efb6b..e5b1e44 100644
--- a/services/gpuservice/Android.bp
+++ b/services/gpuservice/Android.bp
@@ -21,7 +21,13 @@
cc_defaults {
name: "libgpuservice_defaults",
- defaults: ["gpuservice_defaults"],
+ defaults: [
+ "gpuservice_defaults",
+ "libvkjson_deps",
+ "libgfxstats_deps",
+ "libgpumem_deps",
+ "libgpumemtracer_deps",
+ ],
cflags: [
"-DLOG_TAG=\"GpuService\"",
],
@@ -29,17 +35,17 @@
"libbase",
"libbinder",
"libcutils",
- "libgfxstats",
- "libgpumem",
"libgpuwork",
- "libgpumemtracer",
"libgraphicsenv",
"liblog",
"libutils",
- "libvkjson",
],
static_libs: [
+ "libgfxstats",
+ "libgpumem",
+ "libgpumemtracer",
"libserviceutils",
+ "libvkjson",
],
export_static_lib_headers: [
"libserviceutils",
@@ -68,7 +74,7 @@
],
}
-cc_library_shared {
+cc_library_static {
name: "libgpuservice",
defaults: ["libgpuservice_production_defaults"],
export_include_dirs: ["include"],
@@ -96,14 +102,17 @@
cc_binary {
name: "gpuservice",
- defaults: ["libgpuservice_binary"],
+ defaults: [
+ "libgpuservice_binary",
+ "libgpuservice_production_defaults",
+ ],
init_rc: ["gpuservice.rc"],
required: [
"bpfloader",
"gpuMem.o",
],
srcs: [":gpuservice_binary_sources"],
- shared_libs: [
+ static_libs: [
"libgpuservice",
],
}