Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 1 | bootstrap_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 | |
| 19 | art_global_defaults { |
| 20 | // Additional flags are computed by art.go |
| 21 | |
| 22 | name: "art_defaults", |
| 23 | clang: true, |
| 24 | cflags: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 25 | // 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", |
| 73 | ], |
| 74 | |
| 75 | target: { |
| 76 | android: { |
| 77 | cflags: [ |
| 78 | "-DART_TARGET", |
| 79 | |
| 80 | // Enable missing-noreturn only on non-Mac. As lots of things are not implemented |
| 81 | // for Apple, it's a pain. |
| 82 | "-Wmissing-noreturn", |
| 83 | |
| 84 | // To use oprofile_android --callgraph, uncomment this and recompile with |
| 85 | // mmma -j art |
| 86 | // "-fno-omit-frame-pointer", |
| 87 | // "-marm", |
| 88 | // "-mapcs", |
| 89 | ], |
| 90 | include_dirs: [ |
| 91 | // We optimize Thread::Current() with a direct TLS access. This requires access to a |
| 92 | // private Bionic header. |
| 93 | "bionic/libc/private", |
| 94 | ], |
| 95 | }, |
| 96 | linux: { |
| 97 | cflags: [ |
| 98 | // Enable missing-noreturn only on non-Mac. As lots of things are not implemented for |
| 99 | // Apple, it's a pain. |
| 100 | "-Wmissing-noreturn", |
| 101 | ], |
Colin Cross | 38a3ffa | 2016-09-08 14:19:51 -0700 | [diff] [blame] | 102 | host_ldlibs: [ |
| 103 | "-lrt", |
| 104 | ], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 105 | }, |
| 106 | host: { |
| 107 | cflags: [ |
| 108 | // Bug: 15446488. We don't omit the frame pointer to work around |
| 109 | // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress. |
| 110 | "-fno-omit-frame-pointer", |
| 111 | ], |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 112 | host_ldlibs: [ |
| 113 | "-ldl", |
| 114 | "-lpthread", |
Colin Cross | fe6064a | 2016-08-30 13:49:26 -0700 | [diff] [blame] | 115 | ], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 116 | }, |
| 117 | }, |
| 118 | |
| 119 | codegen: { |
| 120 | arm: { |
| 121 | cflags: ["-DART_ENABLE_CODEGEN_arm"], |
| 122 | }, |
| 123 | arm64: { |
| 124 | cflags: ["-DART_ENABLE_CODEGEN_arm64"], |
| 125 | }, |
| 126 | mips: { |
| 127 | cflags: ["-DART_ENABLE_CODEGEN_mips"], |
| 128 | }, |
| 129 | mips64: { |
| 130 | cflags: ["-DART_ENABLE_CODEGEN_mips64"], |
| 131 | }, |
| 132 | x86: { |
| 133 | cflags: ["-DART_ENABLE_CODEGEN_x86"], |
| 134 | }, |
| 135 | x86_64: { |
| 136 | cflags: ["-DART_ENABLE_CODEGEN_x86_64"], |
| 137 | }, |
| 138 | }, |
| 139 | |
| 140 | include_dirs: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 141 | "external/icu/icu4c/source/common", |
| 142 | "external/lz4/lib", |
| 143 | "external/valgrind/include", |
| 144 | "external/valgrind", |
| 145 | "external/vixl/src", |
| 146 | "external/zlib", |
| 147 | ], |
| 148 | } |
| 149 | |
Colin Cross | be332ed | 2016-09-21 13:23:53 -0700 | [diff] [blame] | 150 | art_debug_defaults { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 151 | name: "art_debug_defaults", |
| 152 | cflags: [ |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 153 | "-DDYNAMIC_ANNOTATIONS_ENABLED=1", |
| 154 | "-DVIXL_DEBUG", |
| 155 | "-UNDEBUG", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 156 | ], |
| 157 | asflags: [ |
| 158 | "-UNDEBUG", |
| 159 | ], |
Colin Cross | c564406 | 2016-08-30 15:41:08 -0700 | [diff] [blame] | 160 | target: { |
| 161 | // This has to be duplicated for android and host to make sure it |
| 162 | // comes after the -Wframe-larger-than warnings inserted by art.go |
| 163 | // target-specific properties |
| 164 | android: { |
| 165 | cflags: ["-Wno-frame-larger-than="], |
| 166 | }, |
| 167 | host: { |
| 168 | cflags: ["-Wno-frame-larger-than="], |
| 169 | }, |
| 170 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 171 | } |