public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Build problem Linux/i386/Debian/Potato
@ 2000-02-10  3:20 Jon K Hellan
  2000-02-10  5:17 ` Andrew Over
  0 siblings, 1 reply; 2+ messages in thread
From: Jon K Hellan @ 2000-02-10  3:20 UTC (permalink / raw)
  To: insight

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 11267 bytes --]

Hi,

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.

There are compile errors in i386-linux-nat.c and lin-thread.c.
At the bottom of this message, you can see all compiler complaints
about these two files. (I also get about 3000 warnings during the
build, is that normal?)

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.

Digging in, we find:

At i386-linux-nat.c:215, member st_space of an fpregset_t is accessed.

The definition of fpregset_t is taken from /usr/include/sys/ucontext.h:
  typedef struct _fpstate *fpregset_t;

This is not the right definiton. Struct _fpstate is defined in
/usr/include/asm/sigcontext.h, and does not have the members gdb is
looking for.

But user_fpregs_struct in /usr/include/sys/user.h has the right
members. And in /usr/include/sys/elf.h, we find
  typedef struct user_fpregs_struct elf_fpregset_t;

Insight compiles if we replace uses of fpregset_t with elf_fpregset_t.
But I would prefer to do this in a clean way.

Configure enabled the define #define HAVE_FPREGSET_T 1, but disabling
this didn't help.

I tried linking linux and asm directories in symbolically across to
the real kernel headers, as this used to be common practice. That
didn't help, either.

My stopgap measure was to do this in i386-linux-nat.c:
#define fpregset_t elf_fpregset_t

For consistency, I did the same in core-regset.c, and in lin-thread.c:
#define prfpregset_t elf_fpregset_t

But it's not a nice way to do it!

Tips, anyone?

Jon KÃ¥re


make[1]: Entering directory `/u4/jk/insight-20000131/gdb'
gcc -c -g -O2 -W -Wall    -I. -I. -I./config -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/.. -I../bfd -I./../bfd  -I./../include -I../intl -I./../intl -I./tui -DGDBTK   i386-linux-nat.c
i386-linux-nat.c: In function `convert_to_gregset':
i386-linux-nat.c:124: warning: unused parameter `gdb_regs'
i386-linux-nat.c: In function `fetch_regs':
i386-linux-nat.c:159: warning: unused variable `regno'
i386-linux-nat.c: In function `store_regs':
i386-linux-nat.c:178: warning: unused variable `regno'
i386-linux-nat.c: In function `supply_fpregset':
i386-linux-nat.c:215: request for member `st_space' in something not a structure or union
i386-linux-nat.c:217: request for member `cwd' in something not a structure or union
i386-linux-nat.c:218: request for member `swd' in something not a structure or union
i386-linux-nat.c:219: request for member `twd' in something not a structure or union
i386-linux-nat.c:220: request for member `fip' in something not a structure or union
i386-linux-nat.c:221: request for member `fos' in something not a structure or union
i386-linux-nat.c:222: request for member `foo' in something not a structure or union
i386-linux-nat.c:228: request for member `fcs' in something not a structure or union
i386-linux-nat.c:231: request for member `fcs' in something not a structure or union
i386-linux-nat.c: In function `convert_to_fpregset':
i386-linux-nat.c:255: request for member `st_space' in something not a structure or union
i386-linux-nat.c:264: request for member `cwd' in something not a structure or union
i386-linux-nat.c:264: request for member `cwd' in something not a structure or union
i386-linux-nat.c:265: request for member `swd' in something not a structure or union
i386-linux-nat.c:265: request for member `swd' in something not a structure or union
i386-linux-nat.c:266: request for member `twd' in something not a structure or union
i386-linux-nat.c:266: request for member `twd' in something not a structure or union
i386-linux-nat.c:267: request for member `fip' in something not a structure or union
i386-linux-nat.c:267: request for member `fip' in something not a structure or union
i386-linux-nat.c:268: request for member `foo' in something not a structure or union
i386-linux-nat.c:268: request for member `foo' in something not a structure or union
i386-linux-nat.c:269: request for member `fos' in something not a structure or union
i386-linux-nat.c:269: request for member `fos' in something not a structure or union
i386-linux-nat.c:274: request for member `fcs' in something not a structure or union
i386-linux-nat.c:275: request for member `fcs' in something not a structure or union
i386-linux-nat.c:279: request for member `fcs' in something not a structure or union
i386-linux-nat.c:280: request for member `fcs' in something not a structure or union
i386-linux-nat.c:247: warning: unused parameter `gdb_regs'
i386-linux-nat.c: In function `fill_fpregset':
i386-linux-nat.c:292: warning: unused parameter `regno'
i386-linux-nat.c: In function `fetch_fpregs':
i386-linux-nat.c:303: warning: unused variable `regno'
i386-linux-nat.c: In function `store_xfpregs':
i386-linux-nat.c:527: warning: unused parameter `tid'
i386-linux-nat.c: In function `fetch_xfpregs':
i386-linux-nat.c:528: warning: unused parameter `tid'
i386-linux-nat.c: In function `i386_linux_fetch_core_registers':
i386-linux-nat.c:664: warning: unused parameter `dummy'
make[1]: *** [i386-linux-nat.o] Error 1
gcc -c -g -O2 -W -Wall    -I. -I. -I./config -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/.. -I../bfd -I./../bfd  -I./../include -I../intl -I./../intl -I./tui -DGDBTK   lin-thread.c
In file included from lin-thread.c:125:
gdb_proc_service.h:15: conflicting types for `lwpid_t'
/usr/include/sys/procfs.h:109: previous declaration of `lwpid_t'
gdb_proc_service.h:17: conflicting types for `psaddr_t'
/usr/include/sys/procfs.h:101: previous declaration of `psaddr_t'
gdb_proc_service.h:20: warning: redefinition of `prgregset_t'
/usr/include/sys/procfs.h:104: warning: `prgregset_t' previously declared here
gdb_proc_service.h:21: warning: redefinition of `prfpregset_t'
/usr/include/sys/procfs.h:105: warning: `prfpregset_t' previously declared here
lin-thread.c: In function `ps_pstop':
lin-thread.c:187: warning: unused parameter `ph'
lin-thread.c: In function `ps_pcontinue':
lin-thread.c:193: warning: unused parameter `ph'
lin-thread.c: In function `ps_lstop':
lin-thread.c:199: warning: unused parameter `ph'
lin-thread.c:200: warning: unused parameter `lwpid'
lin-thread.c: In function `ps_lcontinue':
lin-thread.c:206: warning: unused parameter `ph'
lin-thread.c:207: warning: unused parameter `lwpid'
lin-thread.c: In function `ps_lgetxregsize':
lin-thread.c:213: warning: unused parameter `ph'
lin-thread.c:214: warning: unused parameter `lwpid'
lin-thread.c:215: warning: unused parameter `xregsize'
lin-thread.c: In function `ps_lgetxregs':
lin-thread.c:221: warning: unused parameter `ph'
lin-thread.c:222: warning: unused parameter `lwpid'
lin-thread.c:223: warning: unused parameter `xregset'
lin-thread.c: In function `ps_lsetxregs':
lin-thread.c:229: warning: unused parameter `ph'
lin-thread.c:230: warning: unused parameter `lwpid'
lin-thread.c:231: warning: unused parameter `xregset'
lin-thread.c: In function `ps_pglobal_lookup':
lin-thread.c:252: warning: unused parameter `ph'
lin-thread.c:253: warning: unused parameter `ld_object_name'
lin-thread.c: In function `rw_common':
lin-thread.c:336: warning: unused parameter `ph'
lin-thread.c: In function `ps_lgetregs':
lin-thread.c:381: warning: implicit declaration of function `fill_gregset'
lin-thread.c:372: warning: unused parameter `ph'
lin-thread.c: In function `ps_lsetregs':
lin-thread.c:395: warning: implicit declaration of function `supply_gregset'
lin-thread.c:388: warning: unused parameter `ph'
lin-thread.c: In function `ps_lgetfpregs':
lin-thread.c:410: warning: implicit declaration of function `fill_fpregset'
lin-thread.c:402: warning: unused parameter `ph'
lin-thread.c: In function `ps_lsetfpregs':
lin-thread.c:423: warning: implicit declaration of function `supply_fpregset'
lin-thread.c:416: warning: unused parameter `ph'
lin-thread.c: In function `enable_thread_event_reporting':
lin-thread.c:916: warning: unused variable `addr'
lin-thread.c: In function `disable_thread_event_reporting':
lin-thread.c:972: warning: unused parameter `ta'
lin-thread.c: In function `check_for_thread_event':
lin-thread.c:994: warning: unused parameter `tws'
lin-thread.c:994: warning: unused parameter `event_pid'
lin-thread.c:998: warning: control reaches end of non-void function
lin-thread.c: In function `thread_db_unpush_target':
lin-thread.c:1029: warning: implicit declaration of function `linuxthreads_discard_global_state'
lin-thread.c: In function `thread_db_pid_to_str':
lin-thread.c:1217: warning: int format, long int arg (arg 3)
lin-thread.c:1220: warning: int format, long int arg (arg 3)
lin-thread.c: In function `handle_new_thread':
lin-thread.c:1397: warning: implicit declaration of function `attach_thread'
lin-thread.c:1389: warning: unused variable `wait_status'
lin-thread.c:1389: warning: unused variable `wait_pid'
lin-thread.c: In function `find_new_threads_callback':
lin-thread.c:1423: warning: unused parameter `ignored'
lin-thread.c: In function `resume_thread_callback':
lin-thread.c:1506: warning: comparison between signed and unsigned
lin-thread.c:1507: warning: comparison between signed and unsigned
lin-thread.c:1490: warning: unused parameter `data'
lin-thread.c: In function `new_resume_thread_callback':
lin-thread.c:1520: warning: unused parameter `data'
lin-thread.c: In function `stop_or_attach_thread_callback':
lin-thread.c:1618: warning: comparison between signed and unsigned
lin-thread.c:1619: warning: comparison between signed and unsigned
lin-thread.c:1592: warning: unused parameter `data'
lin-thread.c: In function `wait_for_stop':
lin-thread.c:1659: warning: implicit declaration of function `waitpid'
lin-thread.c:1668: warning: comparison between signed and unsigned
lin-thread.c:1663: warning: suggest explicit braces to avoid ambiguous `else'
lin-thread.c: In function `wait_thread_callback':
lin-thread.c:1755: warning: comparison between signed and unsigned
lin-thread.c:1756: warning: comparison between signed and unsigned
lin-thread.c:1743: warning: unused parameter `data'
lin-thread.c: In function `new_wait_thread_callback':
lin-thread.c:1766: warning: unused parameter `data'
lin-thread.c: In function `thread_db_wait':
lin-thread.c:1799: warning: implicit declaration of function `check_all_signal_numbers'
lin-thread.c:1813: warning: implicit declaration of function `linux_child_wait'
lin-thread.c:1786: warning: unused parameter `pid'
lin-thread.c: In function `kill_thread_callback':
lin-thread.c:1914: warning: comparison between signed and unsigned
lin-thread.c:1901: warning: unused parameter `data'
lin-thread.c: In function `detach_thread_callback':
lin-thread.c:2009: warning: comparison between signed and unsigned
lin-thread.c:1993: warning: unused parameter `data'
lin-thread.c: At top level:
lin-thread.c:827: warning: `next_pending_event' defined but not used
lin-thread.c:995: warning: `check_for_thread_event' defined but not used
lin-thread.c:1489: warning: `resume_thread_callback' defined but not used
make[1]: *** [lin-thread.o] Error 1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Build problem Linux/i386/Debian/Potato
  2000-02-10  3:20 Build problem Linux/i386/Debian/Potato Jon K Hellan
@ 2000-02-10  5:17 ` Andrew Over
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Over @ 2000-02-10  5:17 UTC (permalink / raw)
  To: Jon K Hellan; +Cc: insight

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-10  5:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-10  3:20 Build problem Linux/i386/Debian/Potato Jon K Hellan
2000-02-10  5:17 ` Andrew Over

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).