From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
To: gdb-patches@sources.redhat.com
Subject: PATCH: Workaround IRIX 5 compilation problem
Date: Mon, 26 Apr 2004 20:43:00 -0000 [thread overview]
Message-ID: <16525.29805.263020.874731@xayide.TechFak.Uni-Bielefeld.DE> (raw)
GDB 6.1 fails to compile on mips-sgi-irix5.3 with the following error:
gcc -c -O2 -I. -I/vol/gnu/src/gdb/gdb-dist/gdb -I/vol/gnu/src/gdb/gdb-dist/gdb/config -DLOCALEDIR="\"/vol/gnu/share/locale\"" -DHAVE_CONFIG_H -I/vol/gnu/src/gdb/gdb-dist/gdb/../include/opcode -I/vol/gnu/src/gdb/gdb-dist/gdb/../readline/.. -I../bfd -I/vol/gnu/src/gdb/gdb-dist/gdb/../bfd -I/vol/gnu/src/gdb/gdb-dist/gdb/../include -I../intl -I/vol/gnu/src/gdb/gdb-dist/gdb/../intl -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral -Wunused-label /vol/gnu/src/gdb/gdb-dist/gdb/proc-api.c
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `create_procinfo':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:689: warning: implicit declaration of function `memset'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `dead_procinfo':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:828: warning: format not a string literal and no format arguments
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `proc_get_pending_signals':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:2037: warning: implicit declaration of function `memcpy'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `procfs_create_inferior':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4940: warning: implicit declaration of function `strchr'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4975: warning: implicit declaration of function `strlen'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4983: warning: implicit declaration of function `strncpy'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:4985: warning: implicit declaration of function `strcat'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `mappingflags':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5494: warning: implicit declaration of function `strcpy'
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_mappings_callback':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5539: warning: format not a string literal, argument types not checked
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_proc_mappings':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5569: warning: format not a string literal, argument types not checked
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `info_proc_cmd':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:5613: warning: implicit declaration of function `strncmp'
In file included from /usr/include/sys/proc.h:138,
from /vol/gnu/src/gdb/gdb-dist/gdb/proc-api.c:42:
/usr/include/sys/region.h:75: error: parse error before "anon_hdl"
/usr/include/sys/region.h:77: error: parse error before '}' token
/usr/include/sys/region.h:342: error: parse error before "sysreg"
/usr/include/sys/region.h:348: error: parse error before '*' token
/usr/include/sys/region.h:351: error: parse error before '*' token
/usr/include/sys/region.h:354: error: parse error before '*' token
/usr/include/sys/region.h:373: error: parse error before '*' token
/usr/include/sys/region.h:437: error: parse error before "reg_t"
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c: In function `create_procinfo':
/vol/gnu/src/gdb/gdb-dist/gdb/procfs.c:677: warning: 'parent' might be used uninitialized in this function
make[1]: *** [proc-api.o] Error 1
This happens because the definition of of anon_hdl in <sys/types.h> is
protected with _KERNEL || _STANDALONE || _KMEMUSER.
Compiling with -D_KMEMUSER works, but unfortunately adding that definition
to gdb/config/mips/nm-irix5.h does not: <sys/types.h> is included before
defs.h, so the definition needs to go either into config.h or directly into
proc-api.c. I think the former approach is cleaner, so this patch
implements it.
Ok for 6.1 branch and mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Fri Apr 23 22:48:23 2004 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* configure.in (mips-sgi-irix5*): Define _KMEMUSER for
<sys/proc.h>.
* configure: Regenerate.
* config.in: Likewise.
===================================================================
RCS file: gdb/RCS/configure.in,v
retrieving revision 1.1
diff -up -r1.1 gdb/configure.in
--- gdb/configure.in 2004/02/26 00:41:46 1.1
+++ gdb/configure.in 2004/04/23 20:48:02
@@ -606,6 +606,7 @@ AC_MSG_RESULT($gdb_cv_hpux_sswide)
# If we are configured native on GNU/Linux, work around problems with
# sys/procfs.h
# Also detect which type of /proc is in use, such as for Unixware or Solaris.
+# Work around a <sys/proc.h> problem on IRIX 5.
if test "${target}" = "${host}"; then
case "${host}" in
@@ -622,6 +623,10 @@ if test "${target}" = "${host}"; then
*-*-solaris2.[[6789]])
AC_DEFINE(NEW_PROC_API)
;;
+ mips-sgi-irix5*)
+ AC_DEFINE(_KMEMUSER, 1,
+ [[Define to 1 so <sys/proc.h> gets a definition of anon_hdl. ]])
+ ;;
esac
fi
next reply other threads:[~2004-04-26 20:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-26 20:43 Rainer Orth [this message]
2004-04-28 21:18 ` Andrew Cagney
2004-04-28 22:47 ` Rainer Orth
2004-04-29 0:08 ` Rainer Orth
2004-04-29 14:30 ` Andrew Cagney
2004-04-29 16:23 ` Rainer Orth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16525.29805.263020.874731@xayide.TechFak.Uni-Bielefeld.DE \
--to=ro@techfak.uni-bielefeld.de \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox