Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 1 | cc_defaults { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 2 | name: "llvm-defaults", |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 3 | defaults: ["llvm-defaults-no-generated-headers"], |
| 4 | header_libs: ["llvm-headers"], |
Chih-Hung Hsieh | a8de068 | 2017-08-09 10:27:27 -0700 | [diff] [blame] | 5 | tidy_checks: [ |
| 6 | "-google-build-*", |
| 7 | "-google-global-*", |
| 8 | ], |
Evgenii Stepanov | 2d76ce5 | 2019-01-04 17:37:15 -0800 | [diff] [blame^] | 9 | sanitize: { |
| 10 | hwaddress: false, // code size b/112437884 |
| 11 | }, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | // This module defines all of the defaults used to compiled llvm, except for |
| 15 | // the generated headers. It is necessary to avoid a circular dependency |
| 16 | // from the tblgen tool used to generate the headers to the generated headers. |
| 17 | llvm_defaults { |
| 18 | name: "llvm-defaults-no-generated-headers", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 19 | |
| 20 | host_supported: true, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 21 | |
| 22 | cflags: [ |
| 23 | "-D_GNU_SOURCE", |
| 24 | "-D__STDC_LIMIT_MACROS", |
| 25 | "-D__STDC_CONSTANT_MACROS", |
| 26 | "-D__STDC_FORMAT_MACROS", |
| 27 | "-fomit-frame-pointer", |
| 28 | "-Wall", |
| 29 | "-W", |
Yi Kong | fccb4bf | 2018-01-03 12:55:42 -0800 | [diff] [blame] | 30 | "-Wno-cast-qual", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 31 | "-Wno-sign-compare", |
| 32 | "-Wno-unused-parameter", |
| 33 | "-Wno-maybe-uninitialized", |
| 34 | "-Wno-missing-field-initializers", |
Chih-Hung Hsieh | 53d37e5 | 2018-09-05 15:41:45 -0700 | [diff] [blame] | 35 | "-Wno-implicit-fallthrough", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 36 | "-Wwrite-strings", |
| 37 | "-Werror", |
| 38 | "-Dsprintf=sprintf", |
| 39 | ], |
| 40 | |
| 41 | cppflags: [ |
| 42 | "-Wno-sign-promo", |
| 43 | "-std=c++11", |
| 44 | ], |
| 45 | |
Yi Kong | c3f7949 | 2017-05-01 14:53:13 -0700 | [diff] [blame] | 46 | clang_cflags: [ |
| 47 | // Temporarily suppress the warnings http://b/37867503 |
| 48 | "-Wno-error=unused-lambda-capture", |
| 49 | "-Wno-error=user-defined-warnings", |
| 50 | ], |
| 51 | |
Chih-Hung Hsieh | a8de068 | 2017-08-09 10:27:27 -0700 | [diff] [blame] | 52 | tidy_checks: [ |
| 53 | "-google-build-*", |
| 54 | "-google-global-*", |
| 55 | ], |
| 56 | |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 57 | header_libs: ["llvm-headers-no-generated-headers"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 58 | |
| 59 | target: { |
| 60 | android: { |
| 61 | cflags: [ |
| 62 | "-finline-functions", |
| 63 | ], |
Dan Willemsen | a880871 | 2017-10-16 20:08:05 -0700 | [diff] [blame] | 64 | }, |
| 65 | linux: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 66 | cppflags: [ |
| 67 | "-Woverloaded-virtual", |
| 68 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 69 | }, |
| 70 | host: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 71 | cppflags: [ |
| 72 | "-fno-rtti", |
| 73 | "-fno-exceptions", |
| 74 | ], |
| 75 | }, |
| 76 | windows: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 77 | // Disable certain warnings for use with mingw. |
| 78 | // We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally |
| 79 | // on the command line, and LLVM defines this internally itself. |
| 80 | cflags: [ |
| 81 | "-Wno-array-bounds", |
| 82 | "-Wno-comment", |
| 83 | "-UWIN32_LEAN_AND_MEAN", |
| 84 | ], |
| 85 | |
| 86 | host_ldlibs: ["-luuid"], |
| 87 | }, |
Dan Willemsen | a32f663 | 2017-10-02 10:41:09 -0700 | [diff] [blame] | 88 | linux_glibc: { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 89 | // Add on ncurses to have support for terminfo |
| 90 | host_ldlibs: [ |
| 91 | "-lncurses", |
| 92 | "-lgcc_s", |
| 93 | ], |
| 94 | }, |
| 95 | darwin: { |
| 96 | cppflags: [ |
| 97 | "-Wno-deprecated-declarations", |
| 98 | "-Woverloaded-virtual", |
| 99 | ], |
| 100 | |
| 101 | // Add on ncurses to have support for terminfo |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 102 | host_ldlibs: [ |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 103 | "-lncurses", |
| 104 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 105 | }, |
| 106 | }, |
| 107 | } |
| 108 | |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 109 | cc_library_headers { |
| 110 | name: "llvm-headers-no-generated-headers", |
Jiyong Park | 764e9266 | 2017-08-10 20:09:55 +0900 | [diff] [blame] | 111 | vendor_available: true, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 112 | host_supported: true, |
| 113 | export_include_dirs: ["include"], |
| 114 | target: { |
| 115 | android: { |
| 116 | export_include_dirs: ["device/include"], |
| 117 | }, |
| 118 | host: { |
| 119 | export_include_dirs: ["host/include"], |
| 120 | }, |
Dan Willemsen | 399e474 | 2017-03-15 16:58:24 -0700 | [diff] [blame] | 121 | linux_bionic: { |
| 122 | enabled: true, |
| 123 | }, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 124 | windows: { |
| 125 | enabled: true, |
| 126 | }, |
| 127 | }, |
| 128 | } |
| 129 | |
| 130 | cc_library_headers { |
| 131 | name: "llvm-headers", |
Jiyong Park | 764e9266 | 2017-08-10 20:09:55 +0900 | [diff] [blame] | 132 | vendor_available: true, |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 133 | host_supported: true, |
| 134 | header_libs: ["llvm-headers-no-generated-headers"], |
| 135 | export_header_lib_headers: ["llvm-headers-no-generated-headers"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 136 | generated_headers: [ |
| 137 | "llvm-gen-attributes", |
| 138 | "llvm-gen-intrinsics", |
| 139 | ], |
Colin Cross | 8a3437f | 2016-12-13 13:01:18 -0800 | [diff] [blame] | 140 | export_generated_headers: [ |
| 141 | "llvm-gen-attributes", |
| 142 | "llvm-gen-intrinsics", |
| 143 | ], |
| 144 | target: { |
| 145 | windows: { |
| 146 | enabled: true, |
| 147 | }, |
| 148 | }, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | llvm_tblgen { |
| 152 | name: "llvm-gen-attributes", |
| 153 | in: "include/llvm/IR/Attributes.td", |
| 154 | outs: ["llvm/IR/Attributes.inc"], |
| 155 | } |
| 156 | |
| 157 | llvm_tblgen { |
| 158 | name: "llvm-gen-intrinsics", |
| 159 | in: "include/llvm/IR/Intrinsics.td", |
| 160 | outs: ["llvm/IR/Intrinsics.gen"], |
| 161 | } |
| 162 | |
Colin Cross | d0b69265 | 2016-12-08 09:49:38 -0800 | [diff] [blame] | 163 | force_build_llvm_components_defaults { |
| 164 | name: "force_build_llvm_components", |
| 165 | // Host build disabled by soong/llvm.go unless FORCE_BUILD_LLVM_COMPONENTS |
| 166 | // environment variable is set |
| 167 | } |
| 168 | |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 169 | // LLVM shared library build |
| 170 | |
| 171 | llvm_arm_static_libraries = [ |
| 172 | "libLLVMARMCodeGen", |
| 173 | "libLLVMARMAsmParser", |
| 174 | "libLLVMARMAsmPrinter", |
| 175 | "libLLVMARMInfo", |
| 176 | "libLLVMARMDesc", |
| 177 | "libLLVMARMDisassembler", |
| 178 | ] |
| 179 | |
| 180 | llvm_x86_static_libraries = [ |
| 181 | "libLLVMX86CodeGen", |
| 182 | "libLLVMX86Info", |
| 183 | "libLLVMX86Desc", |
| 184 | "libLLVMX86AsmParser", |
| 185 | "libLLVMX86AsmPrinter", |
| 186 | "libLLVMX86Utils", |
| 187 | "libLLVMX86Disassembler", |
| 188 | ] |
| 189 | |
| 190 | llvm_mips_static_libraries = [ |
| 191 | "libLLVMMipsCodeGen", |
| 192 | "libLLVMMipsInfo", |
| 193 | "libLLVMMipsDesc", |
| 194 | "libLLVMMipsAsmParser", |
| 195 | "libLLVMMipsAsmPrinter", |
| 196 | "libLLVMMipsDisassembler", |
| 197 | ] |
| 198 | |
| 199 | llvm_aarch64_static_libraries = [ |
| 200 | "libLLVMAArch64CodeGen", |
| 201 | "libLLVMAArch64Info", |
| 202 | "libLLVMAArch64Desc", |
| 203 | "libLLVMAArch64AsmParser", |
| 204 | "libLLVMAArch64AsmPrinter", |
| 205 | "libLLVMAArch64Utils", |
| 206 | "libLLVMAArch64Disassembler", |
| 207 | ] |
| 208 | |
Pirama Arumuga Nainar | c6f1de7 | 2017-08-03 11:31:35 -0700 | [diff] [blame] | 209 | cc_library_shared { |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 210 | host_supported: true, |
Pirama Arumuga Nainar | c6f1de7 | 2017-08-03 11:31:35 -0700 | [diff] [blame] | 211 | name: "libLLVM_android", |
Colin Cross | d0b69265 | 2016-12-08 09:49:38 -0800 | [diff] [blame] | 212 | defaults: [ |
| 213 | "llvm-defaults", |
| 214 | "force_build_llvm_components", |
| 215 | ], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 216 | |
| 217 | whole_static_libs: [ |
| 218 | // pre static libraries |
| 219 | "libLLVMLinker", |
| 220 | "libLLVMipo", |
| 221 | "libLLVMDebugInfoDWARF", |
| 222 | "libLLVMDebugInfoPDB", |
| 223 | "libLLVMSymbolize", |
| 224 | "libLLVMIRReader", |
| 225 | "libLLVMBitWriter", |
| 226 | "libLLVMBitReader", |
| 227 | |
| 228 | // post static libraries |
| 229 | "libLLVMLTO", |
| 230 | "libLLVMAsmPrinter", |
| 231 | "libLLVMSelectionDAG", |
| 232 | "libLLVMCodeGen", |
| 233 | "libLLVMDebugInfoCodeView", |
| 234 | "libLLVMObject", |
| 235 | "libLLVMScalarOpts", |
| 236 | "libLLVMInstCombine", |
| 237 | "libLLVMInstrumentation", |
| 238 | "libLLVMTransformObjCARC", |
| 239 | "libLLVMTransformUtils", |
| 240 | "libLLVMAnalysis", |
| 241 | "libLLVMTarget", |
| 242 | "libLLVMGlobalISel", |
| 243 | "libLLVMMCDisassembler", |
| 244 | "libLLVMMC", |
| 245 | "libLLVMMCParser", |
| 246 | "libLLVMCore", |
| 247 | "libLLVMAsmParser", |
| 248 | "libLLVMOption", |
| 249 | "libLLVMSupport", |
| 250 | "libLLVMVectorize", |
| 251 | "libLLVMProfileData", |
| 252 | "libLLVMProfileDataCoverage", |
| 253 | "libLLVMLibDriver", |
Nicolas Norvez | a5aee7a | 2017-06-23 13:56:49 -0700 | [diff] [blame] | 254 | "libLLVMExecutionEngine", |
| 255 | "libLLVMRuntimeDyld", |
| 256 | "libLLVMMCJIT", |
| 257 | "libLLVMOrcJIT", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 258 | ], |
| 259 | |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 260 | export_include_dirs: ["include"], |
| 261 | |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 262 | target: { |
| 263 | host: { |
| 264 | // Host build pulls in all ARM, Mips, X86 components. |
Nicolas Norvez | a5aee7a | 2017-06-23 13:56:49 -0700 | [diff] [blame] | 265 | whole_static_libs: llvm_arm_static_libraries + |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 266 | llvm_aarch64_static_libraries + |
| 267 | llvm_mips_static_libraries + |
| 268 | llvm_x86_static_libraries, |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 269 | export_include_dirs: ["host/include"], |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 270 | }, |
| 271 | windows: { |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 272 | enabled: true, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 273 | host_ldlibs: [ |
| 274 | "-limagehlp", |
| 275 | "-lpsapi", |
| 276 | "-lole32", |
| 277 | "-lversion", |
| 278 | ], |
| 279 | }, |
Colin Cross | 7e5fa1a | 2016-12-06 16:42:05 -0800 | [diff] [blame] | 280 | android: { |
| 281 | export_include_dirs: ["device/include"], |
| 282 | }, |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 283 | android_arm: { |
| 284 | whole_static_libs: llvm_arm_static_libraries, |
| 285 | }, |
| 286 | android_x86: { |
| 287 | whole_static_libs: llvm_x86_static_libraries + |
| 288 | llvm_arm_static_libraries + |
| 289 | llvm_aarch64_static_libraries, |
| 290 | }, |
| 291 | android_x86_64: { |
| 292 | whole_static_libs: llvm_x86_static_libraries + |
| 293 | llvm_arm_static_libraries + |
| 294 | llvm_aarch64_static_libraries, |
| 295 | }, |
| 296 | android_mips: { |
| 297 | whole_static_libs: llvm_mips_static_libraries, |
| 298 | }, |
| 299 | android_mips64: { |
| 300 | whole_static_libs: llvm_mips_static_libraries, |
| 301 | }, |
| 302 | android_arm64: { |
| 303 | whole_static_libs: llvm_aarch64_static_libraries + |
| 304 | llvm_arm_static_libraries, |
| 305 | }, |
| 306 | }, |
| 307 | } |
| 308 | |
| 309 | subdirs = [ |
| 310 | "soong", |
Colin Cross | d4da2d9 | 2016-12-01 14:49:11 -0800 | [diff] [blame] | 311 | "lib", |
| 312 | "tools/*", |
Colin Cross | 4094d25 | 2016-11-21 17:18:40 -0800 | [diff] [blame] | 313 | "utils/*", |
| 314 | ] |