Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 1 | cc_defaults { |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 2 | name: "llvm80-defaults", |
| 3 | defaults: ["llvm80-defaults-no-generated-headers"], |
| 4 | header_libs: ["llvm80-headers"], |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 5 | } |
| 6 | |
| 7 | // This module defines all of the defaults used to compiled llvm, except for |
| 8 | // the generated headers. It is necessary to avoid a circular dependency |
| 9 | // from the tblgen tool used to generate the headers to the generated headers. |
| 10 | llvm_defaults { |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 11 | name: "llvm80-defaults-no-generated-headers", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 12 | |
| 13 | host_supported: true, |
| 14 | clang: true, |
| 15 | |
| 16 | cflags: [ |
| 17 | "-D_GNU_SOURCE", |
| 18 | "-D__STDC_LIMIT_MACROS", |
| 19 | "-D__STDC_CONSTANT_MACROS", |
| 20 | "-D__STDC_FORMAT_MACROS", |
| 21 | "-fomit-frame-pointer", |
| 22 | "-Wall", |
| 23 | "-W", |
| 24 | "-Wno-sign-compare", |
| 25 | "-Wno-unused-parameter", |
| 26 | "-Wno-maybe-uninitialized", |
| 27 | "-Wno-missing-field-initializers", |
| 28 | "-Wwrite-strings", |
| 29 | "-Werror", |
| 30 | "-Dsprintf=sprintf", |
| 31 | ], |
| 32 | |
| 33 | cppflags: [ |
| 34 | "-Wno-sign-promo", |
| 35 | "-std=c++11", |
| 36 | ], |
| 37 | |
| 38 | clang_cflags: [ |
| 39 | // Temporarily suppress the warnings http://b/37867503 |
| 40 | "-Wno-error=unused-lambda-capture", |
| 41 | "-Wno-error=user-defined-warnings", |
| 42 | ], |
| 43 | |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 44 | header_libs: ["llvm80-headers-no-generated-headers"], |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 45 | |
| 46 | target: { |
| 47 | android: { |
| 48 | cflags: [ |
| 49 | "-finline-functions", |
| 50 | ], |
| 51 | cppflags: [ |
| 52 | "-Woverloaded-virtual", |
| 53 | ], |
| 54 | }, |
| 55 | host: { |
| 56 | cppflags: [ |
| 57 | "-fno-rtti", |
| 58 | "-fno-exceptions", |
| 59 | ], |
| 60 | }, |
| 61 | windows: { |
| 62 | // Disable certain warnings for use with mingw. |
| 63 | // We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally |
| 64 | // on the command line, and LLVM defines this internally itself. |
| 65 | cflags: [ |
| 66 | "-Wno-array-bounds", |
| 67 | "-Wno-comment", |
| 68 | "-UWIN32_LEAN_AND_MEAN", |
| 69 | ], |
| 70 | |
| 71 | host_ldlibs: ["-luuid"], |
| 72 | }, |
| 73 | linux: { |
| 74 | cppflags: ["-Woverloaded-virtual"], |
| 75 | |
| 76 | // Add on ncurses to have support for terminfo |
| 77 | host_ldlibs: [ |
| 78 | "-ldl", |
| 79 | "-lncurses", |
| 80 | "-lgcc_s", |
| 81 | ], |
| 82 | }, |
| 83 | darwin: { |
| 84 | cppflags: [ |
| 85 | "-Wno-deprecated-declarations", |
| 86 | "-Woverloaded-virtual", |
| 87 | ], |
| 88 | |
| 89 | // Add on ncurses to have support for terminfo |
| 90 | host_ldlibs: [ |
| 91 | "-ldl", |
| 92 | "-lncurses", |
| 93 | ], |
| 94 | }, |
| 95 | }, |
| 96 | } |
| 97 | |
| 98 | cc_library_headers { |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 99 | name: "llvm80-headers-no-generated-headers", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 100 | vendor_available: true, |
| 101 | host_supported: true, |
| 102 | export_include_dirs: ["include"], |
| 103 | target: { |
| 104 | android: { |
| 105 | export_include_dirs: ["device/include"], |
| 106 | }, |
| 107 | host: { |
| 108 | export_include_dirs: ["host/include"], |
| 109 | }, |
| 110 | linux_bionic: { |
| 111 | enabled: true, |
| 112 | }, |
| 113 | windows: { |
| 114 | enabled: true, |
| 115 | }, |
| 116 | }, |
| 117 | } |
| 118 | |
| 119 | cc_library_headers { |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 120 | name: "llvm80-headers", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 121 | vendor_available: true, |
| 122 | host_supported: true, |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 123 | header_libs: ["llvm80-headers-no-generated-headers"], |
| 124 | export_header_lib_headers: ["llvm80-headers-no-generated-headers"], |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 125 | generated_headers: [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 126 | "llvm80-gen-attributes", |
| 127 | "llvm80-gen-intrinsics", |
| 128 | "llvm80-gen-revision", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 129 | ], |
| 130 | export_generated_headers: [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 131 | "llvm80-gen-attributes", |
| 132 | "llvm80-gen-intrinsics", |
| 133 | "llvm80-gen-revision", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 134 | ], |
| 135 | target: { |
| 136 | windows: { |
| 137 | enabled: true, |
| 138 | }, |
| 139 | }, |
| 140 | } |
| 141 | |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 142 | llvm80_tblgen { |
| 143 | name: "llvm80-gen-attributes", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 144 | in: "include/llvm/IR/Attributes.td", |
Mauro Rossi | 6062a8e | 2018-09-01 16:10:24 +0200 | [diff] [blame] | 145 | outs: ["llvm/IR/Attributes.inc"], |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 146 | } |
| 147 | |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 148 | llvm80_tblgen { |
| 149 | name: "llvm80-gen-intrinsics", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 150 | in: "include/llvm/IR/Intrinsics.td", |
Mauro Rossi | 64fcb24 | 2018-09-01 16:24:14 +0200 | [diff] [blame] | 151 | outs: [ |
| 152 | "llvm/IR/IntrinsicEnums.inc", |
| 153 | "llvm/IR/IntrinsicImpl.inc", |
| 154 | ], |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 155 | } |
| 156 | |
Mauro Rossi | 0187681 | 2018-09-08 18:32:44 +0200 | [diff] [blame] | 157 | genrule { |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 158 | name: "llvm80-gen-revision", |
Mauro Rossi | 0187681 | 2018-09-08 18:32:44 +0200 | [diff] [blame] | 159 | out: ["llvm/Support/VCSRevision.h"], |
Chih-Wei Huang | d9e3677 | 2018-09-12 19:01:54 +0800 | [diff] [blame] | 160 | srcs: [".git/logs/HEAD*"], |
Mauro Rossi | 0187681 | 2018-09-08 18:32:44 +0200 | [diff] [blame] | 161 | tool_files: ["git_sha1_gen.py"], |
| 162 | cmd: "python $(location git_sha1_gen.py) --output $(out)", |
| 163 | } |
| 164 | |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 165 | force_build_llvm80_components_defaults { |
| 166 | name: "force_build_llvm80_components", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 167 | // Host build disabled by soong/llvm.go unless FORCE_BUILD_LLVM_COMPONENTS |
| 168 | // environment variable is set |
| 169 | } |
| 170 | |
| 171 | // LLVM shared library build |
| 172 | |
| 173 | llvm_arm_static_libraries = [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 174 | "libLLVM80ARMCodeGen", |
| 175 | "libLLVM80ARMAsmParser", |
| 176 | "libLLVM80ARMAsmPrinter", |
| 177 | "libLLVM80ARMInfo", |
| 178 | "libLLVM80ARMDesc", |
| 179 | "libLLVM80ARMDisassembler", |
| 180 | "libLLVM80ARMUtils", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 181 | ] |
| 182 | |
| 183 | llvm_x86_static_libraries = [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 184 | "libLLVM80X86CodeGen", |
| 185 | "libLLVM80X86Info", |
| 186 | "libLLVM80X86Desc", |
| 187 | "libLLVM80X86AsmParser", |
| 188 | "libLLVM80X86AsmPrinter", |
| 189 | "libLLVM80X86Utils", |
| 190 | "libLLVM80X86Disassembler", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 191 | ] |
| 192 | |
| 193 | llvm_mips_static_libraries = [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 194 | "libLLVM80MipsCodeGen", |
| 195 | "libLLVM80MipsInfo", |
| 196 | "libLLVM80MipsDesc", |
| 197 | "libLLVM80MipsAsmParser", |
| 198 | "libLLVM80MipsAsmPrinter", |
| 199 | "libLLVM80MipsDisassembler", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 200 | ] |
| 201 | |
| 202 | llvm_aarch64_static_libraries = [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 203 | "libLLVM80AArch64CodeGen", |
| 204 | "libLLVM80AArch64Info", |
| 205 | "libLLVM80AArch64Desc", |
| 206 | "libLLVM80AArch64AsmParser", |
| 207 | "libLLVM80AArch64AsmPrinter", |
| 208 | "libLLVM80AArch64Utils", |
| 209 | "libLLVM80AArch64Disassembler", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 210 | ] |
| 211 | |
| 212 | llvm_amdgpu_static_libraries = [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 213 | "libLLVM80AMDGPUCodeGen", |
| 214 | "libLLVM80AMDGPUInfo", |
| 215 | "libLLVM80AMDGPUDesc", |
| 216 | "libLLVM80AMDGPUAsmParser", |
| 217 | "libLLVM80AMDGPUAsmPrinter", |
| 218 | "libLLVM80AMDGPUUtils", |
Mauro Rossi | abf2f0a | 2019-09-20 21:54:52 +0200 | [diff] [blame] | 219 | "libLLVM80AMDGPUDisassembler", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 220 | ] |
| 221 | |
| 222 | |
| 223 | cc_library_shared { |
| 224 | host_supported: true, |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 225 | name: "libLLVM80", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 226 | defaults: [ |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 227 | "llvm80-defaults", |
| 228 | "force_build_llvm80_components", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 229 | ], |
| 230 | |
| 231 | whole_static_libs: [ |
| 232 | // pre static libraries |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 233 | "libLLVM80Linker", |
| 234 | "libLLVM80ipo", |
| 235 | "libLLVM80DebugInfoDWARF", |
| 236 | "libLLVM80DebugInfoMSF", |
| 237 | "libLLVM80DebugInfoPDB", |
| 238 | "libLLVM80Symbolize", |
| 239 | "libLLVM80IRReader", |
| 240 | "libLLVM80BitWriter", |
| 241 | "libLLVM80BitReader", |
| 242 | "libLLVM80Passes", |
| 243 | "libLLVM80Demangle", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 244 | |
| 245 | // post static libraries |
Mauro Rossi | 6f67667 | 2019-02-23 13:23:31 +0100 | [diff] [blame] | 246 | "libLLVM80LTO", |
| 247 | "libLLVM80AsmPrinter", |
| 248 | "libLLVM80SelectionDAG", |
| 249 | "libLLVM80CodeGen", |
| 250 | "libLLVM80DebugInfoCodeView", |
| 251 | "libLLVM80Object", |
| 252 | "libLLVM80ScalarOpts", |
| 253 | "libLLVM80AggressiveInstCombine", |
| 254 | "libLLVM80InstCombine", |
| 255 | "libLLVM80Instrumentation", |
| 256 | "libLLVM80TransformObjCARC", |
| 257 | "libLLVM80TransformUtils", |
| 258 | "libLLVM80Analysis", |
| 259 | "libLLVM80Target", |
| 260 | "libLLVM80GlobalISel", |
| 261 | "libLLVM80MCDisassembler", |
| 262 | "libLLVM80MC", |
| 263 | "libLLVM80MCParser", |
| 264 | "libLLVM80Core", |
| 265 | "libLLVM80AsmParser", |
| 266 | "libLLVM80Option", |
| 267 | "libLLVM80Support", |
| 268 | "libLLVM80Vectorize", |
| 269 | "libLLVM80ProfileData", |
| 270 | "libLLVM80ProfileDataCoverage", |
| 271 | "libLLVM80LibDriver", |
| 272 | "libLLVM80ExecutionEngine", |
| 273 | "libLLVM80RuntimeDyld", |
| 274 | "libLLVM80MCJIT", |
| 275 | "libLLVM80OrcJIT", |
| 276 | "libLLVM80BinaryFormat", |
Mauro Rossi | 069e6d8 | 2019-09-22 19:52:06 +0200 | [diff] [blame] | 277 | "libLLVM80Coroutines", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 278 | ], |
| 279 | |
| 280 | export_include_dirs: ["include"], |
| 281 | |
| 282 | target: { |
| 283 | host: { |
| 284 | // Host build pulls in all ARM, Mips, X86 components. |
| 285 | whole_static_libs: llvm_arm_static_libraries + |
| 286 | llvm_aarch64_static_libraries + |
| 287 | llvm_mips_static_libraries + |
| 288 | llvm_x86_static_libraries, |
| 289 | export_include_dirs: ["host/include"], |
| 290 | }, |
| 291 | windows: { |
| 292 | enabled: true, |
| 293 | host_ldlibs: [ |
| 294 | "-limagehlp", |
| 295 | "-lpsapi", |
| 296 | "-lole32", |
| 297 | "-lversion", |
| 298 | ], |
| 299 | }, |
| 300 | darwin: { |
| 301 | host_ldlibs: [ |
| 302 | "-ldl", |
| 303 | "-lpthread", |
| 304 | ], |
| 305 | }, |
| 306 | linux: { |
| 307 | host_ldlibs: [ |
| 308 | "-ldl", |
| 309 | "-lpthread", |
| 310 | ], |
| 311 | }, |
| 312 | android: { |
| 313 | export_include_dirs: ["device/include"], |
| 314 | whole_static_libs: llvm_amdgpu_static_libraries, |
| 315 | }, |
| 316 | android_arm: { |
| 317 | whole_static_libs: llvm_arm_static_libraries, |
| 318 | }, |
| 319 | android_x86: { |
| 320 | whole_static_libs: llvm_x86_static_libraries + |
| 321 | llvm_arm_static_libraries + |
| 322 | llvm_aarch64_static_libraries, |
| 323 | }, |
| 324 | android_x86_64: { |
| 325 | whole_static_libs: llvm_x86_static_libraries + |
| 326 | llvm_arm_static_libraries + |
| 327 | llvm_aarch64_static_libraries, |
| 328 | }, |
| 329 | android_mips: { |
| 330 | whole_static_libs: llvm_mips_static_libraries, |
| 331 | }, |
| 332 | android_mips64: { |
| 333 | whole_static_libs: llvm_mips_static_libraries, |
| 334 | }, |
| 335 | android_arm64: { |
| 336 | whole_static_libs: llvm_aarch64_static_libraries + |
| 337 | llvm_arm_static_libraries, |
| 338 | }, |
| 339 | }, |
| 340 | } |
| 341 | |
| 342 | subdirs = [ |
| 343 | "soong", |
| 344 | "lib", |
Mauro Rossi | dda8679 | 2018-08-25 13:23:34 +0200 | [diff] [blame] | 345 | "utils/TableGen", |
Mauro Rossi | 4bdf303 | 2018-08-25 12:44:44 +0200 | [diff] [blame] | 346 | ] |