This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: compiling error for gdb-4.17 using egcs-1.1b
- To: pxu at perigee dot net
- Subject: Re: compiling error for gdb-4.17 using egcs-1.1b
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Mon, 7 Sep 1998 18:32:56 +0200 (MEST)
- Cc: bug-gdb at prep dot ai dot mit dot edu, egcs at cygnus dot com
- References: <Pine.LNX.3.96.980906165848.22504A-100000@myhome.ua.edu>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
On Sun, 6 September 1998, 17:06:24, pxu@perigee.net wrote:
> Hi there,
> I ran into the following error compiling gdb-4.17 using egcs-1.1b,
> here I tried to compile it with glibc2.0.7pre6, which was installed
> in /usr/i486-linuxglibc2 as a second library, the egcs-1.1b is
> compiled with target i486-pc-linux-glibc1.
> I was able to compile gdb-4.17 with egcs-1.0.x, secondary glibc2.06!
> The error message gives:
>
> gcc -b i486-linuxglibc2 -c -nostdinc -I/usr/i486-linuxglibc2/include
> -I/usr/lib/gcc-lib/i486-linuxglibc2/egcs-2.91.57/include -D__USE_MISC
> -I. -I. -I./config -DHAVE_CONFIG_H -I./../include/opcode -I./../readline
> -I../bfd -I./../bfd -I./../include infptrace.c
> infptrace.c: In function `attach':
> infptrace.c:206: `PTRACE_ATTACH' undeclared (first use in this function)
> infptrace.c:206: (Each undeclared identifier is reported only once
> infptrace.c:206: for each function it appears in.)
> infptrace.c: In function `detach':
> infptrace.c:222: `PTRACE_DETACH' undeclared (first use in this function)
> make[1]: *** [infptrace.o] Error 1
> make[1]: Leaving directory `/home/pxu/tmp/gdb-4.17/gdb'
> make: *** [all-gdb] Error 2
>
> >grep -n PTRACE_ATTACH *
>
> infptrace.c:74:#define PT_ATTACH PTRACE_ATTACH
> remote-vx.c:1242: status = net_ptrace_clnt_call (PTRACE_ATTACH,
> &ptrace_in, &ptrace_out);
> umax-xdep.c:32:#define PTRACE_ATTACH PT_ATTACH
>
> >ls -l umax-xdep.c infptrace.c
> -rw-r--r-- 1 pxu users 15034 Feb 6 1998 infptrace.c
> -rw-r--r-- 1 pxu users 3588 Nov 5 1995 umax-xdep.c
>
> Help would be highly appreciated.
>
> Pinwu
I posted a patch for building gdb-4.17 on Red Hat 5.1 (which is using
glibc-2.0.7) some weeks ago. Please note, you cannot build gdb on
recent hacker kernels (2.1.x) due to removal of the file
<linux/debugreg.h> which glibc's <sys/debugreg.h> still refers to.
Hope this helps,
--
Manfred Hollstein If you have any questions about GNU software:
Hindenburgstr. 13/1 <mailto:manfred@s-direktnet.de>
75446 Wiernsheim, FRG <http://www.s-direktnet.de/HomePages/manfred/>
PGP key: <http://www.s-direktnet.de/HomePages/manfred/manfred.asc>
>>>>>>>>>>>>>>>>>>>>>>>> BEGIN: gdb-4.17.diffs <<<<<<<<<<<<<<<<<<<<<<<
gdb/ChangeLog:
1998-08-15 Manfred Hollstein <manfred@s-direktnet.de>
* i386v4-nat.c: Add #include <sys/reg.h> on Linux with GNU libc.
* gdbserver/low-linux.c: Likewise.
(PTRACE_PEEKUSR): Map to PTRACE_PEEKUSER with GNU libc.
(PTRACE_POKEUSR): Map to PTRACE_POKEUSER with GNU libc.
* config/i386/nm-linux.h (NO_PTRACE_H): Undefine with GNU libc.
(NO_SYS_REG_H): Don't define with GNU libc.
diff -rupN gdb-4.17.orig/gdb/config/i386/nm-linux.h gdb-4.17/gdb/config/i386/nm-linux.h
--- gdb-4.17.orig/gdb/config/i386/nm-linux.h Wed Apr 22 03:23:16 1998
+++ gdb-4.17/gdb/config/i386/nm-linux.h Sat Aug 15 18:48:37 1998
@@ -33,9 +33,16 @@ extern int kernel_u_size PARAMS ((void))
#define U_REGS_OFFSET 0
+#if defined (__GLIBC__) && (__GLIBC__ >= 2)
+#undef NO_PTRACE_H
+#endif
+
/* GNU/Linux uses the SYSV i386v-nat.c support, but doesn't have <sys/reg.h> */
+/* Linux systems using GNU libc have <sys/reg.h>. */
+#if !defined (__GLIBC__) || (__GLIBC__ < 2)
#define NO_SYS_REG_H
+#endif
/* GNU/Linux supports the 386 hardware debugging registers. */
diff -rupN gdb-4.17.orig/gdb/gdbserver/low-linux.c gdb-4.17/gdb/gdbserver/low-linux.c
--- gdb-4.17.orig/gdb/gdbserver/low-linux.c Fri Oct 11 21:26:04 1996
+++ gdb-4.17/gdb/gdbserver/low-linux.c Sat Aug 15 18:48:37 1998
@@ -45,8 +45,10 @@ char buf2[MAX_REGISTER_RAW_SIZE];
/***************End MY defs*********************/
#include <sys/ptrace.h>
-#if 0
-#include <machine/reg.h>
+#if defined (__GLIBC__) && (__GLIBC__ >= 2)
+#define PTRACE_PEEKUSR PTRACE_PEEKUSER
+#define PTRACE_POKEUSR PTRACE_POKEUSER
+#include <sys/reg.h>
#endif
extern char **environ;
diff -rupN gdb-4.17.orig/gdb/i386v4-nat.c gdb-4.17/gdb/i386v4-nat.c
--- gdb-4.17.orig/gdb/i386v4-nat.c Fri Jun 13 19:30:02 1997
+++ gdb-4.17/gdb/i386v4-nat.c Sat Aug 15 18:48:37 1998
@@ -67,6 +67,10 @@ Foundation, Inc., 59 Temple Place - Suit
*/
+#if defined (__linux__) && defined (__GLIBC__) && (__GLIBC__ >= 2)
+# include <sys/reg.h>
+#endif
+
#ifdef HAVE_GREGSET_T
/* This is a duplicate of the table in i386-xdep.c. */
>>>>>>>>>>>>>>>>>>>>>>>>> END: gdb-4.17.diffs <<<<<<<<<<<<<<<<<<<<<<<<