diff --git a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel @@ -4,6 +4,7 @@ load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("//llvm:tblgen.bzl", "gentbl") +load("//llvm:binary_alias.bzl", "binary_alias") load( "//:vars.bzl", "LLVM_VERSION", @@ -315,16 +316,15 @@ # macOS require that the binary be named "ld64.lld". # Windows require that the binary be named "lld-link". # WebAssembly builds require that the binary be named "wasm-ld". -genrule( - name = "gen_lld", - srcs = [":lld"], - outs = [ +[ + binary_alias( + name = name, + binary = ":lld", + ) + for name in [ "ld.lld", "ld64.lld", "lld-link", "wasm-ld", - ], - cmd = - "target=$$(basename $<); for n in ld.lld ld64.lld lld-link wasm-ld; do ln -sf $$target $(@D)/$$n; done", - output_to_bindir = 1, -) + ] +]