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: [ |
| 25 | "-O3", |
| 26 | |
| 27 | // Base set of cflags used by all things ART. |
| 28 | "-fno-rtti", |
| 29 | "-ggdb3", |
| 30 | "-Wall", |
| 31 | "-Werror", |
| 32 | "-Wextra", |
| 33 | "-Wstrict-aliasing", |
| 34 | "-fstrict-aliasing", |
| 35 | "-Wunreachable-code", |
| 36 | "-Wredundant-decls", |
| 37 | "-Wshadow", |
| 38 | "-Wunused", |
| 39 | "-fvisibility=protected", |
| 40 | |
| 41 | // Warn about thread safety violations with clang. |
| 42 | "-Wthread-safety", |
| 43 | "-Wthread-safety-negative", |
| 44 | |
| 45 | // Warn if switch fallthroughs aren't annotated. |
| 46 | "-Wimplicit-fallthrough", |
| 47 | |
| 48 | // Enable float equality warnings. |
| 49 | "-Wfloat-equal", |
| 50 | |
| 51 | // Enable warning of converting ints to void*. |
| 52 | "-Wint-to-void-pointer-cast", |
| 53 | |
| 54 | // Enable warning of wrong unused annotations. |
| 55 | "-Wused-but-marked-unused", |
| 56 | |
| 57 | // Enable warning for deprecated language features. |
| 58 | "-Wdeprecated", |
| 59 | |
| 60 | // Enable warning for unreachable break & return. |
| 61 | "-Wunreachable-code-break", |
| 62 | "-Wunreachable-code-return", |
| 63 | |
| 64 | // Bug: http://b/29823425 Disable -Wconstant-conversion and |
| 65 | // -Wundefined-var-template for Clang update to r271374 |
| 66 | "-Wno-constant-conversion", |
| 67 | "-Wno-undefined-var-template", |
| 68 | |
| 69 | "-DART_STACK_OVERFLOW_GAP_arm=8192", |
| 70 | "-DART_STACK_OVERFLOW_GAP_arm64=8192", |
| 71 | "-DART_STACK_OVERFLOW_GAP_mips=16384", |
| 72 | "-DART_STACK_OVERFLOW_GAP_mips64=16384", |
| 73 | "-DART_STACK_OVERFLOW_GAP_x86=8192", |
| 74 | "-DART_STACK_OVERFLOW_GAP_x86_64=8192", |
| 75 | ], |
| 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 | ], |
| 104 | }, |
| 105 | host: { |
| 106 | cflags: [ |
| 107 | // Bug: 15446488. We don't omit the frame pointer to work around |
| 108 | // clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress. |
| 109 | "-fno-omit-frame-pointer", |
| 110 | ], |
| 111 | }, |
| 112 | }, |
| 113 | |
| 114 | codegen: { |
| 115 | arm: { |
| 116 | cflags: ["-DART_ENABLE_CODEGEN_arm"], |
| 117 | }, |
| 118 | arm64: { |
| 119 | cflags: ["-DART_ENABLE_CODEGEN_arm64"], |
| 120 | }, |
| 121 | mips: { |
| 122 | cflags: ["-DART_ENABLE_CODEGEN_mips"], |
| 123 | }, |
| 124 | mips64: { |
| 125 | cflags: ["-DART_ENABLE_CODEGEN_mips64"], |
| 126 | }, |
| 127 | x86: { |
| 128 | cflags: ["-DART_ENABLE_CODEGEN_x86"], |
| 129 | }, |
| 130 | x86_64: { |
| 131 | cflags: ["-DART_ENABLE_CODEGEN_x86_64"], |
| 132 | }, |
| 133 | }, |
| 134 | |
| 135 | include_dirs: [ |
| 136 | "external/gtest/include", |
| 137 | "external/icu/icu4c/source/common", |
| 138 | "external/lz4/lib", |
| 139 | "external/valgrind/include", |
| 140 | "external/valgrind", |
| 141 | "external/vixl/src", |
| 142 | "external/zlib", |
| 143 | ], |
| 144 | } |
| 145 | |
| 146 | cc_defaults { |
| 147 | name: "art_debug_defaults", |
| 148 | cflags: [ |
| 149 | "-O2", |
| 150 | "-DDYNAMIC_ANNOTATIONS_ENABLED=1", |
| 151 | "-DVIXL_DEBUG", |
| 152 | "-UNDEBUG", |
| 153 | "-Wno-frame-larger-than=", |
| 154 | ], |
| 155 | asflags: [ |
| 156 | "-UNDEBUG", |
| 157 | ], |
| 158 | } |