Compile binutils and gcc from scratch
Turns out the alpine versione doesn't quite work well with low-level 32 bit code...
This commit is contained in:
parent
261cc76e8f
commit
d339e27080
@ -1,8 +1,8 @@
|
||||
FROM alpine
|
||||
|
||||
RUN apk --update add make binutils gcc && \
|
||||
apk add grub-bios xorriso qemu-system-x86_64 gdb && \
|
||||
rm -rf /var/cache/apk/*
|
||||
ADD build-toolchain.sh /opt/build-toolchain.sh
|
||||
|
||||
RUN /opt/build-toolchain.sh
|
||||
|
||||
ENV PATH "/opt/toolchain:$PATH"
|
||||
ENV MITTOS64 "true"
|
||||
|
46
toolchain/build-toolchain.sh
Executable file
46
toolchain/build-toolchain.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
apk --update add build-base
|
||||
apk add gmp-dev mpfr-dev mpc1-dev
|
||||
|
||||
apk add make
|
||||
apk add grub-bios xorriso
|
||||
apk add qemu-system-x86_64 gdb
|
||||
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
target=x86_64-elf
|
||||
binutils=binutils-2.26
|
||||
gcc=gcc-6.1.0
|
||||
|
||||
|
||||
cd /opt
|
||||
wget http://ftp.gnu.org/gnu/binutils/${binutils}.tar.gz
|
||||
tar -xf ${binutils}.tar.gz
|
||||
mkdir binutils-build && cd binutils-build
|
||||
../${binutils}/configure \
|
||||
--target=${target} \
|
||||
--disable-nls \
|
||||
--disable-werror \
|
||||
--with-sysroot \
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
cd /opt
|
||||
wget http://ftp.gnu.org/gnu/gcc/${gcc}/${gcc}.tar.gz
|
||||
tar -xf ${gcc}.tar.gz
|
||||
mkdir gcc-build && cd gcc-build
|
||||
../${gcc}/configure \
|
||||
--target=${target} \
|
||||
--disable-nls \
|
||||
--enable-languages=c \
|
||||
--without-headers \
|
||||
|
||||
make all-gcc all-target-libgcc
|
||||
make install-gcc install-target-libgcc
|
||||
|
||||
apk del build-base
|
||||
|
||||
cd /
|
||||
rm -rf /opt
|
Loading…
x
Reference in New Issue
Block a user