Skip to content

Commit 3afb301

Browse files
committed
wip: try fix for mold issue 1496
1 parent 175a245 commit 3afb301

4 files changed

Lines changed: 38 additions & 10 deletions

File tree

.docker/Dockerfile.alpine

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ RUN if [ "$ARCH" == "amd64" ] || [ "$ARCH" == "arm64v8" ]; then \
105105

106106
RUN pip3 install --break-system-packages --root-user-action ignore mistletoe
107107

108+
# Install mold-patch
109+
RUN apk add linux-headers
110+
COPY install-mold-patch.sh /usr/local/bin/install-mold-patch.sh
111+
RUN --mount=type=cache,id=ccache,target=/root/.ccache --mount=type=cache,id=pkgcache,target=/root/.pkgcache \
112+
bash /usr/local/bin/install-mold-patch.sh
113+
RUN apk del linux-headers
108114
RUN apk add py3-xxhash py3-zstd py3-lz4
109115

110116
# Set up git & user

.docker/build-linux.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,6 @@ esac
186186
case "-$BUILD_TYPE-" in
187187
*-static-*)
188188
case "$CROSS_ARCH" in
189-
ppc64le)
190-
# https://github.com/rui314/mold/issues/1496
191-
CMAKE_ARGS="${CMAKE_ARGS} -DDISABLE_MOLD=1"
192-
export LDFLAGS="${LDFLAGS} -fuse-ld=lld"
193-
;;
194189
*)
195190
export LDFLAGS="${LDFLAGS} -fuse-ld=mold"
196191
;;

.docker/install-mold-patch.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
cd "$HOME"
6+
mkdir pkgs
7+
cd pkgs
8+
9+
MOLD_VERSION=2.40.3
10+
11+
mv -f /usr/local/bin/mold /usr/local/bin/mold.old
12+
13+
fetch.sh https://github.com/rui314/mold/archive/refs/tags/v${MOLD_VERSION}.tar.gz mold-${MOLD_VERSION}.tar.gz
14+
tar xf mold-${MOLD_VERSION}.tar.gz
15+
cd mold-${MOLD_VERSION}
16+
fetch.sh https://github.com/rui314/mold/commit/d9b20a158097a376154cb692f607edbe7a823338.diff - | patch -p1
17+
mkdir build
18+
cd build
19+
20+
export PATH="/usr/lib/ccache/bin:$PATH"
21+
22+
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
23+
ninja
24+
ninja install
25+
26+
cd "$HOME"
27+
rm -rf pkgs

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,12 @@ jobs:
356356
build_dist: alpine
357357
build_type: gcc-release-ninja-static
358358
cross_arch: ppc64le
359+
skip_slow_tests: true
359360

360-
######## blocked by https://github.com/rui314/mold/issues/1496
361-
# - build_arch: amd64
362-
# build_dist: alpine
363-
# build_type: gcc-release-lto-ninja-static
364-
# cross_arch: ppc64le
361+
- build_arch: amd64
362+
build_dist: alpine
363+
build_type: gcc-release-lto-ninja-static
364+
cross_arch: ppc64le
365365

366366
######## no libressl support
367367
# - build_arch: amd64

0 commit comments

Comments
 (0)