From mboxrd@z Thu Jan 1 00:00:00 1970 From: Moses DeJong To: insight@sourceware.cygnus.com Subject: Re: configure problem with insight. Date: Wed, 11 Aug 1999 16:21:00 -0000 Message-id: References: X-SW-Source: 1999-q3/msg00045.html Ok, we all know it is bad to reply to your own post but here goes. After applying the patch I just sent to the list to my insight source tree, I find that the insight no longer compiles as it now tries to build in gdb/gdbserver which does not seem to work yet. I tried to make some progress getting gdbserver to compile but I ran into an issue that I need some help on. When building I got this error. make[3]: Entering directory `/usr/local/project/insight-19990809/build52/gdb/gdbserver' gcc -c -g -O2 -W -Wall -I../../bfd -I../../../gdb/gdbserver/../../bfd -I. -I../../../gdb/gdbserver -I../../../gdb/gdbserver/.. -I../../../gdb/gdbserver/../config -I../../../gdb/gdbserver/../../include ../../../gdb/gdbserver/utils.c ../../../gdb/gdbserver/utils.c: In function `perror_with_name': ../../../gdb/gdbserver/utils.c:36: conflicting types for `sys_errlist' /usr/include/stdio.h:221: previous declaration of `sys_errlist' make[3]: *** [utils.o] Error 1 make[3]: Leaving directory `/usr/local/project/insight-19990809/build52/gdb/gdbserver' make[2]: *** [subdir_do] Error 1 make[2]: Leaving directory `/usr/local/project/insight-19990809/build52/gdb' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/local/project/insight-19990809/build52/gdb' make: *** [all-gdb] Error 2 In file : gdb/gdbserver/utils.c void perror_with_name (string) char *string; { extern int sys_nerr; extern char *sys_errlist[]; (! this is the line with the error!) extern int errno; In file : /usr/include/stdio.h #ifdef __USE_BSD extern int sys_nerr; extern const char *const sys_errlist[]; (! This is line 221!) #endif #ifdef __USE_GNU extern int _sys_nerr; extern const char *const _sys_errlist[]; #endif Here is a patch that fixes this problem. diff -u insight-19990809/gdb/gdbserver/utils.c ../insight-19990809/gdb/gdbserver/utils.c --- insight-19990809/gdb/gdbserver/utils.c Wed Jul 7 23:52:45 1999 +++ ../insight-19990809/gdb/gdbserver/utils.c Wed Aug 11 17:17:27 1999 @@ -33,7 +33,7 @@ char *string; { extern int sys_nerr; - extern char *sys_errlist[]; + extern const char *const sys_errlist[]; extern int errno; char *err; char *combined; The compiler used in the gdb/gdbserver Makefile is cc not gcc. This patch fixes that problem. diff -u gdb/gdbserver/Makefile.in ../../insight-19990809/gdb/gdbserver/Makefile.in --- gdb/gdbserver/Makefile.in Fri Jun 25 00:15:55 1999 +++ ../../insight-19990809/gdb/gdbserver/Makefile.in Wed Aug 11 17:29:35 1999 @@ -57,7 +57,7 @@ # distribution will fix your include files up. #CC=cc #CC=gcc -traditional -GCC=gcc +CC=gcc # Directory containing source files. Don't clean up the spacing, # this exact string is matched for by the "configure" script. I then got a couple of errors in gdb/gdbserver/low-linux.c ... ../../../gdb/gdbserver/low-linux.c: At top level: ../../../gdb/gdbserver/low-linux.c:175: `EAX' undeclared here (not in a function) ../../../gdb/gdbserver/low-linux.c:175: initializer element for `regmap[0]' is not constant ../../../gdb/gdbserver/low-linux.c:175: `ECX' undeclared here (not in a function) ../../../gdb/gdbserver/low-linux.c:175: initializer element for `regmap[1]' is not constant ../../../gdb/gdbserver/low-linux.c:175: `EDX' undeclared here (not in a function) ../../../gdb/gdbserver/low-linux.c:175: initializer element for `regmap[2]' is not constant ../../../gdb/gdbserver/low-linux.c:275: `PTRACE_PEEKUSR' undeclared (first use this function) ../../../gdb/gdbserver/low-linux.c:275: (Each undeclared identifier is reported only once ../../../gdb/gdbserver/low-linux.c:275: for each function it appears in.) ../../../gdb/gdbserver/low-linux.c: In function `store_inferior_registers': ../../../gdb/gdbserver/low-linux.c:344: `PTRACE_POKEUSR' undeclared (first use this function) This patch fixes these two errors. It changes the include of ptrace.h and includes sys/reg.h when using glibc 2.0 and 2.1. diff -u gdb/gdbserver/low-linux.c ../../insight-19990809/gdb/gdbserver/low-linux.c --- gdb/gdbserver/low-linux.c Wed Jul 7 23:52:44 1999 +++ ../../insight-19990809/gdb/gdbserver/low-linux.c Wed Aug 11 17:48:30 1999 @@ -45,9 +45,13 @@ char buf2[MAX_REGISTER_RAW_SIZE]; /***************End MY defs*********************/ -#include +#if defined (__linux__) + #include +#else + #include +#endif -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) +#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 0) #include #endif But now I have run into an error that I am not sure how to fix. % make gcc -c -g -O2 -W -Wall -I../../bfd -I../../../gdb/gdbserver/../../bfd -I. -I../../../gdb/gdbserver -I../../../gdb/gdbserver/.. -I../../../gdb/gdbserver/../config -I../../../gdb/gdbserver/../../include ../../../gdb/gdbserver/low-linux.c ../../../gdb/gdbserver/low-linux.c:39: conflicting types for `registers' ../../../gdb/gdbserver/../inferior.h:114: previous declaration of `registers' >From gdb/inferior.h /* Character array containing an image of the inferior programs' registers. */ extern char *registers; >From gdb/gdbserver/low-linux.c /***************Begin MY defs*********************/ int quit_flag = 0; char registers[REGISTER_BYTES]; Does anyone know if these are intended to be the same memory. Should the char registers[REGISTER_BYTES] be declared extern? Any ideas? Mo DeJong dejong@cs.umn.edu