Skip to content

Commit 0a17d43

Browse files
authored
ARM64: build librsvg without the -Zbuild-std feature flag (#123)
This is no longer necessary after PR rust-lang/compiler-builtins#444.
1 parent 9dd527e commit 0a17d43

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

build/lin.sh

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,7 @@ if [ "$DARWIN" = true ]; then
184184
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
185185
| sh -s -- -y --no-modify-path --profile minimal ${DARWIN_ARM:+--default-toolchain nightly}
186186
if [ "$DARWIN_ARM" = true ]; then
187-
${CARGO_HOME}/bin/rustup component add rust-src
188187
${CARGO_HOME}/bin/rustup target add aarch64-apple-darwin
189-
190-
# Rebuild the standard library of Rust to avoid collisions with system libraries.
191-
# See: https://github.com/lovell/sharp-libvips/issues/109
192-
printf "[unstable]\n\
193-
build-std = [\"std\", \"panic_abort\"]\n\
194-
build-std-features = [\"panic_immediate_abort\"]" > ${CARGO_HOME}/config.toml
195188
fi
196189
fi
197190

@@ -446,16 +439,6 @@ ninja -C _build install
446439
mkdir ${DEPS}/svg
447440
$CURL https://download.gnome.org/sources/librsvg/$(without_patch $VERSION_SVG)/librsvg-${VERSION_SVG}.tar.xz | tar xJC ${DEPS}/svg --strip-components=1
448441
cd ${DEPS}/svg
449-
# Allow building vendored sources with `-Zbuild-std`, see:
450-
# https://github.com/rust-lang/wg-cargo-std-aware/issues/23#issuecomment-720455524
451-
if [[ $PLATFORM == *"-arm64v8" ]]; then
452-
RUST_SRC=$(rustc +nightly --print sysroot)/lib/rustlib/src/rust
453-
RUST_TEST=$RUST_SRC/library/test
454-
# Copy the Cargo.lock for Rust to places `vendor` will see
455-
cp $RUST_SRC/Cargo.lock $RUST_TEST
456-
# Actually do the vendor
457-
cargo +nightly vendor -s $RUST_TEST/Cargo.toml
458-
fi
459442
sed -i'.bak' "s/^\(Requires:.*\)/\1 cairo-gobject pangocairo/" librsvg.pc.in
460443
# LTO optimization does not work for staticlib+rlib compilation
461444
sed -i'.bak' "s/, \"rlib\"//" Cargo.toml

linux-arm64v8/Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,11 @@ RUN \
3434
--profile minimal \
3535
--default-toolchain nightly \
3636
&& \
37-
rustup component add rust-src && \
3837
rustup target add aarch64-unknown-linux-gnu && \
3938
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
4039
pip3 install --upgrade pip && \
4140
pip3 install meson ninja
4241

43-
# Rebuild the standard library of Rust to avoid collisions with system libraries.
44-
# See: https://github.com/lovell/sharp-libvips/issues/109
45-
RUN \
46-
printf "[unstable]\n\
47-
build-std = [\"std\", \"panic_abort\"]\n\
48-
build-std-features = [\"panic_immediate_abort\"]" > $CARGO_HOME/config.toml
49-
5042
# Compiler settings
5143
ENV \
5244
PLATFORM="linux-arm64v8" \

linuxmusl-arm64v8/Dockerfile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,9 @@ RUN \
4545
--profile minimal \
4646
--default-toolchain nightly \
4747
&& \
48-
rustup component add rust-src && \
4948
rustup target add aarch64-unknown-linux-musl && \
5049
pip3 install meson
5150

52-
# Rebuild the standard library of Rust to avoid collisions with system libraries.
53-
# See: https://github.com/lovell/sharp-libvips/issues/109
54-
RUN \
55-
printf "[unstable]\n\
56-
build-std = [\"std\", \"panic_abort\"]\n\
57-
build-std-features = [\"panic_immediate_abort\"]" > $CARGO_HOME/config.toml
58-
5951
# Compiler settings
6052
ENV \
6153
PKG_CONFIG="/bin/aarch64-linux-musl-pkg-config" \
@@ -69,7 +61,7 @@ ENV \
6961
# The toolchain will produce static libs by default.
7062
# We also need to add the directory containing libc.a to the library search path.
7163
ENV \
72-
RUSTFLAGS="-C target-feature=-crt-static -Lnative=/aarch64-linux-musl/lib"
64+
RUSTFLAGS="-Ctarget-feature=-crt-static -Lnative=/aarch64-linux-musl/lib"
7365

7466
COPY Toolchain.cmake /root/
7567
COPY meson.ini /root/

0 commit comments

Comments
 (0)