File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,20 @@ RUN mkdir -p .cargo && cargo vendor vendor/ > .cargo/config.toml
2626# Stage 2: Build
2727FROM rust@sha256:a31942999645514ff53f470d395a9b3f06e05149faa845732d0cdf132767dcbd AS builder
2828
29- # Install musl toolchain and clang (needed for bindgen)
29+ # Install musl toolchain, clang (for bindgen), and gcc (for libgcc )
3030RUN apt-get update && apt-get install -y --no-install-recommends \
3131 musl-tools \
3232 musl-dev \
3333 clang \
3434 libclang-dev \
35+ gcc \
3536 && rm -rf /var/lib/apt/lists/*
3637
3738RUN rustup target add x86_64-unknown-linux-musl
3839
3940# Use musl-gcc wrapper for proper static linking with musl
40- ENV CC_x86_64_unknown_linux_musl=musl-gcc
41+ ENV CC_x86_64_unknown_linux_musl=musl-gcc \
42+ CFLAGS_x86_64_unknown_linux_musl="-lgcc"
4143
4244WORKDIR /build
4345
@@ -47,9 +49,10 @@ ARG SOURCE_DATE_EPOCH
4749RUN test -n "$SOURCE_DATE_EPOCH" || (echo "ERROR: SOURCE_DATE_EPOCH build arg is required" && exit 1)
4850
4951# Reproducibility environment variables
50- # Added -C link-arg=-s to strip symbols for bit-for-bit identity
52+ # -C link-arg=-lgcc: link libgcc for CPU intrinsics used by reth-mdbx-sys
53+ # -C link-arg=-s: strip symbols for bit-for-bit identity
5154ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
52- RUSTFLAGS="--remap-path-prefix=/build=/build --remap-path-prefix=/cargo=/cargo -C target-feature=+crt-static -C link-arg=-s" \
55+ RUSTFLAGS="--remap-path-prefix=/build=/build --remap-path-prefix=/cargo=/cargo -C target-feature=+crt-static -C link-arg=-lgcc -C link-arg=- s" \
5356 CARGO_HOME=/cargo \
5457 LANG=C.UTF-8 \
5558 LC_ALL=C.UTF-8 \
You can’t perform that action at this time.
0 commit comments