Mail Archives: djgpp-workers/2004/04/23/14:01:55
Tried to debug a crashes in cc1plus.exe (gcc-3.40 when built using DJGPP-2.04
development versions) while compiling some files. Crashes happens at
preprocessing time. It was difficult to get reasonable backtrace, but for one
file it's verified that crashes happens when closing file (inside close(fd)).
If I build gcc-3.4.0 then cc1plus doesn't crash on that file. At least while
this my build of gdb-6.1 worked reasonable well.
I suspect memory corruption, but I don't know what is guilty (GCC itself or
our libc).
Also tried to build current DJGPP devel.version from CVS. Needed some
patches (below) to avoid compiler errors:
- gcc doesn't like -mcpu and warns that one should use -mtune instead
- I removed -Werror as I didn't like to fix all warning immediatelly
- address of static variable not found in inline assembler (make it global,
obfuscated name a bit) in dbgcom.c
- problems recognizing old (K&R) function definitions in wf_acos.c. It was not
only such message, but only which gave compiler error. I don't know if this
is expected behaviour.
In any case it seems that gcc-3.4.0 in not even near ready for v2gnu.
(gdb-6.1 seems to be in better shape...)
Andris
--- ./src/debug/common/dbgcom.c~1 2002-10-17 23:00:24.000000000 +0000
+++ ./src/debug/common/dbgcom.c 2004-04-23 20:22:44.000000000 +0000
@@ -361,7 +361,7 @@
the time. So most DPMI servers don't support it, and our code will
never be called if we tie it to exception 17. In contrast, exception
13 is GPF, and *any* DPMI server will support that! */
-static unsigned char forced_test[] = {
+unsigned char _dj_forced_test[] = {
0x6a,0x0d, /* pushl $0x0d */
0xeb,0x10, /* jmp relative +0x10 */
0x6a,0x0e, /* pushl $0x0e */
@@ -377,7 +377,7 @@
0x2e,0x80,0x3d /* (beginning of) %cs:cmpb $0,forced */
}; /* four next bytes contain the address of the `forced' variable */
-static int forced_test_size = sizeof (forced_test);
+static int forced_test_size = sizeof (_dj_forced_test);
static int forced_address_known = 0;
static unsigned int forced_address = 0;
@@ -416,7 +416,7 @@
cld \n\
movw %cx,%es \n\
movl %edx,%edi \n\
- movl $_forced_test,%esi \n\
+ movl $__dj_forced_test,%esi \n\
movl _forced_test_size,%ecx \n\
repe \n\
cmpsb \n\
@@ -1491,7 +1491,7 @@
/* Invalidate the info about the `forced' variable. */
forced_address_known = 0;
forced_address = 0;
- forced_test_size = sizeof (forced_test); /* pacify the compiler */
+ forced_test_size = sizeof (_dj_forced_test); /* pacify the compiler */
/* Set the flag, that the user interrupt vectors are no longer valid */
user_int_set = 0;
--- ./src/libm/math/wf_acos.c~1 2003-07-20 10:06:54.000000000 +0000
+++ ./src/libm/math/wf_acos.c 2004-04-23 20:33:34.000000000 +0000
@@ -23,8 +23,9 @@
#ifdef _HAVE_STDC
float acosf(float x) /* wrapper acosf */
#else
- float acosf(x) /* wrapper acosf */
- float x;
+/* float acosf(x) */ /* wrapper acosf */
+/* float x; */
+ float acosf(float x) /* wrapper acosf */
#endif
{
#ifdef _IEEE_LIBM
--- ./src/gcc.opt~1 2002-04-03 16:22:26.000000000 +0000
+++ ./src/gcc.opt 2004-04-23 20:06:42.000000000 +0000
@@ -1,11 +1,10 @@
-MD
-O2
--mcpu=pentium
+-mtune=pentium
-march=i386
-Wall
-Wbad-function-cast
-Wcast-qual
--Werror
-Wmissing-declarations
-Wmissing-prototypes
-Wpointer-arith
--- ./src/gcc-l.opt~1 2002-04-06 20:13:14.000000000 +0000
+++ ./src/gcc-l.opt 2004-04-23 20:00:14.000000000 +0000
@@ -1,6 +1,6 @@
-MD
-O2
--mcpu=pentium
+-mtune=pentium
-march=i386
-Wall
-nostdinc
--- ./src/gpp.opt~1 2004-04-22 05:54:30.000000000 +0000
+++ ./src/gpp.opt 2004-04-23 20:06:50.000000000 +0000
@@ -1,11 +1,10 @@
-MD
-O2
--mcpu=pentium
+-mtune=pentium
-march=i386
-Wall
-Wcast-qual
--Werror
-Wmissing-prototypes
-Wpointer-arith
- Raw text -