This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: Workaround IRIX 5 compilation problem
- From: Andrew Cagney <cagney at gnu dot org>
- To: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 28 Apr 2004 17:18:59 -0400
- Subject: Re: PATCH: Workaround IRIX 5 compilation problem
- References: <16525.29805.263020.874731@xayide.TechFak.Uni-Bielefeld.DE>
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?
Does the attached also work? This avoids blindly un/redefining _KMEMUSER.
Andrew
2004-04-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Andrew Cagney <cagney@redhat.com>
* configure.in (mips-sgi-irix5*): Define _KMEMUSER for
<sys/proc.h>.
* acconfig.h: Provide default _KMEMUSER value.
* config.in, configure: Re-generate.
Index: acconfig.h
===================================================================
RCS file: /cvs/src/src/gdb/acconfig.h,v
retrieving revision 1.28
diff -u -r1.28 acconfig.h
--- acconfig.h 20 Jan 2004 09:29:13 -0000 1.28
+++ acconfig.h 28 Apr 2004 21:16:42 -0000
@@ -165,3 +165,9 @@
/* nativefile */
#undef GDB_NM_FILE
+
+/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
+ around a <sys/proc.h> problem on IRIX 5. */
+#ifndef _KMEMUSER
+#undef _KMEMUSER
+#endif
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.151
diff -u -r1.151 configure.in
--- configure.in 25 Apr 2004 20:42:45 -0000 1.151
+++ configure.in 28 Apr 2004 21:16:44 -0000
@@ -632,7 +632,10 @@
*-*-solaris2.[[6789]])
AC_DEFINE(NEW_PROC_API)
;;
- esac
+ mips-sgi-irix5*)
+ AC_DEFINE([_KMEMUSER], 1)
+ ;;
+ esac
fi
if test "$ac_cv_header_sys_procfs_h" = yes; then