-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/ | ||
build-*/ | ||
gcc-*/ | ||
sources/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) \ |