[PATCH] D157830: [bazel] Use binary_alias instead of symlinks for ld.lld and friends

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 21:02:14 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG87554d1c0e3f: [bazel] Use binary_alias instead of symlinks for ld.lld and friends (authored by anguslees, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157830/new/

https://reviews.llvm.org/D157830

Files:
  utils/bazel/llvm-project-overlay/lld/BUILD.bazel


Index: utils/bazel/llvm-project-overlay/lld/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/lld/BUILD.bazel
+++ 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,
-)
+    ]
+]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157830.549785.patch
Type: text/x-patch
Size: 1068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230814/73fa66b5/attachment.bin>


More information about the llvm-commits mailing list