1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
6 load("//llvm:tblgen.bzl", "gentbl")
7 load("//llvm:binary_alias.bzl", "binary_alias")
14 default_visibility = ["//visibility:public"],
15 features = ["layering_check"],
20 # TODO: Actually compute version info
22 name = "config_version_gen",
23 outs = ["include/lld/Common/Version.inc"],
24 cmd = "echo '#define LLD_VERSION_STRING \"{}\"' > $@".format(LLVM_VERSION),
28 name = "vcs_version_gen",
29 outs = ["Common/VCSVersion.inc"],
30 cmd = "echo '#undef LLD_REVISION' >> $@\n" +
31 "echo '#undef LLD_REPOSITORY' >> $@\n",
34 # See https://github.com/bazelbuild/bazel/issues/13803
37 hdrs = ["Common/VCSVersion.inc"],
38 strip_include_prefix = "Common",
43 srcs = [":config_version_gen"] + glob(["Common/*.cpp"]),
44 hdrs = glob(["include/lld/Common/*.h"]),
45 includes = ["include"],
50 "//llvm:DebugInfoDWARF",
55 "//llvm:TargetParser",
61 name = "elf_options_inc_gen",
62 # See https://github.com/bazelbuild/bazel/issues/13803
63 strip_include_prefix = "ELF",
65 "-gen-opt-parser-defs",
68 tblgen = "//llvm:llvm-tblgen",
69 td_file = "ELF/Options.td",
71 "//llvm:include/llvm/Option/OptParser.td",
84 "ELF/Arch/PPCInsns.def",
88 ":elf_options_inc_gen",
89 "//llvm:AllTargetsAsmParsers",
90 "//llvm:AllTargetsCodeGens",
91 "//llvm:AllTargetsDisassemblers",
93 "//llvm:BinaryFormat",
98 "//llvm:DebugInfoDWARF",
109 "//llvm:TargetParser",
110 "//llvm:TransformUtils",
118 name = "coff_options_inc_gen",
119 # See https://github.com/bazelbuild/bazel/issues/13803
120 strip_include_prefix = "COFF",
122 "-gen-opt-parser-defs",
125 tblgen = "//llvm:llvm-tblgen",
126 td_file = "COFF/Options.td",
128 "//llvm:include/llvm/Option/OptParser.td",
141 ":coff_options_inc_gen",
142 "//llvm:AllTargetsAsmParsers",
143 "//llvm:AllTargetsCodeGens",
144 "//llvm:AllTargetsDisassemblers",
146 "//llvm:BinaryFormat",
151 "//llvm:DebugInfoCodeView",
152 "//llvm:DebugInfoMSF",
153 "//llvm:DebugInfoPDB",
165 "//llvm:TargetParser",
166 "//llvm:TransformUtils",
167 "//llvm:WindowsDriver",
168 "//llvm:WindowsManifest",
174 name = "mingw_options_inc_gen",
176 "-gen-opt-parser-defs",
179 tblgen = "//llvm:llvm-tblgen",
180 td_file = "MinGW/Options.td",
182 "//llvm:include/llvm/Option/OptParser.td",
192 includes = ["MinGW"],
195 ":mingw_options_inc_gen",
198 "//llvm:TargetParser",
203 name = "macho_options_inc_gen",
204 # See https://github.com/bazelbuild/bazel/issues/13803
205 strip_include_prefix = "MachO",
207 "-gen-opt-parser-defs",
210 tblgen = "//llvm:llvm-tblgen",
211 td_file = "MachO/Options.td",
213 "//llvm:include/llvm/Option/OptParser.td",
223 includes = ["MachO"],
226 ":macho_options_inc_gen",
227 "//libunwind:unwind_headers_only",
228 "//llvm:BinaryFormat",
232 "//llvm:DebugInfoDWARF",
240 "//llvm:TargetParser",
247 name = "wasm_options_inc_gen",
248 # See https://github.com/bazelbuild/bazel/issues/13803
249 strip_include_prefix = "wasm",
251 "-gen-opt-parser-defs",
254 tblgen = "//llvm:llvm-tblgen",
255 td_file = "wasm/Options.td",
257 "//llvm:include/llvm/Option/OptParser.td",
270 ":wasm_options_inc_gen",
271 "//llvm:AllTargetsAsmParsers",
272 "//llvm:AllTargetsCodeGens",
273 "//llvm:BinaryFormat",
281 "//llvm:TargetParser",
288 out = "lld-driver.cpp",
290 "@TOOL_NAME@": "lld",
292 template = "//llvm:cmake/modules/llvm-driver-template.cpp.in",
300 ]) + ["lld-driver.cpp"],
309 "//llvm:TargetParser",
313 # These are the required names for lld running under different environs.
315 # Unix/Linux require that the binary be named "ld.lld".
316 # macOS require that the binary be named "ld64.lld".
317 # Windows require that the binary be named "lld-link".
318 # WebAssembly builds require that the binary be named "wasm-ld".