2022-02-16 17:11:38 +01:00
|
|
|
FROM ubuntu:latest AS gcc-builder
|
2020-11-27 13:57:49 +01:00
|
|
|
|
|
|
|
RUN apt-get update; \
|
|
|
|
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
bzip2\
|
|
|
|
dpkg-dev \
|
|
|
|
file \
|
|
|
|
wget \
|
|
|
|
curl \
|
|
|
|
build-essential \
|
|
|
|
imagemagick \
|
|
|
|
libbz2-dev \
|
|
|
|
libc6-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libdb-dev \
|
|
|
|
libevent-dev \
|
|
|
|
libffi-dev \
|
|
|
|
libgdbm-dev \
|
|
|
|
libglib2.0-dev \
|
|
|
|
libgmp-dev \
|
|
|
|
libjpeg-dev \
|
|
|
|
libkrb5-dev \
|
|
|
|
liblzma-dev \
|
|
|
|
libmagickcore-dev \
|
|
|
|
libmagickwand-dev \
|
|
|
|
libmaxminddb-dev \
|
|
|
|
libncurses5-dev \
|
|
|
|
libncursesw5-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libreadline-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libtool \
|
|
|
|
libwebp-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
libyaml-dev \
|
|
|
|
make \
|
|
|
|
patch \
|
|
|
|
unzip \
|
|
|
|
xz-utils \
|
|
|
|
zlib1g-dev \
|
|
|
|
flex \
|
|
|
|
bison
|
|
|
|
|
|
|
|
ADD . /usr/src/gcc
|
|
|
|
RUN /bin/sh -c set -ex; \
|
|
|
|
cd /usr/src/gcc; \
|
|
|
|
./contrib/download_prerequisites; { rm *.tar.* || true; }; \
|
|
|
|
mkdir -p /usr/src/gcc/gcc-build; \
|
|
|
|
cd /usr/src/gcc/gcc-build; \
|
2020-12-04 17:31:02 +01:00
|
|
|
/usr/src/gcc/configure --disable-bootstrap --disable-multilib --enable-languages=rust; \
|
2020-11-27 13:57:49 +01:00
|
|
|
make -j "$(nproc)"; \
|
|
|
|
make install-strip; \
|
|
|
|
cd /root; \
|
|
|
|
rm -rf /usr/src/gcc
|
|
|
|
|
|
|
|
RUN /bin/sh -c set -ex; \
|
|
|
|
echo '/usr/local/lib64' > /etc/ld.so.conf.d/local-lib64.conf; \
|
|
|
|
ldconfig -v
|
|
|
|
|
|
|
|
RUN /bin/sh -c set -ex; \
|
|
|
|
dpkg-divert --divert /usr/bin/gcc.orig --rename /usr/bin/gcc; \
|
|
|
|
dpkg-divert --divert /usr/bin/g++.orig --rename /usr/bin/g++; \
|
|
|
|
update-alternatives --install /usr/bin/cc cc /usr/local/bin/gcc 999
|
|
|
|
|
2022-02-16 17:11:38 +01:00
|
|
|
FROM rust
|
|
|
|
COPY --from=gcc-builder /usr/ /usr/
|
|
|
|
RUN cargo install --git https://github.com/Rust-GCC/cargo-gccrs cargo-gccrs
|
2020-11-27 13:57:49 +01:00
|
|
|
|
|
|
|
CMD ["bash"]
|