Link all internal libraries statically into dex2oat(d) on host.
All static defaults had to change to whole_static_libs to work with the
new libdex2oat(d)_static libraries, so that they don't lose all symbols
in the static_libs dependency from the dex2oat(d) binaries.
The static unstripped dex2oat binary is 348 MB, 35 MB smaller than the
sum of the dynamic binary + DSO's.
Test: art/build/apex/runtests.sh
Test: runtests in device chroot
Test: art/test/testrunner/run_build_test_target.py art-test
Test: readelf -d out/host/linux-x86/bin/dex2oat(d)
Check that NEEDED only lists system libraries (libdl, libpthread,
libm, librt, libgcc_s, libc).
Bug: 145934348
Change-Id: I7abcf1db9b053f71ced6a7dde38ab1b4300b7b5a
diff --git a/compiler/Android.bp b/compiler/Android.bp
index a0118ca..332754e 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -173,7 +173,7 @@
cc_defaults {
name: "libart-compiler_static_base_defaults",
- static_libs: [
+ whole_static_libs: [
"libbase",
],
}
@@ -271,7 +271,7 @@
"libdexfile_static_defaults",
"libprofile_static_defaults",
],
- static_libs: ["libart-compiler"],
+ whole_static_libs: ["libart-compiler"],
}
art_cc_library {
@@ -344,7 +344,7 @@
"libdexfiled_static_defaults",
"libprofiled_static_defaults",
],
- static_libs: ["libartd-compiler"],
+ whole_static_libs: ["libartd-compiler"],
}
art_cc_library {