-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (79 loc) · 1.82 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM debian:stable
LABEL maintainer "Linus Hochbaum <linus@hochbaum.dev>"
RUN apt update && apt install -y \
git \
build-essential \
ninja-build \
libgmp-dev \
libmpfr-dev \
libmpc-dev \
texinfo \
bison \
flex \
libisl-dev \
libtool \
pkg-config \
ninja-build \
xorriso \
python \
nasm \
zlib1g-dev \
gettext \
autopoint
RUN mkdir /tmp/suite
WORKDIR /tmp/suite
COPY tools ./
# Install binutils.
RUN cd binutils-gdb && \
mkdir build && \
cd build && \
../configure \
--disable-debug \
--disable-dependency-tracking \
--prefix=/usr/local/x86_64-elf \
--target=x86_64-elf \
--disable-nls \
--disable-werror \
--with-sysroot && \
make && \
make install
# Update PATH environment variable to index our freshly cross-compiled
# x86_64-elf tools' binaries.
ENV PATH="${PATH}:/usr/local/x86_64-elf/bin"
# Install GCC.
RUN cd gcc && \
mkdir build && \
cd build && \
../configure \
--target=x86_64-elf \
--prefix=/usr/local/x86_64-elf \
--enable-languages=c \
--with-gnu-as \
--with-gnu-ld \
--with-ld=/usr/local/x86_64-elf/bin/x86_64-elf-ld \
--with-as=/usr/local/x86_64-elf/bin/x86_64-elf-as \
--disable-nls \
--without-headers \
--with-system-zlib && \
make all-gcc && \
make all-target-libgcc && \
make install-gcc && \
make install-target-libgcc
# Install GRUB2.
RUN cd grub && \
./bootstrap && \
mkdir build && \
cd build && \
../configure \
TARGET_CC=/usr/local/x86_64-elf/bin/x86_64-elf-gcc \
TARGET_OBJCOPY=/usr/local/x86_64-elf/bin/x86_64-elf-objcopy \
TARGET_NM=/usr/local/x86_64-elf/bin/x86_64-elf-nm \
TARGET_STRIP=/usr/local/x86_64-elf/bin/x86_64-elf-strip \
TARGET_RANLIB=/usr/local/x86_64-elf/bin/x86_64-elf-ranlb \
--disable-werror \
--prefix=/usr/local/x86_64-elf \
--target=x86_64-elf && \
make && \
make install
RUN rm -rf /tmp/suite
ENTRYPOINT ["/bin/bash"]