Skip to content
Commit 1d4b4653 authored by Tej Singh's avatar Tej Singh
Browse files

Move proto, c++, and test libs to static

Link libgtest_prod, libprotobuf-cpp-lite, and libc++ statically.
This reduces the size of the statsd apex from 2.8M to 1.6M.

Initial:
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
764K	./bin
1.3M	./lib64
8.0K	./etc
600K	./lib
120K	./javalib
2.8M	.

After linking proto lite and libgtest_prod statically (saves ~500kb):
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
800K	./bin
876K	./lib64
8.0K	./etc
600K	./lib
120K	./javalib
2.3M	.

After also linking libc++ statically (saves ~700kb):
blueline:/apex/com.android.os.statsd # du -h
16K	./lost+found
0.9M	./bin
296K	./lib64
8.0K	./etc
204K	./lib
120K	./javalib
1.6M	.

After this change, the only libraries in both /lib and /lib64 are:
libstats_jni.so
libstatspull.so
libstatssocket.so

These are the 3 libraries we actually want to ship.

Test: m
Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Test: manually inspecting the size of the apex, statsd binary, and
libraries
Bug: 153349706
Bug: 153349659
Bug: 153350187

Change-Id: I00796fc1cf33e394422c6dc617a8430a5f5c5bbb
parent b6eaf6ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment