diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 536ff6e..2728688 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: - 2.7.2.3 - 2.8.0 - 2.8.1 + - 2.8.1-psx - 2.91.66 - 2.95.2 name: Build GCC ${{ matrix.version }} diff --git a/gcc-2.8.1-psx.Dockerfile b/gcc-2.8.1-psx.Dockerfile new file mode 100644 index 0000000..c41baa4 --- /dev/null +++ b/gcc-2.8.1-psx.Dockerfile @@ -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 /include /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/* .