projects/guix·blob python-team · refs

137 lines · 5.7 KiB

1This patch enables building gcc-2.95.3 using TCC and Mes C Library.
2
3 * Disable building DOC
4 * Avoid running `fixproto'.
5 * Force running `fixinc'.
6 * Replace Makefile trickery of creating an libgcc1.a archive, then
7 extracting the .o files later to create a new libgcc2.a archive.
8 Instead, keep temporary .o files.
9
10Upstream status: Not presented upstream.
11
12diff -purN -x foo.c -x BOOT -x BOOT-2 -x BOOT-strict -x .git -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC ../gcc-2.95.3/gcc/Makefile.in gcc-2.95.3/gcc/Makefile.in
13--- ../gcc-2.95.3/gcc/Makefile.in 2001-01-25 15:02:58.000000000 +0100
14+++ gcc-2.95.3/gcc/Makefile.in 2018-06-23 11:46:03.525159181 +0200
15@@ -221,7 +221,7 @@ RANLIB_TEST_FOR_TARGET = \
16 SYSTEM_HEADER_DIR = /usr/include
17
18 # Control whether to run fixproto.
19-STMP_FIXPROTO = stmp-fixproto
20+# STMP_FIXPROTO = stmp-fixproto
21
22 # Test to see whether <limits.h> exists in the system header files.
23 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
24@@ -958,6 +958,7 @@ libgcc1.cross:
25 # fragments.
26 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
27 -rm -f tmplibgcc1.a
28+ mkdir -p libgcc1-o
29 # Actually build it in tmplibgcc1.a, then rename at end,
30 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
31 # -e causes any failing command to make this rule fail.
32@@ -974,6 +975,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
33 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
34 mv libgcc1$(objext) $${name}$(objext); \
35 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
36+ mv $${name}$(objext) libgcc1-o; \
37 rm -f $${name}$(objext); \
38 done
39 # Some shells crash when a loop has no items.
40@@ -994,6 +996,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
41 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
42 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
43 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
44+ mv $${name}$(objext) libgcc1-o; \
45 rm -f $${name}.s $${name}$(objext); \
46 else true; \
47 fi; \
48@@ -1024,6 +1027,7 @@ libgcc1-asm.a: libgcc2.ready config.stat
49 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
50 mv libgcc1$(objext) $${name}$(objext); \
51 $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc1.a $${name}$(objext); \
52+ mv $${name}$(objext) libgcc1-o; \
53 rm -f $${name}$(objext); \
54 done
55 -rm -f libgcc1.S
56@@ -1062,6 +1066,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
57 # Actually build it in tmplibgcc2.a, then rename at end,
58 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
59 -rm -f tmplibgcc2.a
60+ mkdir -p libgcc2-o
61 # -e causes any failing command to make this rule fail.
62 # -e doesn't work in certain shells, so we test $$? as well.
63 # lynx has a broken ar, it always complains when the initial library is
64@@ -1139,6 +1144,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
65 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
66 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
67 $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc2.a $${oname}$(objext); \
68+ mv $${oname}$(objext) libgcc2-o;\
69 rm -f $${name}.s $${oname}$(objext); \
70 fi; \
71 done
72@@ -1156,7 +1162,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
73 -rm -rf tmplibgcc.a libgcc.a tmpcopy
74 mkdir tmpcopy
75 -if [ x$(LIBGCC1) != x ]; \
76- then (cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC1)); \
77+ then cp -v libgcc1-o/*.o tmpcopy; \
78 else true; \
79 fi
80 # Some versions of ar (specifically the one in RISC/os 5.x), create an
81@@ -1164,7 +1170,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
82 # the second ar command tries to overwrite this file. To avoid the error
83 # message from ar, we make sure all files are writable.
84 -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
85- (cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC2))
86+ cp -v libgcc2-o/*.o tmpcopy
87 (cd tmpcopy; $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) ../tmplibgcc.a *$(objext))
88 rm -rf tmpcopy
89 -if $(RANLIB_TEST_FOR_TARGET) ; then \
90@@ -2093,14 +2099,18 @@ gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
91 # s-* so that mostlyclean does not force the include directory to
92 # be rebuilt.
93
94+# STMP_FIXINC = @STMP_FIXINC@
95+STMP_FIXINC = stmp-fixinc
96+
97 # Build the include directory including float.h (which no longer depends upon
98 # enquire).
99-stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
100+stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
101 # Copy in the headers provided with gcc.
102 # The sed command gets just the last file name component;
103 # this is necessary because VPATH could add a dirname.
104 # Using basename would be simpler, but some systems don't have it.
105 # The touch command is here to workaround an AIX/Linux NFS bug.
106+ -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
107 for file in .. $(USER_H); do \
108 if [ X$$file != X.. ]; then \
109 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
110@@ -2265,16 +2275,17 @@ stmp-fixproto: fixhdr.ready fixproto stm
111 #
112 # Remake the info files.
113
114-doc: info
115-info: cpp.info gcc.info lang.info
116-
117-cpp.info: $(srcdir)/cpp.texi
118- $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
119-
120-gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
121- $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
122- $(srcdir)/tm.texi $(srcdir)/gcov.texi
123- $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
124+doc:
125+# doc: info
126+# info: cpp.info gcc.info lang.info
127+
128+# cpp.info: $(srcdir)/cpp.texi
129+# $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
130+
131+# gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
132+# $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
133+# $(srcdir)/tm.texi $(srcdir)/gcov.texi
134+# $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
135
136 dvi: gcc.dvi cpp.dvi lang.dvi
137