This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Include tm.h in hooks.h, protect tm.h from multiple inclusion, and FIX BOOTSTRAP


This is the quick hack I used to get GCC bootstrapping again on
i686-pc-linux-gnu after the 'bt-load' patch broke it.

(See http://gcc.gnu.org/ml/gcc/2003-06/msg10593.html and also
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02135.html where
the same breakage was reported on powerpc-apple-darwin6.6.)

*This* bootstrapped on i686-pc-linux-gnu.

Actually, even though it was a 'quick hack', it may be the Right Thing
To Do. ;-)

I'm looking for approval because I don't *quite* think this is 
'obvious'.

I'll expect one of the following to have happened by tomorrow evening:
* This patch approved
* Another patch approved and committed which fixes bootstrap
* The bt-load patch reverted

	* mkconfig.sh: Add multiple inclusion guard to tm.h.
	* hooks.h: Include tm.h.

Index: mkconfig.sh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/mkconfig.sh,v
retrieving revision 1.12
diff -u -r1.12 mkconfig.sh
--- mkconfig.sh	16 Dec 2002 18:19:44 -0000	1.12
+++ mkconfig.sh	19 Jun 2003 00:09:55 -0000
@@ -33,6 +33,12 @@
 output=$1
 rm -f ${output}T
 
+# Put multiple inclusion protection guards in tm.h.  Sigh.
+if [ ${output} = "tm.h" ]; then
+  echo "#ifndef GCC_TM_H" >> ${output}T
+  echo "#define GCC_TM_H" >> ${output}T
+fi
+
 # Define TARGET_CPU_DEFAULT if the system wants one.
 # This substitutes for lots of *.h files.
 if [ "$TARGET_CPU_DEFAULT" != "" ]; then
@@ -84,6 +90,11 @@
 EOF
     ;;
 esac
+
+# Put multiple inclusion protection guards in tm.h.  Sigh.
+if [ ${output} = "tm.h" ]; then
+  echo "#endif /* GCC_TM_H */" >> ${output}T
+fi
 
 # Avoid changing the actual file if possible.
 if [ -f $output ] && cmp ${output}T $output >/dev/null 2>&1; then
Index: hooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hooks.h,v
retrieving revision 1.16
diff -u -r1.16 hooks.h
--- hooks.h	18 Jun 2003 19:43:49 -0000	1.16
+++ hooks.h	19 Jun 2003 00:03:56 -0000
@@ -22,6 +22,10 @@
 #ifndef GCC_HOOKS_H
 #define GCC_HOOKS_H
 
+/* We need the definition of enum reg_class (which is in tm.h)
+   for hook_reg_class_void_no_regs. */
+#include "tm.h"
+
 bool hook_bool_void_false PARAMS ((void));
 enum reg_class hook_reg_class_void_no_regs (void);
 bool hook_bool_bool_false (bool);


-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
Don't use the GNU FDL for free documentation.  See
<http://home.twcny.rr.com/nerode/neroden/fdl.html>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]