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
9 load("//llvm:binary_alias.bzl", "binary_alias")
10 load("//llvm:driver.bzl", "llvm_driver_cc_binary")
11 load("//llvm:tblgen.bzl", "gentbl")
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",
56 "//llvm:TargetParser",
62 name = "elf_options_inc_gen",
63 # See https://github.com/bazelbuild/bazel/issues/13803
64 strip_include_prefix = "ELF",
66 "-gen-opt-parser-defs",
69 tblgen = "//llvm:llvm-tblgen",
70 td_file = "ELF/Options.td",
72 "//llvm:include/llvm/Option/OptParser.td",
85 "ELF/Arch/PPCInsns.def",
89 ":elf_options_inc_gen",
90 "//llvm:AllTargetsAsmParsers",
91 "//llvm:AllTargetsCodeGens",
92 "//llvm:AllTargetsDisassemblers",
94 "//llvm:BinaryFormat",
99 "//llvm:DebugInfoDWARF",
110 "//llvm:TargetParser",
111 "//llvm:TransformUtils",
119 name = "coff_options_inc_gen",
120 # See https://github.com/bazelbuild/bazel/issues/13803
121 strip_include_prefix = "COFF",
123 "-gen-opt-parser-defs",
126 tblgen = "//llvm:llvm-tblgen",
127 td_file = "COFF/Options.td",
129 "//llvm:include/llvm/Option/OptParser.td",
142 ":coff_options_inc_gen",
143 "//llvm:AllTargetsAsmParsers",
144 "//llvm:AllTargetsCodeGens",
145 "//llvm:AllTargetsDisassemblers",
147 "//llvm:BinaryFormat",
152 "//llvm:DebugInfoCodeView",
153 "//llvm:DebugInfoMSF",
154 "//llvm:DebugInfoPDB",
166 "//llvm:TargetParser",
167 "//llvm:TransformUtils",
168 "//llvm:WindowsDriver",
169 "//llvm:WindowsManifest",
175 name = "mingw_options_inc_gen",
177 "-gen-opt-parser-defs",
180 tblgen = "//llvm:llvm-tblgen",
181 td_file = "MinGW/Options.td",
183 "//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",
233 "//llvm:DebugInfoDWARF",
240 "//llvm:ProfileData",
242 "//llvm:TargetParser",
249 name = "wasm_options_inc_gen",
250 # See https://github.com/bazelbuild/bazel/issues/13803
251 strip_include_prefix = "wasm",
253 "-gen-opt-parser-defs",
256 tblgen = "//llvm:llvm-tblgen",
257 td_file = "wasm/Options.td",
259 "//llvm:include/llvm/Option/OptParser.td",
272 ":wasm_options_inc_gen",
273 "//llvm:AllTargetsAsmParsers",
274 "//llvm:AllTargetsCodeGens",
275 "//llvm:BinaryFormat",
283 "//llvm:ProfileData",
285 "//llvm:TargetParser",
292 srcs = glob(["tools/lld/*.cpp"]),
301 "//llvm:TargetParser",
305 llvm_driver_cc_binary(
310 # These are the required names for lld running under different environs.
312 # Unix/Linux require that the binary be named "ld.lld".
313 # macOS require that the binary be named "ld64.lld".
314 # Windows require that the binary be named "lld-link".
315 # WebAssembly builds require that the binary be named "wasm-ld".