This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

3.4 PATCH: Fix IRIX 6.5.1[78] libjava bootstrap failure


This patch fixes the libjava bootstrap failure described in the thread
starting at

	http://gcc.gnu.org/ml/java/2003-02/msg00037.html

and in PR libgcj/9652.

I've received my copy of IRIX 6.5.19 in the meantime and verified that the
fix below matches <sys/socket.h> from that release.  If fixes the 6.5.18
file as desired and leaves the 6.5.19 one untouched.  With this patch,
libjava bootstraps again on both 6.5.18 and 6.5.19.

Mainline bootstrapped successfully on IRIX 6.5.18 and 6.5.19.  Passes make
check in gcc/fixinc.  Since this is a generic IRIX 6.5.1[78] header problem
affecting libjava on all active branches (3.2, 3.3, and mainline), I'd like
to apply it everywhere.

Ok (even without bootstraps on the 3.2 and 3.3 branches: those would take
me about three days each)?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Wed Feb 12 19:37:30 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* fixinc/inclhack.def (irix_socklen_t): Fix broken IRIX 6.5.1[78]
	socklen_t definition.
	* fixinc/fixincl.x: Regenerate.
	* fixinc/tests/base/sys/socket.h: New file.
	Fixes PR libgcj/9652.
	
Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.143
diff -u -p -r1.143 inclhack.def
--- inclhack.def	14 Feb 2003 04:19:02 -0000	1.143
+++ inclhack.def	17 Feb 2003 17:57:20 -0000
@@ -1357,6 +1357,30 @@ fix = {
 
 
 /*
+ *  IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t.
+ *  Various socket function prototypes use different types instead,
+ *  depending on the API in use (BSD, XPG4/5), but the socklen_t
+ *  definition doesn't reflect this (SGI Bug Id 864477, fixed in
+ *  IRIX 6.5.19).
+ */
+fix = {
+    hackname  = irix_socklen_t;
+    files     = sys/socket.h;
+    select    = "(#define _SOCKLEN_T\n)(typedef u_int32_t socklen_t;)";
+
+    mach      = "mips-sgi-irix6.5";
+    c_fix     = format;
+    c_fix_arg = "%1"
+    		"#if _NO_XOPEN4 && _NO_XOPEN5\n"
+    		"typedef int socklen_t;\n"
+		"#else\n"
+    		"%2\n"
+    		"#endif /* _NO_XOPEN4 && _NO_XOPEN5 */";
+
+    test_text = "#define _SOCKLEN_T\ntypedef u_int32_t socklen_t;";
+};
+
+/*
  *  IRIX 5.x's stdio.h declares some functions that take a va_list as
  *  taking char *.  However, GCC uses void * for va_list, so
  *  calling vfprintf with a va_list fails in C++.  */
Index: tests/base/sys/socket.h
===================================================================
RCS file: tests/base/sys/socket.h
diff -N tests/base/sys/socket.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/base/sys/socket.h	17 Feb 2003 17:57:20 -0000
@@ -0,0 +1,19 @@
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/sys/socket.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( IRIX_SOCKLEN_T_CHECK )
+#define _SOCKLEN_T
+#if _NO_XOPEN4 && _NO_XOPEN5
+typedef int socklen_t;
+#else
+typedef u_int32_t socklen_t;
+#endif /* _NO_XOPEN4 && _NO_XOPEN5 */
+#endif  /* IRIX_SOCKLEN_T_CHECK */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]