blob: 6c9f1d4dd16287b714545894876403a5e8f7f8de [file] [log] [blame]
Colin Cross1f7f3bd2016-07-27 10:12:38 -07001bootstrap_go_package {
2 name: "soong-art",
3 pkgPath: "android/soong/art",
4 deps: [
5 "blueprint",
6 "blueprint-pathtools",
7 "soong",
8 "soong-android",
9 "soong-cc",
10 ],
11 srcs: [
12 "art.go",
13 "codegen.go",
14 "makevars.go",
15 ],
16 pluginFor: ["soong_build"],
17}
18
19art_global_defaults {
20 // Additional flags are computed by art.go
21
22 name: "art_defaults",
23 clang: true,
24 cflags: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -070025 // Base set of cflags used by all things ART.
26 "-fno-rtti",
27 "-ggdb3",
28 "-Wall",
29 "-Werror",
30 "-Wextra",
31 "-Wstrict-aliasing",
32 "-fstrict-aliasing",
33 "-Wunreachable-code",
34 "-Wredundant-decls",
35 "-Wshadow",
36 "-Wunused",
37 "-fvisibility=protected",
38
39 // Warn about thread safety violations with clang.
40 "-Wthread-safety",
41 "-Wthread-safety-negative",
42
43 // Warn if switch fallthroughs aren't annotated.
44 "-Wimplicit-fallthrough",
45
46 // Enable float equality warnings.
47 "-Wfloat-equal",
48
49 // Enable warning of converting ints to void*.
50 "-Wint-to-void-pointer-cast",
51
52 // Enable warning of wrong unused annotations.
53 "-Wused-but-marked-unused",
54
55 // Enable warning for deprecated language features.
56 "-Wdeprecated",
57
58 // Enable warning for unreachable break & return.
59 "-Wunreachable-code-break",
60 "-Wunreachable-code-return",
61
62 // Bug: http://b/29823425 Disable -Wconstant-conversion and
63 // -Wundefined-var-template for Clang update to r271374
64 "-Wno-constant-conversion",
65 "-Wno-undefined-var-template",
66
67 "-DART_STACK_OVERFLOW_GAP_arm=8192",
68 "-DART_STACK_OVERFLOW_GAP_arm64=8192",
69 "-DART_STACK_OVERFLOW_GAP_mips=16384",
70 "-DART_STACK_OVERFLOW_GAP_mips64=16384",
71 "-DART_STACK_OVERFLOW_GAP_x86=8192",
72 "-DART_STACK_OVERFLOW_GAP_x86_64=8192",
David Sehrae3bcac2017-02-03 15:19:00 -080073 // Enable thread annotations for std::mutex, etc.
74 "-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070075 ],
76
77 target: {
78 android: {
79 cflags: [
80 "-DART_TARGET",
81
82 // Enable missing-noreturn only on non-Mac. As lots of things are not implemented
83 // for Apple, it's a pain.
84 "-Wmissing-noreturn",
85
86 // To use oprofile_android --callgraph, uncomment this and recompile with
87 // mmma -j art
88 // "-fno-omit-frame-pointer",
89 // "-marm",
90 // "-mapcs",
91 ],
92 include_dirs: [
93 // We optimize Thread::Current() with a direct TLS access. This requires access to a
94 // private Bionic header.
95 "bionic/libc/private",
96 ],
97 },
98 linux: {
99 cflags: [
100 // Enable missing-noreturn only on non-Mac. As lots of things are not implemented for
101 // Apple, it's a pain.
102 "-Wmissing-noreturn",
103 ],
Colin Cross38a3ffa2016-09-08 14:19:51 -0700104 host_ldlibs: [
105 "-lrt",
106 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700107 },
108 host: {
109 cflags: [
110 // Bug: 15446488. We don't omit the frame pointer to work around
111 // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
112 "-fno-omit-frame-pointer",
113 ],
Colin Crossfe6064a2016-08-30 13:49:26 -0700114 host_ldlibs: [
115 "-ldl",
116 "-lpthread",
Colin Crossfe6064a2016-08-30 13:49:26 -0700117 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700118 },
119 },
120
121 codegen: {
122 arm: {
123 cflags: ["-DART_ENABLE_CODEGEN_arm"],
124 },
125 arm64: {
126 cflags: ["-DART_ENABLE_CODEGEN_arm64"],
127 },
128 mips: {
129 cflags: ["-DART_ENABLE_CODEGEN_mips"],
130 },
131 mips64: {
132 cflags: ["-DART_ENABLE_CODEGEN_mips64"],
133 },
134 x86: {
135 cflags: ["-DART_ENABLE_CODEGEN_x86"],
136 },
137 x86_64: {
138 cflags: ["-DART_ENABLE_CODEGEN_x86_64"],
139 },
140 },
141
142 include_dirs: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700143 "external/icu/icu4c/source/common",
144 "external/lz4/lib",
145 "external/valgrind/include",
146 "external/valgrind",
147 "external/vixl/src",
148 "external/zlib",
Igor Murashkin3b6f4402017-02-16 16:13:17 -0800149 "libnativehelper/platform_include"
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700150 ],
Andreas Gampe61501212016-11-03 16:48:51 -0700151
152 tidy_checks: [
153 "-google-default-arguments",
154 ],
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700155}
156
Colin Crossbe332ed2016-09-21 13:23:53 -0700157art_debug_defaults {
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700158 name: "art_debug_defaults",
159 cflags: [
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700160 "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
161 "-DVIXL_DEBUG",
162 "-UNDEBUG",
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700163 ],
164 asflags: [
165 "-UNDEBUG",
166 ],
Colin Crossc5644062016-08-30 15:41:08 -0700167 target: {
168 // This has to be duplicated for android and host to make sure it
169 // comes after the -Wframe-larger-than warnings inserted by art.go
170 // target-specific properties
171 android: {
172 cflags: ["-Wno-frame-larger-than="],
173 },
174 host: {
175 cflags: ["-Wno-frame-larger-than="],
176 },
177 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -0700178}