Skip to content

Commit

Permalink
Add gcc 2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkst committed Sep 10, 2023
1 parent 01ace41 commit 3fc7980
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [2.6.0, 2.6.3, 2.6.3-psx, 2.7.0, 2.7.1, 2.7.2, 2.7.2.1, 2.7.2.2, 2.7.2.3, 2.8.1, 2.91.66, 2.95.2]
version: [2.6.0, 2.6.3, 2.6.3-psx, 2.7.0, 2.7.1, 2.7.2, 2.7.2.1, 2.7.2.2, 2.7.2.3, 2.8.0, 2.8.1, 2.91.66, 2.95.2]
name: Build GCC ${{ matrix.version }}
steps:
- name: Clone repository
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
build-*/
gcc-*/
sources/
34 changes: 34 additions & 0 deletions gcc-2.8.0.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:focal
RUN apt-get update
RUN apt-get install -y build-essential bison file gperf gcc gcc-multilib git wget

ENV VERSION=2.8.0
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}
RUN ./configure \
--target=mips-linux-gnu \
--prefix=/opt/cross \
--with-endian-little \
--with-gnu-as \
--disable-gprof \
--disable-gdb \
--disable-werror \
--host=i386-pc-linux \
--build=i386-pc-linux

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.0.h.patch

RUN make cpp cc1 xgcc cc1plus g++ CFLAGS="-std=gnu89 -m32 -static"
RUN test -f cc1
RUN file cc1

COPY entrypoint.sh /work/
RUN chmod +x /work/entrypoint.sh
CMD [ "/work/entrypoint.sh" ]
12 changes: 12 additions & 0 deletions patches/obstack-2.8.0.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- gcc-2.8.0/obstack.h 1997-10-27 00:14:42.000000000 +0000
+++ gcc-2.8.0/obstack_patched.h 2023-09-10 09:11:36.902206085 +0000
@@ -424,7 +424,8 @@
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
- *((void **)__o->next_free)++ = ((void *)datum); \
+ *((void **)__o->next_free) = ((void *)datum); \
+ __o->next_free += sizeof (void *); \
(void) 0; })

#define obstack_int_grow(OBSTACK,datum) \

0 comments on commit 3fc7980

Please sign in to comment.