From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon K Hellan To: insight@sourceware.cygnus.com Subject: Build problem Linux/i386/Debian/Potato Date: Thu, 10 Feb 2000 03:20:00 -0000 Message-id: <20000210113220.A26876@parus.parus.no> X-SW-Source: 2000-q1/msg00061.html 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