aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/gcc-boot-2.95.3.patch
blob: fd167ae0522626d95f340c672da0922387b1a91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
This patch enables building gcc-2.95.3 using TCC and Mes C Library.

  * Disable building DOC
  * Avoid running `fixproto'.
  * Force running `fixinc'.
  * Replace Makefile trickery of creating an libgcc1.a archive, then
    extracting the .o files later to create a new libgcc2.a archive.
    Instead, keep temporary .o files.

Upstream status: Not presented upstream.

diff -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
--- ../gcc-2.95.3/gcc/Makefile.in	2001-01-25 15:02:58.000000000 +0100
+++ gcc-2.95.3/gcc/Makefile.in	2018-06-23 11:46:03.525159181 +0200
@@ -221,7 +221,7 @@ RANLIB_TEST_FOR_TARGET = \
 SYSTEM_HEADER_DIR = /usr/include
 
 # Control whether to run fixproto.
-STMP_FIXPROTO = stmp-fixproto
+# STMP_FIXPROTO = stmp-fixproto
 
 # Test to see whether <limits.h> exists in the system header files.
 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
@@ -958,6 +958,7 @@ libgcc1.cross:
 # fragments.
 libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
 	-rm -f tmplibgcc1.a
+	mkdir -p libgcc1-o
 # Actually build it in tmplibgcc1.a, then rename at end,
 # so that libgcc1.a itself remains nonexistent if compilation is aborted.
 # -e causes any failing command to make this rule fail.
@@ -974,6 +975,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
 	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
 	  mv libgcc1$(objext) $${name}$(objext); \
 	  $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
+	  mv $${name}$(objext) libgcc1-o; \
 	  rm -f $${name}$(objext); \
 	done
 # Some shells crash when a loop has no items.
@@ -994,6 +996,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
 	    $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+	    mv $${name}$(objext) libgcc1-o; \
 	    rm -f $${name}.s $${name}$(objext); \
 	  else true; \
 	  fi; \
@@ -1024,6 +1027,7 @@ libgcc1-asm.a: libgcc2.ready config.stat
 	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
 	  mv libgcc1$(objext) $${name}$(objext); \
 	  $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc1.a $${name}$(objext); \
+	  mv $${name}$(objext) libgcc1-o; \
 	  rm -f $${name}$(objext); \
 	done
 	-rm -f libgcc1.S
@@ -1062,6 +1066,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
 # Actually build it in tmplibgcc2.a, then rename at end,
 # so that libgcc2.a itself remains nonexistent if compilation is aborted.
 	-rm -f tmplibgcc2.a
+	mkdir -p libgcc2-o
 # -e causes any failing command to make this rule fail.
 # -e doesn't work in certain shells, so we test $$? as well.
 # lynx has a broken ar, it always complains when the initial library is
@@ -1139,6 +1144,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
 	    $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
 	    $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc2.a $${oname}$(objext); \
+	    mv $${oname}$(objext) libgcc2-o;\
 	    rm -f $${name}.s $${oname}$(objext); \
 	  fi; \
 	done
@@ -1156,7 +1162,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
 	-rm -rf tmplibgcc.a libgcc.a tmpcopy
 	mkdir tmpcopy
 	-if [ x$(LIBGCC1) != x ];			\
-	then (cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC1));	\
+	then cp -v libgcc1-o/*.o tmpcopy;		\
 	else true;					\
 	fi
 # Some versions of ar (specifically the one in RISC/os 5.x), create an
@@ -1164,7 +1170,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
 # the second ar command tries to overwrite this file.  To avoid the error
 # message from ar, we make sure all files are writable.
 	-(cd tmpcopy; chmod +w * > /dev/null 2>&1)
-	(cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC2))
+	cp -v libgcc2-o/*.o tmpcopy
 	(cd tmpcopy; $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) ../tmplibgcc.a *$(objext))
 	rm -rf tmpcopy
 	-if $(RANLIB_TEST_FOR_TARGET) ; then \
@@ -2093,14 +2099,18 @@ gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
 # s-* so that mostlyclean does not force the include directory to
 # be rebuilt.
 
+# STMP_FIXINC = @STMP_FIXINC@
+STMP_FIXINC = stmp-fixinc
+
 # Build the include directory including float.h (which no longer depends upon
 # enquire).
-stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
+stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
 # Copy in the headers provided with gcc.
 # The sed command gets just the last file name component;
 # this is necessary because VPATH could add a dirname.
 # Using basename would be simpler, but some systems don't have it.
 # The touch command is here to workaround an AIX/Linux NFS bug.
+	-if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
 	for file in .. $(USER_H); do \
 	  if [ X$$file != X.. ]; then \
 	    realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
@@ -2265,16 +2275,17 @@ stmp-fixproto: fixhdr.ready fixproto stm
 #
 # Remake the info files.
 
-doc: info
-info: cpp.info gcc.info lang.info
-
-cpp.info: $(srcdir)/cpp.texi
-	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
-
-gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
-	  $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
-	  $(srcdir)/tm.texi $(srcdir)/gcov.texi
-	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
+doc:
+# doc: info
+# info: cpp.info gcc.info lang.info
+
+# cpp.info: $(srcdir)/cpp.texi
+# 	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
+
+# gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
+# 	  $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
+# 	  $(srcdir)/tm.texi $(srcdir)/gcov.texi
+# 	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
 
 dvi: gcc.dvi cpp.dvi lang.dvi