[Pkg-rust-maintainers] Bug#881846: build for armel
Marco A L Barbosa
malbarbo at gmail.com
Thu Dec 28 15:20:59 UTC 2017
After https://github.com/rust-lang/rust/pull/47018 got merged I was able to
cross build to armel (but not tested) using this docker file
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
sudo \
xz-utils \
zlib1g-dev \
g++-arm-linux-gnueabi \
bzip2 \
patch \
libssl-dev \
pkg-config
WORKDIR /tmp
ENV TARGETS=armv4t-unknown-linux-gnueabi
RUN echo "#!/bin/sh\narm-linux-gnueabi-gcc -Wl,--allow-multiple-definition
\"\$@\"" > /usr/bin/arm-linux-gnueabi-gcc2
RUN chmod +x /usr/bin/arm-linux-gnueabi-gcc2
RUN cat /usr/bin/arm-linux-gnueabi-gcc2
ENV CC_armv4t_unknown_linux_gnueabi=arm-linux-gnueabi-gcc2 \
CFLAGS_armv4t_unknown_linux_gnueabi="-march=armv4t -marm
-mfloat-abi=soft" \
CXX_armv4t_unknown_linux_gnueabi=arm-linux-gnueabi-g++ \
CXXFLAGS_armv4t_unknown_linux_gnueabi="-march=armv4t -marm
-mfloat-abi=soft"
# Suppress some warnings in the openwrt toolchains we downloaded
ENV STAGING_DIR=/tmp
ENV RUST_CONFIGURE_ARGS \
--target=$TARGETS \
--host=$TARGETS
ENV SCRIPT python2.7 ../x.py dist --host $TARGETS --target $TARGETS
# sccache
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
Ubuntu 17.10 was necessary because it has a recent gcc (with fix for
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727621)
--allow-multiple-definition hack was necessary because function
__sync_fetch_and_add_4 (and similar) is defined in libgcc and
compiler_builtins (
https://github.com/rust-lang-nursery/compiler-builtins/pull/115)
--
Marco A L Barbosa
http://malbarbo.pro.br
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-rust-maintainers/attachments/20171228/35f2ca95/attachment.html>
More information about the Pkg-rust-maintainers
mailing list