[AMDGPU] Make v8i16/v8f16 legal
[llvm-project.git] / utils / bazel / llvm-project-overlay / lld / BUILD.bazel
blobe204f7b81a0a29965a1fef49e7439ce850359139
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("//llvm:tblgen.bzl", "gentbl")
7 package(
8     default_visibility = ["//visibility:public"],
9     licenses = ["notice"],
12 # TODO: Actually compute version info
13 genrule(
14     name = "config_version_gen",
15     outs = ["include/lld/Common/Version.inc"],
16     cmd = "echo '#define LLD_VERSION_STRING \"14.0.0\"' > $@",
19 genrule(
20     name = "vcs_version_gen",
21     outs = ["Common/VCSVersion.inc"],
22     cmd = "echo '#undef LLD_REVISION' >> $@\n" +
23           "echo '#undef LLD_REPOSITORY' >> $@\n",
26 # See https://github.com/bazelbuild/bazel/issues/13803
27 cc_library(
28     name = "vcs_version",
29     hdrs = ["Common/VCSVersion.inc"],
30     strip_include_prefix = "Common",
33 cc_library(
34     name = "Common",
35     srcs = [":config_version_gen"] + glob(["Common/*.cpp"]),
36     hdrs = glob(["include/lld/Common/*.h"]),
37     includes = ["include"],
38     deps = [
39         ":vcs_version",
40         "//llvm:CodeGen",
41         "//llvm:Core",
42         "//llvm:Option",
43         "//llvm:Support",
44         "//llvm:Target",
45     ],
48 gentbl(
49     name = "elf_options_inc_gen",
50     # See https://github.com/bazelbuild/bazel/issues/13803
51     strip_include_prefix = "ELF",
52     tbl_outs = [(
53         "-gen-opt-parser-defs",
54         "ELF/Options.inc",
55     )],
56     tblgen = "//llvm:llvm-tblgen",
57     td_file = "ELF/Options.td",
58     td_srcs = [
59         "//llvm:include/llvm/Option/OptParser.td",
60     ],
63 cc_library(
64     name = "ELF",
65     srcs = glob([
66         "ELF/*.cpp",
67         "ELF/*.h",
68         "ELF/Arch/*.cpp",
69     ]),
70     includes = ["ELF"],
71     textual_hdrs = [
72         "ELF/Arch/PPCInsns.def",
73     ],
74     deps = [
75         ":Common",
76         ":elf_options_inc_gen",
77         "//llvm:AllTargetsAsmParsers",
78         "//llvm:AllTargetsCodeGens",
79         "//llvm:AllTargetsDisassemblers",
80         "//llvm:Analysis",
81         "//llvm:BinaryFormat",
82         "//llvm:BitReader",
83         "//llvm:BitWriter",
84         "//llvm:CodeGen",
85         "//llvm:Core",
86         "//llvm:DebugInfoDWARF",
87         "//llvm:Demangle",
88         "//llvm:IPO",
89         "//llvm:LTO",
90         "//llvm:Linker",
91         "//llvm:MC",
92         "//llvm:Object",
93         "//llvm:Option",
94         "//llvm:Passes",
95         "//llvm:Support",
96         "//llvm:TransformUtils",
97     ],
100 gentbl(
101     name = "coff_options_inc_gen",
102     # See https://github.com/bazelbuild/bazel/issues/13803
103     strip_include_prefix = "COFF",
104     tbl_outs = [(
105         "-gen-opt-parser-defs",
106         "COFF/Options.inc",
107     )],
108     tblgen = "//llvm:llvm-tblgen",
109     td_file = "COFF/Options.td",
110     td_srcs = [
111         "//llvm:include/llvm/Option/OptParser.td",
112     ],
115 cc_library(
116     name = "COFF",
117     srcs = glob([
118         "COFF/*.cpp",
119         "COFF/*.h",
120     ]),
121     includes = ["COFF"],
122     deps = [
123         ":Common",
124         ":coff_options_inc_gen",
125         "//llvm:AllTargetsAsmParsers",
126         "//llvm:AllTargetsCodeGens",
127         "//llvm:AllTargetsDisassemblers",
128         "//llvm:Analysis",
129         "//llvm:BitReader",
130         "//llvm:BitWriter",
131         "//llvm:Core",
132         "//llvm:DebugInfoPDB",
133         "//llvm:IPO",
134         "//llvm:LTO",
135         "//llvm:LibDriver",
136         "//llvm:Linker",
137         "//llvm:MC",
138         "//llvm:Object",
139         "//llvm:Option",
140         "//llvm:Support",
141         "//llvm:Symbolize",
142         "//llvm:TransformUtils",
143         "//llvm:WindowsManifest",
144     ],
147 gentbl(
148     name = "mingw_options_inc_gen",
149     tbl_outs = [(
150         "-gen-opt-parser-defs",
151         "MinGW/Options.inc",
152     )],
153     tblgen = "//llvm:llvm-tblgen",
154     td_file = "MinGW/Options.td",
155     td_srcs = [
156         "//llvm:include/llvm/Option/OptParser.td",
157     ],
160 cc_library(
161     name = "MinGW",
162     srcs = glob([
163         "MinGW/*.cpp",
164         "MinGW/*.h",
165     ]),
166     includes = ["MinGW"],
167     deps = [
168         ":Common",
169         ":mingw_options_inc_gen",
170         "//llvm:Option",
171         "//llvm:Support",
172     ],
175 gentbl(
176     name = "macho_options_inc_gen",
177     # See https://github.com/bazelbuild/bazel/issues/13803
178     strip_include_prefix = "MachO",
179     tbl_outs = [(
180         "-gen-opt-parser-defs",
181         "MachO/Options.inc",
182     )],
183     tblgen = "//llvm:llvm-tblgen",
184     td_file = "MachO/Options.td",
185     td_srcs = [
186         "//llvm:include/llvm/Option/OptParser.td",
187     ],
190 cc_library(
191     name = "MachO",
192     srcs = glob([
193         "MachO/**/*.cpp",
194         "MachO/**/*.h",
195     ]),
196     includes = ["MachO"],
197     deps = [
198         ":Common",
199         ":macho_options_inc_gen",
200         "//libunwind:unwind_headers_only",
201         "//llvm:LTO",
202     ],
205 gentbl(
206     name = "wasm_options_inc_gen",
207     # See https://github.com/bazelbuild/bazel/issues/13803
208     strip_include_prefix = "wasm",
209     tbl_outs = [(
210         "-gen-opt-parser-defs",
211         "wasm/Options.inc",
212     )],
213     tblgen = "//llvm:llvm-tblgen",
214     td_file = "wasm/Options.td",
215     td_srcs = [
216         "//llvm:include/llvm/Option/OptParser.td",
217     ],
220 cc_library(
221     name = "Wasm",
222     srcs = glob([
223         "wasm/*.cpp",
224         "wasm/*.h",
225     ]),
226     includes = ["wasm"],
227     deps = [
228         ":Common",
229         ":wasm_options_inc_gen",
230         "//llvm:AllTargetsAsmParsers",
231         "//llvm:AllTargetsCodeGens",
232         "//llvm:BinaryFormat",
233         "//llvm:Core",
234         "//llvm:LTO",
235         "//llvm:Object",
236         "//llvm:Option",
237         "//llvm:Support",
238     ],
241 cc_binary(
242     name = "lld",
243     srcs = glob([
244         "tools/lld/*.cpp",
245         "tools/lld/*.h",
246     ]),
247     tags = [
248         "manual",  # External dependency (libxml through WindowsManifest)
249         "nobuildkite",  # TODO(gcmn): Remote executors don't have libxml
250     ],
251     deps = [
252         ":COFF",
253         ":Common",
254         ":ELF",
255         ":MachO",
256         ":MinGW",
257         ":Wasm",
258         "//llvm:Support",
259     ],
262 # These are the required names for lld running under different environs.
264 # Unix/Linux require that the binary be named "ld.lld".
265 # macOS require that the binary be named "ld64.lld".
266 # Windows require that the binary be named "lld-link".
267 # WebAssembly builds require that the binary be named "wasm-ld".
268 genrule(
269     name = "gen_lld",
270     srcs = [":lld"],
271     outs = [
272         "ld.lld",
273         "ld64.lld",
274         "lld-link",
275         "wasm-ld",
276     ],
277     cmd =
278         "target=$$(basename $<); for n in ld.lld ld64.lld lld-link wasm-ld; do ln -sf $$target $(@D)/$$n; done",
279     output_to_bindir = 1,
280     tags = [
281         "manual",  # External dependency (libxml through WindowsManifest)
282         "nobuildkite",  # TODO(gcmn): Remote executors don't have libxml
283     ],