Fix build rules for statically linked oatdump on host.
Test: m build-art-host
Test: m test-art-host-gtest-oatdump_test
Bug: 29530992
Change-Id: Iaa1ff13f0d42e5bc9670fc87da5b6e291482f626
diff --git a/oatdump/Android.bp b/oatdump/Android.bp
index bbe6cc1..f1fcf3d 100644
--- a/oatdump/Android.bp
+++ b/oatdump/Android.bp
@@ -54,13 +54,22 @@
art_cc_binary {
name: "oatdumps",
- defaults: ["oatdump-defaults"],
device_supported: false,
+ static_executable: true,
+ defaults: ["oatdump-defaults"],
target: {
darwin: {
enabled: false,
},
},
+ ldflags: [
+ // We need this because GC stress mode makes use of
+ // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
+ // defined in libgcc_eh.a(unwind-dw2.o)
+ // TODO: Having this is not ideal as it might obscure errors.
+ // Try to get rid of it.
+ "-z muldefs",
+ ],
static_libs: [
"libart",
"libart-compiler",
@@ -72,16 +81,25 @@
art_cc_binary {
name: "oatdumpds",
+ device_supported: false,
+ static_executable: true,
defaults: [
"art_debug_defaults",
"oatdump-defaults",
],
- device_supported: false,
target: {
darwin: {
enabled: false,
},
},
+ ldflags: [
+ // We need this because GC stress mode makes use of
+ // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
+ // defined in libgcc_eh.a(unwind-dw2.o)
+ // TODO: Having this is not ideal as it might obscure errors.
+ // Try to get rid of it.
+ "-z muldefs",
+ ],
static_libs: [
"libartd",
"libartd-compiler",