Bootstrap failure on sparc*-sun-solaris2.10
Zack Weinberg
zackw@panix.com
Wed Jan 25 04:27:00 GMT 2006
On Tue, Jan 24, 2006 at 10:29:08PM -0500, Kaveh R. Ghazi wrote:
> I'm getting the following new bootstrap failure on both
> sparc-sun-solaris2.10 and sparc64-sun-solaris2.10 when using cc for
> stage1:
>
> > "build/gencondmd.c", line 1943: warning: syntax error: empty initializer
> > "build/gencondmd.c", line 1943: warning: null dimension: insn_conditions
> > "build/gencondmd.c", line 1951: warning: null dimension: sizeof()
> > cc -xildoff -xarch=v9 -g -DIN_GCC -DHAVE_CONFIG_H -DGENERATOR_FILE -o
> > build/gencondmd \ build/gencondmd.o
> > ../build-sparc64-sun-solaris2.10/libiberty/libiberty.a
> > Undefined first referenced
> > symbol in file
> > vec_heap_p_reserve build/gencondmd.o
> > bitmap_zero_bits build/gencondmd.o
> > vec_gc_p_reserve build/gencondmd.o
> > vec_gc_o_reserve build/gencondmd.o
> > ggc_free build/gencondmd.o
> > fancy_abort build/gencondmd.o
I'm not entirely understanding why this breaks now when insn-conditions.o
was fine, but a potential big-hammer fix is to put
#if GCC_VERSION >= 3001 ... #endif around most of the includes, like in the
appended patch. Would you please try it?
zw
* genconditions.c (write_header): In generated code, #if
out all headers and fake declarations, except bconfig.h
and system.h, when not compiling with GCC >= 3.0.1.
(write_conditions): Tweak commentary in generated code.
==================================================================
--- genconditions.c (revision 110239)
+++ genconditions.c (local)
@@ -52,9 +52,14 @@ write_header (void)
machine description file. */\n\
\n\
#include \"bconfig.h\"\n\
-#include \"insn-constants.h\"\n");
+#include \"system.h\"\n");
puts ("\
+/* It is necessary, but not entirely safe, to include the headers below\n\
+ in a generator program. As a defensive measure, don't do so when the\n\
+ table isn't going to have anything in it. */\n\
+#if GCC_VERSION >= 3001\n\
+\n\
/* Do not allow checking to confuse the issue. */\n\
#undef ENABLE_CHECKING\n\
#undef ENABLE_TREE_CHECKING\n\
@@ -64,9 +69,9 @@ write_header (void)
#undef ENABLE_GC_ALWAYS_COLLECT\n");
puts ("\
-#include \"system.h\"\n\
#include \"coretypes.h\"\n\
#include \"tm.h\"\n\
+#include \"insn-constants.h\"\n\
#include \"rtl.h\"\n\
#include \"tm_p.h\"\n\
#include \"function.h\"\n");
@@ -97,7 +102,9 @@ write_header (void)
/* Dummy external declarations. */\n\
extern rtx insn;\n\
extern rtx ins1;\n\
-extern rtx operands[];\n");
+extern rtx operands[];\n\
+\n\
+#endif /* gcc >= 3.0.1 */\n");
}
/* Write out one entry in the conditions table, using the data pointed
@@ -142,18 +149,18 @@ write_conditions (void)
puts ("\
/* This table lists each condition found in the machine description.\n\
Each condition is mapped to its truth value (0 or 1), or -1 if that\n\
- cannot be calculated at compile time. */\n\
-\n\
-static const struct c_test insn_conditions[] = {\n \
-/* If we don't have __builtin_constant_p, or it's not acceptable in array\n\
+ cannot be calculated at compile time.\n\
+ If we don't have __builtin_constant_p, or it's not acceptable in array\n\
initializers, fall back to assuming that all conditions potentially\n\
vary at run time. It works in 3.0.1 and later; 3.0 only when not\n\
optimizing. */\n\
-#if GCC_VERSION >= 3001");
+\n\
+static const struct c_test insn_conditions[] = {\n\
+#if GCC_VERSION >= 3001\n");
traverse_c_tests (write_one_condition, 0);
- puts ("#endif\n};\n");
+ puts ("\n#endif /* gcc >= 3.0.1 */\n};\n");
}
/* Emit code which will convert the C-format table to a
More information about the Gcc-patches
mailing list