This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
Re: Build problem Linux/i386/Debian/Potato
- To: Jon K Hellan <hellan at acm dot org>
- Subject: Re: Build problem Linux/i386/Debian/Potato
- From: Andrew Over <andrew at teknema dot com>
- Date: Thu, 10 Feb 2000 23:17:10 +1000
- Cc: insight at sourceware dot cygnus dot com
- References: <20000210113220.A26876@parus.parus.no>
Hi Jon.
On Thu, Feb 10, 2000 at 11:32:20AM +0100, Jon K Hellan wrote:
> I have build problems on Linux i386 Debian Potato. I've managed to work
> around the compilation errors, but get quite a few segfaults from the
> resulting binary. I am trying to build insight-20000131.
You're not the only one. In fact, this isn't specifically an insight
problem. It's filed as bug 54738 against debian's gdb package (which
can't be compiled either).
[SNIP]
> The problems are:
>
> - lin-thread.c sees conflicting types for lwpid_t and psaddr_t. I
> could silence the compiler by removing these definitions from
> gdb_proc_service.h.
>
> - i386-linux-nat.c sees a definition of fpregset_t which does not
> contain the members it expects.
My guess as to what's going on is that the glibc people have tried to
make a type opaque. Unfortunately, this type is still needed by the
gdb people.
As a result, I'm not really sure who is ultimately responsible. I'd
considered just posting to both mailing lists and letting the internal
people sort it out :)
I'm also not really sure why this problem is only afflicting debian
people -- it might just be a case of having a hideously up to date
libc6-dev package in comparison to the other distributions (apt is
wonderful).
I've attached the patch that I wound up using to get this working. It
is very nasty, but makes for a short term solution. Credit to
whomever originally filed bug 54738 :)
Cheers,
--Andrew
diff -u ../insight-20000131.orig/gdb/gdb_proc_service.h gdb/gdb_proc_service.h
--- ../insight-20000131.orig/gdb/gdb_proc_service.h Fri Dec 17 09:14:08 1999
+++ gdb/gdb_proc_service.h Sun Feb 6 00:50:53 2000
@@ -1,3 +1,9 @@
+#include <sys/elf.h>
+typedef elf_greg_t greg_t;
+typedef psaddr_t paddr_t;
+
+/* typedef psaddr_t paddr_t; */
+
typedef enum {
PS_OK, /* generic "call succeeded" */
PS_ERR, /* generic. */
@@ -12,13 +18,9 @@
*/
} ps_err_e;
-typedef unsigned int lwpid_t;
-typedef unsigned long paddr_t;
-typedef unsigned long psaddr_t;
-
-
+#if 0
typedef gregset_t prgregset_t; /* BOGUS BOGUS BOGUS */
typedef fpregset_t prfpregset_t; /* BOGUS BOGUS BOGUS */
-
+#endif
struct ps_prochandle; /* user defined. */
diff -u ../insight-20000131.orig/gdb/i386-linux-nat.c gdb/i386-linux-nat.c
--- ../insight-20000131.orig/gdb/i386-linux-nat.c Fri Jan 14 07:59:09 2000
+++ gdb/i386-linux-nat.c Sun Feb 6 00:41:47 2000
@@ -28,7 +28,16 @@
#include <sys/ptrace.h>
#include <sys/user.h>
-#include <sys/procfs.h>
+
+#include <sys/elf.h>
+typedef elf_fpregset_t fpregset_t;
+typedef elf_gregset_t gregset_t;
+typedef elf_greg_t greg_t;
+//typedef psaddr_t paddr_t;
+
+#define _SYS_UCONTEXT_H 1
+#include <sys/procfs.h>
+
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
diff -u ../insight-20000131.orig/gdb/lin-thread.c gdb/lin-thread.c
--- ../insight-20000131.orig/gdb/lin-thread.c Sat Dec 18 11:39:52 1999
+++ gdb/lin-thread.c Sun Feb 6 00:50:42 2000
@@ -115,7 +115,12 @@
#include <time.h>
+
#if defined(USE_PROC_FS) || defined(HAVE_GREGSET_T)
+#define _SYS_UCONTEXT_H 1
+#include <sys/elf.h>
+typedef elf_fpregset_t fpregset_t;
+typedef elf_gregset_t gregset_t;
#include <sys/procfs.h>
#endif