Skip to content

Commit

Permalink
Add gcc-2.8.1-psx (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkst authored Aug 8, 2024
1 parent 57e84c3 commit 85fbb56
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
45 changes: 45 additions & 0 deletions gcc-2.8.1-psx.Dockerfile
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/* .

0 comments on commit 85fbb56

Please sign in to comment.