Conditionally include MIPS32/MIPS64 and x86/x86-64 disassembler definitions.
Only include these disassemblers if at least one of the corresponding
back ends is enabled.
Impact on the size of libart(d)-disassembler.so:
- ARM-only target:
- libart-disassembler.so: 66512 bytes → 33840 bytes (-32672 bytes, -49%)
- libartd-disassembler.so: 70680 bytes → 33900 bytes (-36780 bytes, -52%)
- ARM64-only target:
- libart-disassembler.so: 105168 bytes → 55776 bytes (-49392 bytes, -47%)
- libartd-disassembler.so: 113416 bytes → 59936 bytes (-53480 bytes, -47%)
Test: m test-art-host
Bug: 119090273
Change-Id: I2bccb482df46b5ce1ca69ffb110451d79a64b996
diff --git a/disassembler/Android.bp b/disassembler/Android.bp
index e77d914..892d060 100644
--- a/disassembler/Android.bp
+++ b/disassembler/Android.bp
@@ -20,8 +20,6 @@
host_supported: true,
srcs: [
"disassembler.cc",
- "disassembler_mips.cc",
- "disassembler_x86.cc",
],
codegen: {
arm: {
@@ -30,28 +28,18 @@
arm64: {
srcs: ["disassembler_arm64.cc"],
},
- // TODO: We should also conditionally include the MIPS32/MIPS64 and the
- // x86/x86-64 disassembler definitions (b/119090273). However, using the
- // following syntax here:
- //
- // mips: {
- // srcs: ["disassembler_mips.cc"]
- // },
- // mips64: {
- // srcs: ["disassembler_mips.cc"]
- // },
- // x86: {
- // srcs: ["disassembler_x86.cc"]
- // },
- // x86_64: {
- // srcs: ["disassembler_x86.cc"]
- // },
- //
- // does not work, as it generates a file rejected by ninja with this
- // error message (e.g. on host, where we include all the back ends by
- // default):
- //
- // FAILED: ninja: out/soong/build.ninja:320768: multiple rules generate out/soong/.intermediates/art/disassembler/libart-disassembler/linux_glibc_x86_64_static/obj/art/disassembler/disassembler_mips.o [-w dupbuild=err]
+ mips: {
+ srcs: ["disassembler_mips.cc"],
+ },
+ mips64: {
+ srcs: ["disassembler_mips.cc"],
+ },
+ x86: {
+ srcs: ["disassembler_x86.cc"],
+ },
+ x86_64: {
+ srcs: ["disassembler_x86.cc"],
+ },
},
shared_libs: [
"libbase",