[llvm] Create symlink for llvm-link in libc docker image (PR #210929)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 20:26:37 PDT 2026


https://github.com/jinge90 updated https://github.com/llvm/llvm-project/pull/210929

>From 6f589cc64614666621561a1c28d488d2d1fffa07 Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Tue, 21 Jul 2026 18:09:22 +0800
Subject: [PATCH 1/4] Install llvm 23 in libc docker image

Signed-off-by: jinge90 <ge.jin at intel.com>
---
 .github/workflows/containers/libc/Dockerfile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/containers/libc/Dockerfile b/.github/workflows/containers/libc/Dockerfile
index 1367b89fab104..1794ea3f3da8b 100644
--- a/.github/workflows/containers/libc/Dockerfile
+++ b/.github/workflows/containers/libc/Dockerfile
@@ -51,8 +51,10 @@ RUN wget https://apt.llvm.org/llvm.sh && \
 # testing CI for libc-based compiler-rt builtins. The package only symlinks
 # the tools into /usr/bin under versioned names (lit-23, FileCheck-23, ...),
 # so also symlink them under their canonical names.
-RUN apt-get install -y llvm-23-tools && \
-    ln -s -t /usr/bin $(dpkg -L llvm-23-tools | grep '^/usr/lib/llvm-23/bin/')
+# Also install LLVM tools to include llvm-link, we use it to build bitcode
+# for GPU targets.
+RUN apt-get install -y llvm-23-tools llvm-23 && \
+    ln -s -t /usr/bin $(dpkg -L llvm-23-tools llvm-23 | grep '^/usr/lib/llvm-23/bin/')
 
 
 # Install gmp and mpfr for cross compilation

>From 8e297643eb8137da711c323bbc4d2b299c0ebab6 Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Thu, 23 Jul 2026 11:16:37 +0800
Subject: [PATCH 2/4] create symlink for llvm-link instead of installing
 llvm-23

Signed-off-by: jinge90 <ge.jin at intel.com>
---
 .github/workflows/containers/libc/Dockerfile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/containers/libc/Dockerfile b/.github/workflows/containers/libc/Dockerfile
index 1794ea3f3da8b..83f5624e9a017 100644
--- a/.github/workflows/containers/libc/Dockerfile
+++ b/.github/workflows/containers/libc/Dockerfile
@@ -51,11 +51,13 @@ RUN wget https://apt.llvm.org/llvm.sh && \
 # testing CI for libc-based compiler-rt builtins. The package only symlinks
 # the tools into /usr/bin under versioned names (lit-23, FileCheck-23, ...),
 # so also symlink them under their canonical names.
-# Also install LLVM tools to include llvm-link, we use it to build bitcode
-# for GPU targets.
 RUN apt-get install -y llvm-23-tools llvm-23 && \
     ln -s -t /usr/bin $(dpkg -L llvm-23-tools llvm-23 | grep '^/usr/lib/llvm-23/bin/')
 
+# llvm-link is required to build bitcode library for GPU targets
+RUN if [ ! -e /usr/bin/llvm-link ]; then \
+      ln -s /usr/lib/llvm-23/bin/llvm-link /usr/bin/llvm-link; \
+    fi
 
 # Install gmp and mpfr for cross compilation
 RUN wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz && \

>From f6980ab1c021f5b1b9acc469b09e86d77794d084 Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Thu, 23 Jul 2026 15:21:14 +0800
Subject: [PATCH 3/4] revert downloading llvm-23

Signed-off-by: jinge90 <ge.jin at intel.com>
---
 .github/workflows/containers/libc/Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/containers/libc/Dockerfile b/.github/workflows/containers/libc/Dockerfile
index 83f5624e9a017..04deecf28233c 100644
--- a/.github/workflows/containers/libc/Dockerfile
+++ b/.github/workflows/containers/libc/Dockerfile
@@ -51,8 +51,8 @@ RUN wget https://apt.llvm.org/llvm.sh && \
 # testing CI for libc-based compiler-rt builtins. The package only symlinks
 # the tools into /usr/bin under versioned names (lit-23, FileCheck-23, ...),
 # so also symlink them under their canonical names.
-RUN apt-get install -y llvm-23-tools llvm-23 && \
-    ln -s -t /usr/bin $(dpkg -L llvm-23-tools llvm-23 | grep '^/usr/lib/llvm-23/bin/')
+RUN apt-get install -y llvm-23-tools && \
+    ln -s -t /usr/bin $(dpkg -L llvm-23-tools | grep '^/usr/lib/llvm-23/bin/')
 
 # llvm-link is required to build bitcode library for GPU targets
 RUN if [ ! -e /usr/bin/llvm-link ]; then \

>From 6515c28cbf085ed3335f24f135680b42f558b0aa Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Fri, 24 Jul 2026 11:25:53 +0800
Subject: [PATCH 4/4] Fold the symlink create

Signed-off-by: jinge90 <ge.jin at intel.com>
---
 .github/workflows/containers/libc/Dockerfile | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/containers/libc/Dockerfile b/.github/workflows/containers/libc/Dockerfile
index 04deecf28233c..d2cb71435059a 100644
--- a/.github/workflows/containers/libc/Dockerfile
+++ b/.github/workflows/containers/libc/Dockerfile
@@ -51,13 +51,10 @@ RUN wget https://apt.llvm.org/llvm.sh && \
 # testing CI for libc-based compiler-rt builtins. The package only symlinks
 # the tools into /usr/bin under versioned names (lit-23, FileCheck-23, ...),
 # so also symlink them under their canonical names.
-RUN apt-get install -y llvm-23-tools && \
-    ln -s -t /usr/bin $(dpkg -L llvm-23-tools | grep '^/usr/lib/llvm-23/bin/')
-
 # llvm-link is required to build bitcode library for GPU targets
-RUN if [ ! -e /usr/bin/llvm-link ]; then \
-      ln -s /usr/lib/llvm-23/bin/llvm-link /usr/bin/llvm-link; \
-    fi
+RUN apt-get install -y llvm-23-tools && \
+    ln -s -t /usr/bin $(dpkg -L llvm-23-tools | grep '^/usr/lib/llvm-23/bin/') && \
+    ln -s /usr/lib/llvm-23/bin/llvm-link /usr/bin/llvm-link
 
 # Install gmp and mpfr for cross compilation
 RUN wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz && \



More information about the llvm-commits mailing list