This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (65 loc) · 2.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Base image
FROM ubuntu:16.04
# Set version and description of mips-none-elf-gcc
LABEL version="1.0.0" description="mips-none-elf toolchain"
# Set binutils, GCC and newlib versions
ARG BINUTILS_VERSION=2.28
ARG GCC_VERSION=6.3.0
ARG NEWLIB_VERSION=2.5.0.20170623
# Set build parameters
ARG TARGET=mips-none-elf
ARG PREFIX=/usr/local/$TARGET
ENV PATH=$PATH:$PREFIX/bin
WORKDIR /home
RUN apt-get update && apt-get install -qq \
bzip2 \
gcc \
gcc-multilib \
g++ \
make \
wget \
&& wget http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.gz \
&& tar -xzf binutils-$BINUTILS_VERSION.tar.gz \
&& rm binutils-$BINUTILS_VERSION.tar.gz \
&& wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz \
&& tar -xzf gcc-$GCC_VERSION.tar.gz \
&& rm gcc-$GCC_VERSION.tar.gz \
&& wget ftp://sourceware.org/pub/newlib/newlib-$NEWLIB_VERSION.tar.gz \
&& tar -xzf newlib-$NEWLIB_VERSION.tar.gz \
&& rm newlib-$NEWLIB_VERSION.tar.gz \
&& mkdir build-binutils \
&& cd build-binutils \
&& ../binutils-$BINUTILS_VERSION/configure --target=$TARGET --prefix=$PREFIX \
&& make -j5 all \
&& make -j5 install \
&& cd ../gcc-$GCC_VERSION \
&& ./contrib/download_prerequisites \
&& mkdir ../build-gcc \
&& cd ../build-gcc \
&& ../gcc-$GCC_VERSION/configure --target=$TARGET --prefix=$PREFIX --without-headers --with-newlib --with-gnu-as --with-gnu-ld \
&& make -j5 all-gcc \
&& make -j5 install-gcc \
&& mkdir ../build-newlib \
&& cd ../build-newlib \
&& ../newlib-$NEWLIB_VERSION/configure --target=$TARGET --prefix=$PREFIX \
&& make -j5 all \
&& make -j5 install \
&& cd ../build-gcc \
&& ../gcc-$GCC_VERSION/configure --target=$TARGET --prefix=$PREFIX --with-newlib --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp \
&& make -j5 all \
&& make -j5 install \
&& cd .. \
&& rm -rf binutils-$BINUTILS_VERSION \
&& rm -rf gcc-$GCC_VERSION \
&& rm -rf newlib-$NEWLIB_VERSION \
&& rm -rf build-binutils \
&& rm -rf build-gcc \
&& rm -rf build-newlib \
&& apt-get purge --autoremove -qq \
bzip2 \
gcc \
gcc-multilib \
g++ \
make \
wget \
&& rm -rf /var/lib/apt/lists/*