-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM ubuntu:focal as build | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update | ||
RUN apt-get install -y build-essential gcc gcc-multilib wget | ||
|
||
ENV VERSION=2.8.1 | ||
ENV GNUPATH=gnu | ||
|
||
WORKDIR /work | ||
RUN wget https://ftp.gnu.org/${GNUPATH}/gcc/gcc-${VERSION}.tar.gz | ||
RUN tar xzf gcc-${VERSION}.tar.gz | ||
|
||
WORKDIR /work/gcc-${VERSION} | ||
|
||
COPY patches /work/patches | ||
RUN sed -i -- 's/include <varargs.h>/include <stdarg.h>/g' *.c | ||
|
||
RUN patch -u -p1 obstack.h -i ../patches/obstack-2.8.1.h.patch | ||
RUN patch -u -p1 config/mips/mips.h -i ../patches/mipsel-2.8.patch | ||
RUN patch -su -p1 < ../patches/psx.patch | ||
|
||
RUN ./configure \ | ||
--target=mips-sony-psx \ | ||
--prefix=/opt/cross \ | ||
--with-endian-little \ | ||
--with-gnu-as \ | ||
--disable-gprof \ | ||
--disable-gdb \ | ||
--disable-werror \ | ||
--host=i386-pc-linux \ | ||
--build=i386-pc-linux | ||
|
||
RUN touch insn-config.h | ||
|
||
RUN make --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static" | ||
|
||
COPY tests /work/tests | ||
RUN ./cc1 -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s | ||
RUN ./cc1 -quiet -O2 /work/tests/section_attribute.c | ||
|
||
RUN mv xgcc gcc | ||
RUN mkdir /build && cp cpp cc1 gcc cc1plus g++ /build/ | ||
|
||
FROM scratch AS export | ||
COPY --from=build /build/* . |