Skip to content

Commit 85fbb56

Browse files
authored
Add gcc-2.8.1-psx (#24)
1 parent 57e84c3 commit 85fbb56

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- 2.7.2.3
2828
- 2.8.0
2929
- 2.8.1
30+
- 2.8.1-psx
3031
- 2.91.66
3132
- 2.95.2
3233
name: Build GCC ${{ matrix.version }}

gcc-2.8.1-psx.Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM ubuntu:focal as build
2+
ENV DEBIAN_FRONTEND=noninteractive
3+
RUN apt-get update
4+
RUN apt-get install -y build-essential gcc gcc-multilib wget
5+
6+
ENV VERSION=2.8.1
7+
ENV GNUPATH=gnu
8+
9+
WORKDIR /work
10+
RUN wget https://ftp.gnu.org/${GNUPATH}/gcc/gcc-${VERSION}.tar.gz
11+
RUN tar xzf gcc-${VERSION}.tar.gz
12+
13+
WORKDIR /work/gcc-${VERSION}
14+
15+
COPY patches /work/patches
16+
RUN sed -i -- 's/include <varargs.h>/include <stdarg.h>/g' *.c
17+
18+
RUN patch -u -p1 obstack.h -i ../patches/obstack-2.8.1.h.patch
19+
RUN patch -u -p1 config/mips/mips.h -i ../patches/mipsel-2.8.patch
20+
RUN patch -su -p1 < ../patches/psx.patch
21+
22+
RUN ./configure \
23+
--target=mips-sony-psx \
24+
--prefix=/opt/cross \
25+
--with-endian-little \
26+
--with-gnu-as \
27+
--disable-gprof \
28+
--disable-gdb \
29+
--disable-werror \
30+
--host=i386-pc-linux \
31+
--build=i386-pc-linux
32+
33+
RUN touch insn-config.h
34+
35+
RUN make --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static"
36+
37+
COPY tests /work/tests
38+
RUN ./cc1 -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s
39+
RUN ./cc1 -quiet -O2 /work/tests/section_attribute.c
40+
41+
RUN mv xgcc gcc
42+
RUN mkdir /build && cp cpp cc1 gcc cc1plus g++ /build/
43+
44+
FROM scratch AS export
45+
COPY --from=build /build/* .

0 commit comments

Comments
 (0)