Skip to content

Commit 06203c4

Browse files
committed
Make dist.sh reproducible for ARM32 on ARM64
1 parent 2320676 commit 06203c4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dist.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,15 @@ timestamp=$(git log -1 --format=%ct)
200200
# Build mold in a container.
201201
mkdir -p dist
202202

203+
# If the host is ARM64, `uname -m` in an ARM32 container running on it
204+
# reports it not as ARM32 but as ARM64, which confuses BLAKE3's cmake script
205+
# and erroneously enables NEON SIMD instructions. `setarch` can be used
206+
# to change the output of `uname -m`.
207+
[ $arch = arm ] && setarch='setarch linux32'
208+
203209
podman run --arch $arch -it --rm --userns=host --pids-limit=-1 --network=none \
204-
--pull=never -v "$(pwd):/mold:ro" -v "$(pwd)/dist:/dist" $image bash -c "
210+
--pull=never -v "$(pwd):/mold:ro" -v "$(pwd)/dist:/dist" $image \
211+
$setarch bash -c "
205212
set -e
206213
export SOURCE_DATE_EPOCH=$timestamp
207214
mkdir /build

0 commit comments

Comments
 (0)