Enable ThinLTO for libart
This helps reducing binary size as well as improve performance of
libart.
On Marlin
No LTO ThinLTO Improvement
libart.so 5.82MB 5.66MB 2.75%
libart.so (64) 7.71MB 7.44MB 3.44%
atest (AppStartup) 270.13 265.13 1.85%
dex2oat 536.04 533.03 0.56%
Bug: 62839002
Test: Benchmark on Marlin
Change-Id: Ic386ebceecf89239ad4f28db28b9bfd641efc45c
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 590a399..51fbb2e 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -476,6 +476,13 @@
export_shared_lib_headers: [
"libdexfile",
],
+ target: {
+ android: {
+ lto: {
+ thin: true,
+ },
+ },
+ },
}
art_cc_library {