Link libvixl statically.
Instead of including shared library libvixl.so in the ART
Module, link libvixl statically to all binaries that use it,
namely libart-compiler.so and libart-disassembler.so which
shall increase in size with the additional libvixl code.
The ART Module size with default libvixl symbol visibility:
- before: 88460730B
- after: 86973943B (-1.42MiB)
With hidden libvixl symbol visibility:
- before: 88337851B
- after: 84962808B (-3.22MiB)
(This is with master-art where we do not have a boot
profile and therefore compile more code in boot image.)
The change from default to hidden visibility is done in
https://android-review.googlesource.com/1697237 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 186902856
Change-Id: I040b0115b94b8690ee7be53e3ded8610d9f13e99
diff --git a/build/apex/art_apex_test.py b/build/apex/art_apex_test.py
index 9044fc7..b83b8af 100755
--- a/build/apex/art_apex_test.py
+++ b/build/apex/art_apex_test.py
@@ -588,7 +588,6 @@
self._checker.check_native_library('libnpt')
self._checker.check_native_library('libunwindstack')
self._checker.check_native_library('libziparchive')
- self._checker.check_optional_native_library('libvixl') # Only on ARM/ARM64
# Allow extra dependencies that appear in ASAN builds.
self._checker.check_optional_native_library('libclang_rt.asan*')
@@ -723,7 +722,6 @@
# double_loadable:true, cf. go/double_loadable). Also, like in the release
# package we need to look out for dependencies that should go through
# exported library stubs (until b/128708192 is fixed).
- self._checker.check_optional_native_library('libvixld') # Only on ARM/ARM64
self._checker.check_prefer64_library('libmeminfo')
self._checker.check_prefer64_library('libprocinfo')
diff --git a/build/codegen.go b/build/codegen.go
index bc7dc42..96dd223 100644
--- a/build/codegen.go
+++ b/build/codegen.go
@@ -102,6 +102,13 @@
}
}
+ type libraryProps struct {
+ Target struct {
+ Android *CodegenLibraryArchProperties
+ Host *CodegenLibraryArchProperties
+ }
+ }
+
type sharedLibraryProps struct {
Target struct {
Android *CodegenLibraryArchSharedProperties
@@ -119,20 +126,24 @@
arch := getCodegenArchProperties(archName)
cp := &commonProps{}
+ lp := &libraryProps{}
sharedLP := &sharedLibraryProps{}
staticLP := &staticLibraryProps{}
if host {
cp.Target.Host = &arch.CodegenCommonArchProperties
+ lp.Target.Host = &arch.CodegenLibraryArchProperties
sharedLP.Target.Host = &arch.CodegenLibraryArchSharedProperties
staticLP.Target.Host = &arch.CodegenLibraryArchStaticProperties
} else {
cp.Target.Android = &arch.CodegenCommonArchProperties
+ lp.Target.Android = &arch.CodegenLibraryArchProperties
sharedLP.Target.Android = &arch.CodegenLibraryArchSharedProperties
staticLP.Target.Android = &arch.CodegenLibraryArchStaticProperties
}
ctx.AppendProperties(cp)
if t.library {
+ ctx.AppendProperties(lp)
if t.static {
ctx.AppendProperties(staticLP)
}
@@ -167,6 +178,11 @@
Cppflags []string
}
+type CodegenLibraryArchProperties struct {
+ Static_libs []string
+ Export_static_lib_headers []string
+}
+
type CodegenLibraryArchStaticProperties struct {
Static struct {
Whole_static_libs []string
@@ -182,6 +198,7 @@
type codegenArchProperties struct {
CodegenSourceArchProperties
CodegenCommonArchProperties
+ CodegenLibraryArchProperties
CodegenLibraryArchStaticProperties
CodegenLibraryArchSharedProperties
}