1//
2// Copyright (C) 2011 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_defaults {
18    name: "oatdump-defaults",
19    defaults: ["art_defaults"],
20    host_supported: true,
21    srcs: ["oatdump.cc"],
22    header_libs: [
23        "art_cmdlineparser_headers",
24    ],
25}
26
27art_cc_binary {
28    name: "oatdump",
29    defaults: ["oatdump-defaults"],
30    shared_libs: [
31        "libart",
32        "libart-compiler",
33        "libart-dexlayout",
34        "libart-disassembler",
35        "libdexfile",
36        "libartbase",
37        "libprofile",
38        "libbase",
39    ],
40    apex_available: [
41        "com.android.art.release",
42        "com.android.art.debug",
43    ],
44}
45
46art_cc_binary {
47    name: "oatdumpd",
48    defaults: [
49        "art_debug_defaults",
50        "oatdump-defaults",
51    ],
52    shared_libs: [
53        "libartd",
54        "libartd-compiler",
55        "libartd-dexlayout",
56        "libartd-disassembler",
57        "libdexfiled",
58        "libartbased",
59        "libprofiled",
60        "libbase",
61    ],
62    apex_available: [
63        "com.android.art.debug",
64    ],
65}
66
67cc_defaults {
68    name: "oatdumps-defaults",
69    device_supported: false,
70    static_executable: true,
71    defaults: [
72        "oatdump-defaults",
73    ],
74    target: {
75        darwin: {
76            enabled: false,
77        },
78    },
79    ldflags: [
80        // We need this because GC stress mode makes use of
81        // _Unwind_GetIP and _Unwind_Backtrace and the symbols are also
82        // defined in libgcc_eh.a(unwind-dw2.o)
83        // TODO: Having this is not ideal as it might obscure errors.
84        // Try to get rid of it.
85        "-z muldefs",
86    ],
87    static_libs: ["libsigchain_fake"],
88}
89
90art_cc_binary {
91    name: "oatdumps",
92    defaults: [
93        "libart_static_defaults",
94        "libartbase_static_defaults",
95        "libdexfile_static_defaults",
96        "libprofile_static_defaults",
97        "libart-compiler_static_defaults",
98        "libart-dexlayout_static_defaults",
99        "oatdumps-defaults",
100    ],
101    static_libs: [
102        "libart-disassembler",
103        "libvixl",
104    ],
105    // We need this to resolve libartpalette symbols
106    // correctly. Multiple source libraries depend on it.
107    // TODO(b/122885634): This is also necessary for the static lib ordering bug
108    // with APEX stubs.
109    group_static_libs: true,
110}
111
112art_cc_binary {
113    name: "oatdumpds",
114    defaults: [
115        "art_debug_defaults",
116        "libartd_static_defaults",
117        "libartbased_static_defaults",
118        "libdexfiled_static_defaults",
119        "libprofiled_static_defaults",
120        "libartd-compiler_static_defaults",
121        "libartd-dexlayout_static_defaults",
122        "oatdumps-defaults",
123    ],
124    target: {
125        linux_glibc_x86_64: {
126            use_clang_lld: true,
127        },
128    },
129    static_libs: [
130        "libartd-disassembler",
131        "libvixld",
132    ],
133    group_static_libs: true,
134}
135
136art_cc_test {
137    name: "art_oatdump_tests",
138    defaults: [
139        "art_gtest_defaults",
140    ],
141    data: [
142        ":art-gtest-jars-ProfileTestMultiDex",
143    ],
144    srcs: [
145        "oatdump_app_test.cc",
146        "oatdump_test.cc",
147        "oatdump_image_test.cc",
148    ],
149    required: [
150        "oatdumpd",
151        "oatdumpds",
152        "dexdump",
153        "dex2oatd",
154        "dex2oatds",
155    ],
156}
157