Skip to content

Commit a3069d0

Browse files
authored
Add more -psx flavoured builds (#27)
* Add more -psx flavoured builds * Update CI
1 parent 85fbb56 commit a3069d0

File tree

6 files changed

+230
-2
lines changed

6 files changed

+230
-2
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,24 @@ jobs:
1717
- 2.5.7
1818
- 2.5.7-psx
1919
- 2.6.0
20+
- 2.6.0-psx
2021
- 2.6.3
2122
- 2.6.3-psx
2223
- 2.7.0
2324
- 2.7.1
2425
- 2.7.2
26+
- 2.7.2-psx
2527
- 2.7.2.1
2628
- 2.7.2.2
2729
- 2.7.2.3
2830
- 2.8.0
31+
- 2.8.0-psx
2932
- 2.8.1
3033
- 2.8.1-psx
3134
- 2.91.66
35+
- 2.91.66-psx
3236
- 2.95.2
37+
- 2.95.2-psx
3338
name: Build GCC ${{ matrix.version }}
3439
steps:
3540
- name: Clone repository
@@ -42,12 +47,12 @@ jobs:
4247
cd build-gcc-${{ matrix.version }}
4348
tar -czvf ../gcc-${{ matrix.version }}.tar.gz *
4449
- name: Create artifact
45-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
4651
with:
4752
name: gcc-${{ matrix.version }}
4853
path: gcc-${{ matrix.version }}.tar.gz
4954
- name: Publish release
50-
uses: softprops/action-gh-release@v1
55+
uses: softprops/action-gh-release@v2
5156
if: startsWith(github.ref, 'refs/tags/')
5257
with:
5358
files: |

gcc-2.6.0-psx.Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
WORKDIR /work
7+
RUN wget http://www.nic.funet.fi/index/gnu/funet/historical-funet-gnu-area-from-early-1990s/gcc-2.6.0.tar.gz
8+
RUN tar xzf gcc-2.6.0.tar.gz
9+
10+
WORKDIR /work/gcc-2.6.0
11+
COPY patches /work/patches
12+
RUN sed -i -- 's/include <varargs.h>/include <stdarg.h>/g' *.c
13+
14+
RUN patch -u -p1 obstack.h -i ../patches/obstack-2.7.2.h.patch
15+
RUN patch -u -p1 sdbout.c -i ../patches/sdbout-2.6.0.c.patch
16+
RUN patch -u -p1 collect2.c -i ../patches/collect2-2.6.0.c.patch
17+
RUN patch -u -p1 cccp.c -i ../patches/cccp-2.6.0.c.patch
18+
RUN patch -u -p1 gcc.c -i ../patches/gcc-2.6.0.c.patch
19+
RUN patch -u -p1 cp/g++.c -i ../patches/g++-2.6.0.c.patch
20+
RUN patch -u -p1 config/mips/mips.h -i ../patches/mipsel-2.6.patch
21+
RUN patch -su -p1 < ../patches/psx.patch
22+
23+
RUN ./configure \
24+
--target=mips-linux-gnu \
25+
--prefix=/opt/cross \
26+
--with-endian-little \
27+
--with-gnu-as \
28+
--host=i386-pc-linux \
29+
--build=i386-pc-linux
30+
31+
RUN make --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static -Dbsd4_4 -Dmips -DHAVE_STRERROR"
32+
33+
COPY tests /work/tests
34+
RUN ./cc1 -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s
35+
RUN ./cc1 -quiet -O2 /work/tests/section_attribute.c
36+
37+
RUN mv xgcc gcc
38+
RUN mkdir /build && cp cpp cc1 gcc cc1plus g++ /build/
39+
40+
FROM scratch AS export
41+
COPY --from=build /build/* .

gcc-2.7.2-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.7.2
7+
ENV GNUPATH=old-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.7.2.h.patch
19+
RUN patch -u -p1 configure -i ../patches/configure.patch
20+
RUN patch -u -p1 config.sub -i ../patches/config.sub.patch
21+
RUN patch -u -p1 config/mips/mips.h -i ../patches/mipsel-2.7.patch
22+
RUN patch -su -p1 < ../patches/psx.patch
23+
24+
RUN ./configure \
25+
--target=mips-sony-psx \
26+
--prefix=/opt/cross \
27+
--with-endian-little \
28+
--with-gnu-as \
29+
--disable-gprof \
30+
--disable-gdb \
31+
--disable-werror \
32+
--host=i386-pc-linux \
33+
--build=i386-pc-linux
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/* .

gcc-2.8.0-psx.Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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.0
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.0.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-linux-gnu \
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 make --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static"
34+
35+
COPY tests /work/tests
36+
RUN ./cc1 -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s
37+
RUN ./cc1 -quiet -O2 /work/tests/section_attribute.c
38+
39+
RUN mv xgcc gcc
40+
RUN mkdir /build && cp cpp cc1 gcc cc1plus g++ /build/
41+
42+
FROM scratch AS export
43+
COPY --from=build /build/* .

gcc-2.91.66-psx.Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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.91.66
7+
8+
WORKDIR /work
9+
RUN wget https://gcc.gnu.org/pub/gcc/old-releases/egcs/egcs-1.1.2.tar.bz2
10+
RUN mkdir -p /work/gcc-${VERSION}/
11+
RUN tar xjf egcs-1.1.2.tar.bz2 --strip-components=1 -C gcc-${VERSION}
12+
13+
WORKDIR /work/gcc-${VERSION}/
14+
15+
COPY patches /work/patches
16+
17+
RUN sed -i -- 's/include <varargs.h>/include <stdarg.h>/g' **/*.c
18+
RUN patch -u -p1 gcc/obstack.h -i ../patches/obstack-${VERSION}.h.patch
19+
RUN patch -u -p1 gcc/config/mips/mips.h -i ../patches/mipsel-2.8.patch
20+
RUN patch -su -p1 < ../patches/psx.patch
21+
22+
RUN for dir in libiberty gcc; do \
23+
cd /work/gcc-${VERSION}/${dir}; \
24+
./configure \
25+
--target=mips-linux-gnu \
26+
--prefix=/opt/cross \
27+
--with-endian-little \
28+
--with-gnu-as \
29+
--disable-gprof \
30+
--disable-gdb \
31+
--disable-werror \
32+
--host=i386-pc-linux \
33+
--build=i386-pc-linux; \
34+
done
35+
36+
RUN make -C libiberty/ CFLAGS="-std=gnu89 -m32 -static"
37+
RUN make -C gcc/ --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static"
38+
39+
COPY tests /work/tests
40+
RUN ./gcc/cc1 -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s
41+
RUN ./gcc/cc1 -quiet -O2 /work/tests/section_attribute.c
42+
43+
RUN mv ./gcc/xgcc ./gcc/gcc
44+
RUN mkdir /build && cp ./gcc/cpp ./gcc/cc1 ./gcc/gcc ./gcc/cc1plus ./gcc/g++ /build/
45+
46+
FROM scratch AS export
47+
COPY --from=build /build/* .

gcc-2.95.2-psx.Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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.95.2
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+
17+
RUN sed -i -- 's/include <varargs.h>/include <stdarg.h>/g' **/*.c
18+
RUN patch -u -p1 include/obstack.h -i ../patches/obstack-${VERSION}.h.patch
19+
RUN patch -u -p1 gcc/config/mips/mips.h -i ../patches/mipsel-2.8.patch
20+
RUN patch -su -p1 < ../patches/psx.patch
21+
22+
RUN for dir in libiberty gcc; do \
23+
cd /work/gcc-${VERSION}/${dir}; \
24+
./configure \
25+
--target=mips-linux-gnu \
26+
--prefix=/opt/cross \
27+
--with-endian-little \
28+
--with-gnu-as \
29+
--disable-gprof \
30+
--disable-gdb \
31+
--disable-werror \
32+
--host=i386-pc-linux \
33+
--build=i386-pc-linux; \
34+
done
35+
36+
RUN make -C libiberty/ CFLAGS="-std=gnu89 -m32 -static"
37+
RUN make -C gcc/ --jobs $(nproc) cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static"
38+
39+
COPY tests /work/tests
40+
RUN ./gcc/cc1 -mel -quiet -O2 /work/tests/little_endian.c && grep -E 'lbu\s\$2,0\(\$4\)' /work/tests/little_endian.s
41+
RUN ./gcc/cc1 -quiet -O2 /work/tests/section_attribute.c
42+
43+
RUN mv ./gcc/xgcc ./gcc/gcc
44+
RUN mkdir /build && cp ./gcc/cpp ./gcc/cc1 ./gcc/gcc ./gcc/cc1plus ./gcc/g++ /build/
45+
46+
FROM scratch AS export
47+
COPY --from=build /build/* .

0 commit comments

Comments
 (0)