Skip to content

Commit 3c99ecc

Browse files
committed
symlinked mold as "ld.mold" for "-fuse-ld=ld.mold"
1 parent a8861e3 commit 3c99ecc

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

.devcontainer/debian/bookworm/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ RUN echo "LLVM udate-alternatives" && \
376376
# We are using Clang++ for compilation, so this download + compile step must happen after installing LLVM+Clang.
377377
# We don't need to call mold's ./install-build-deps.sh, because all build dependencies are present.
378378
# Note to overwrite ld: sudo ln -sf /opt/mold/bin/mold $(realpath /usr/bin/ld)
379+
# Note: mold is also added as "ld.mold". why is "-fuse-ld=ld.mold" and not "-fuse-ld=mold" used in CMake?
379380

380381
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
381382
RUN echo "MOLD" && \
@@ -385,6 +386,7 @@ RUN echo "MOLD" && \
385386
cmake --build /tmp/mold/build -j "$(nproc)" && \
386387
cmake --install /tmp/mold/build --prefix=/opt/mold && \
387388
ln -s /opt/mold/bin/mold /usr/bin && \
389+
ln -sf /usr/bin/mold /usr/bin/ld.mold && \
388390
rm -rf /tmp/mold
389391

390392
#

.devcontainer/debian/trixie/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
400400
# We are using Clang++ for compilation, so this download + compile step must happen after installing LLVM+Clang.
401401
# We don't need to call mold's ./install-build-deps.sh, because all build dependencies are present.
402402
# Note to overwrite ld: sudo ln -sf /opt/mold/bin/mold $(realpath /usr/bin/ld)
403+
# Note: mold is also added as "ld.mold". why is "-fuse-ld=ld.mold" and not "-fuse-ld=mold" used in CMake?
403404

404405
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
405406
RUN echo "MOLD" && \
@@ -409,6 +410,7 @@ RUN echo "MOLD" && \
409410
cmake --build /tmp/mold/build -j "$(nproc)" && \
410411
cmake --install /tmp/mold/build --prefix=/opt/mold && \
411412
ln -s /opt/mold/bin/mold /usr/bin && \
413+
ln -sf /usr/bin/mold /usr/bin/ld.mold && \
412414
rm -rf /tmp/mold
413415

414416
#

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- "It was a bright day in April, and the clocks were striking thirteen." - 1984
1313

14+
- added symlink for /usr/bin/mold -> /usr/bin/ld.mold (for -fuse-ld)
15+
1416
## [1.0.12] - 2025-07-30
1517

1618
**Changed**

0 commit comments

Comments
 (0)