This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
linux version 2.1.114 exposes bug in all versions of gcc?
- To: egcs at cygnus dot com
- Subject: linux version 2.1.114 exposes bug in all versions of gcc?
- From: Benjamin Redelings I <bredelin at ucsd dot edu>
- Date: Tue, 04 Aug 1998 11:44:21 -0700
Hi, have you seen these excerpts from pre-patch-2.1.115? Apparently in
2.1.114 the SPIN_LOCK_UNLOCKED caused gcc problems if it was defined as {
}; (don't trust me on this though). The error messages were:
gcc -D__KERNEL__ -I/usr/src/linux-2.1.114/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce
-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -c
-o init_task.o init_task.c
init_task.c:24: parse error before `,'
init_task.c:24: warning: missing braces around initializer for
`init_task_union.task.sigmask_lock'
init_task.c:24: warning: excess elements in struct initializer after
`init_task_union.task.sigmask_lock'
gcc: Internal compiler error: program cc1 got fatal signal 11
make[1]: *** [init_task.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.1.114/arch/i386/kernel'
make: *** [linuxsubdirs] Error 2
[root@myhost linux]#
This seems to be in egcs 2.92.0, egcs 1.0.3a, and gcc2.7.2.3. I don't
really know if it is a bug in gcc or in the kernel...
-BenRI
--
http://sdcc13.ucsd.edu/~bredelin
diff -u --recursive --new-file v2.1.114/linux/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h
--- v2.1.114/linux/include/asm-i386/spinlock.h Mon Aug 3 17:48:28 1998
+++ linux/include/asm-i386/spinlock.h Tue Aug 4 00:47:25 1998
@@ -10,8 +10,8 @@
/*
* Your basic spinlocks, allowing only a single CPU anywhere
*/
-typedef struct { } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { }
+typedef struct { int gcc_is_buggy; } spinlock_t;
+#define SPIN_LOCK_UNLOCKED { 0 }
#define spin_lock_init(lock) do { } while(0)
#define spin_lock(lock) do { } while(0)
diff -u --recursive --new-file v2.1.114/linux/include/linux/sched.h linux/include/linux/sched.h
--- v2.1.114/linux/include/linux/sched.h Mon Aug 3 17:48:28 1998
+++ linux/include/linux/sched.h Tue Aug 4 00:24:05 1998
@@ -322,16 +322,6 @@
#define DEF_PRIORITY (20*HZ/100) /* 200 ms time slices */
-/* Note: This is very ugly I admit. But some versions of gcc will
- * dump core when an empty structure constant is parsed at
- * the end of a large top level structure initialization. -DaveM
- */
-#ifdef __SMP__
-#define INIT_LOCKS SPIN_LOCK_UNLOCKED
-#else
-#define INIT_LOCKS
-#endif
-
/*
* INIT_TASK is used to set up the first task table, touch at
* your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -367,7 +357,7 @@
/* fs */ &init_fs, \
/* files */ &init_files, \
/* mm */ &init_mm, \
-/* signals */ INIT_LOCKS, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \
+/* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \
}
union task_union {