diff mbox

Remove obsolete IRIX 6.5 support

Message ID yddr4wuc4tw.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth March 15, 2012, 2:32 p.m. UTC
Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> * I'm removing IRIX-specific parts of libgo.  Given that libgo is
>>   imported from upstream (and supposed to work or made work on the 4.7
>>   branch), I don't know if this a good idea.
>
> Yeah, it's not.  Just send me the mainline patches to libgo rather than
> applying them yourself, I'll apply them to the upstream repository and
> commit to mainline.

Here's the libgo part of the patch.  Given that IRIX 6.5 Go support
remains on the 4.7 branch (and I hope to fix it up sufficiently to be
useful after 4.7.0 is released), I wonder if it's a good idea to apply
it upstream or better handle libgo like the other upstream libraries
(boehm-gc, libffi) which I didn't touch for the removal.

Thanks.
	Rainer


2012-03-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgo:
	* configure.ac (is_irix): Remove.
	(mips-sgi-irix6.5*): Don't set OSCFLAGS.
	* configure: Regenerate.
	* Makefile.am [LIBGO_IS_IRIX]: Remove.
	* Makefile.in: Regenerate.
	* mksysinfo.sh [__sgi__]: Remove.
	(__timespec): Remove.

	* go/net/http/cgi/host.go (osDefaultInheritEnv): Remove irix
	handling.
	* go/syscall/socket_irix.go: Remove.
	* go/time/zoneinfo_unix.go (zoneDirs): Remove IRIX 6 support.
diff mbox

Patch

diff --git a/libgo/Makefile.am b/libgo/Makefile.am
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -646,12 +646,6 @@  go_net_sock_file = go/net/sock_linux.go
 go_net_sockopt_file = go/net/sockopt_linux.go
 go_net_sockoptip_file = go/net/sockoptip_linux.go
 else
-if LIBGO_IS_IRIX
-go_net_cgo_file = go/net/cgo_linux.go
-go_net_sock_file = go/net/sock_linux.go
-go_net_sockopt_file = go/net/sockopt_linux.go
-go_net_sockoptip_file = go/net/sockoptip_linux.go
-else
 if LIBGO_IS_SOLARIS
 go_net_cgo_file = go/net/cgo_linux.go
 go_net_sock_file = go/net/sock_linux.go
@@ -671,7 +665,6 @@  go_net_sockoptip_file = go/net/sockoptip
 endif
 endif
 endif
-endif
 
 if LIBGO_IS_LINUX
 go_net_sendfile_file = go/net/sendfile_linux.go
@@ -754,9 +747,6 @@  else
 if LIBGO_IS_SOLARIS
 go_os_sys_file = go/os/sys_uname.go
 else
-if LIBGO_IS_IRIX
-go_os_sys_file = go/os/sys_uname.go
-else
 if LIBGO_IS_RTEMS
 go_os_sys_file = go/os/sys_uname.go
 else
@@ -764,7 +754,6 @@  go_os_sys_file = go/os/sys_bsd.go
 endif
 endif
 endif
-endif
 
 if LIBGO_IS_SOLARIS
 go_os_stat_file = go/os/stat_solaris.go
@@ -862,12 +851,8 @@  go_sync_files = \
 if LIBGO_IS_SOLARIS
 go_syslog_file = go/log/syslog/syslog_libc.go
 else
-if LIBGO_IS_IRIX
-go_syslog_file = go/log/syslog/syslog_libc.go
-else
 go_syslog_file = go/log/syslog/syslog_unix.go
 endif
-endif
 
 go_log_syslog_files = \
 	go/log/syslog/syslog.go \
@@ -1464,13 +1449,9 @@  else
 if LIBGO_IS_SOLARIS
 syscall_socket_file = go/syscall/socket_solaris.go
 else
-if LIBGO_IS_IRIX
-syscall_socket_file = go/syscall/socket_irix.go
-else
 syscall_socket_file = go/syscall/socket_bsd.go
 endif
 endif
-endif
 
 # Support for uname.
 if LIBGO_IS_SOLARIS
diff --git a/libgo/configure.ac b/libgo/configure.ac
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -126,7 +126,6 @@  AC_SUBST(go_include)
 
 is_darwin=no
 is_freebsd=no
-is_irix=no
 is_linux=no
 is_netbsd=no
 is_rtems=no
@@ -135,7 +134,6 @@  GOOS=unknown
 case ${host} in
   *-*-darwin*)   is_darwin=yes;  GOOS=darwin ;;
   *-*-freebsd*)  is_freebsd=yes; GOOS=freebsd ;;
-  *-*-irix6*)    is_irix=yes;    GOOS=irix ;;
   *-*-linux*)    is_linux=yes;   GOOS=linux ;;
   *-*-netbsd*)	 is_netbsd=yes;  GOOS=netbsd ;;
   *-*-rtems*)    is_rtems=yes;   GOOS=rtems ;;
@@ -143,7 +141,6 @@  case ${host} in
 esac
 AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)
 AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
-AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)
 AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
 AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)
 AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
@@ -285,11 +282,6 @@  AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)
 dnl Special flags used to generate sysinfo.go.
 OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 case "$target" in
-    mips-sgi-irix6.5*)
-	# IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
-	# msghdr in <sys/socket.h>.
-	OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
-	;;
     *-*-solaris2.[[89]])
 	# Solaris 8/9 need this so struct msghdr gets the msg_control
 	# etc. fields in <sys/socket.h> (_XPG4_2).
diff --git a/libgo/go/net/http/cgi/host.go b/libgo/go/net/http/cgi/host.go
--- a/libgo/go/net/http/cgi/host.go
+++ b/libgo/go/net/http/cgi/host.go
@@ -35,7 +35,6 @@  var osDefaultInheritEnv = map[string][]s
 	"darwin":  {"DYLD_LIBRARY_PATH"},
 	"freebsd": {"LD_LIBRARY_PATH"},
 	"hpux":    {"LD_LIBRARY_PATH", "SHLIB_PATH"},
-	"irix":    {"LD_LIBRARY_PATH", "LD_LIBRARYN32_PATH", "LD_LIBRARY64_PATH"},
 	"linux":   {"LD_LIBRARY_PATH"},
 	"openbsd": {"LD_LIBRARY_PATH"},
 	"solaris": {"LD_LIBRARY_PATH", "LD_LIBRARY_PATH_32", "LD_LIBRARY_PATH_64"},
diff --git a/libgo/go/syscall/socket_irix.go b/libgo/go/syscall/socket_irix.go
deleted file mode 100644
--- a/libgo/go/syscall/socket_irix.go
+++ /dev/null
@@ -1,130 +0,0 @@ 
-// socket_irix.go -- Socket handling specific to IRIX 6.
-
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package syscall
-
-const SizeofSockaddrInet4 = 16
-const SizeofSockaddrInet6 = 28
-const SizeofSockaddrUnix = 110
-
-type RawSockaddrInet4 struct {
-	Family uint16
-	Port   uint16
-	Addr   [4]byte /* in_addr */
-	Zero   [8]uint8
-}
-
-func (sa *RawSockaddrInet4) setLen() Socklen_t {
-	return SizeofSockaddrInet4
-}
-
-type RawSockaddrInet6 struct {
-	Family   uint16
-	Port     uint16
-	Flowinfo uint32
-	Addr     [16]byte /* in6_addr */
-	Scope_id uint32
-}
-
-func (sa *RawSockaddrInet6) setLen() Socklen_t {
-	return SizeofSockaddrInet6
-}
-
-type RawSockaddrUnix struct {
-	Family uint16
-	Path   [108]int8
-}
-
-func (sa *RawSockaddrUnix) setLen(int) {
-}
-
-func (sa *RawSockaddrUnix) getLen() (int, error) {
-	if sa.Path[0] == 0 {
-		// "Abstract" Unix domain socket.
-		// Rewrite leading NUL as @ for textual display.
-		// (This is the standard convention.)
-		// Not friendly to overwrite in place,
-		// but the callers below don't care.
-		sa.Path[0] = '@'
-	}
-
-	// Assume path ends at NUL.
-	// This is not technically the GNU/Linux semantics for
-	// abstract Unix domain sockets--they are supposed
-	// to be uninterpreted fixed-size binary blobs--but
-	// everyone uses this convention.
-	n := 0
-	for n < len(sa.Path)-3 && sa.Path[n] != 0 {
-		n++
-	}
-
-	return n, nil
-}
-
-type RawSockaddr struct {
-	Family uint16
-	Data   [14]int8
-}
-
-// BindToDevice binds the socket associated with fd to device.
-func BindToDevice(fd int, device string) (err error) {
-	return ENOSYS
-}
-
-// <netdb.h> only provides struct addrinfo, AI_* and EAI_* if  _NO_XOPEN4
-// && _NO_XOPEN5, but -D_XOPEN_SOURCE=500 is required for msg_control etc.
-// in struct msghgr, so simply provide them here.
-type Addrinfo struct {
-	Ai_flags     int32
-	Ai_family    int32
-	Ai_socktype  int32
-	Ai_protocol  int32
-	Ai_addrlen   int32
-	Ai_canonname *uint8
-	Ai_addr      *_sockaddr
-	Ai_next      *Addrinfo
-}
-
-const (
-	AI_PASSIVE     = 0x00000001
-	AI_CANONNAME   = 0x00000002
-	AI_NUMERICHOST = 0x00000004
-	AI_NUMERICSERV = 0x00000008
-	AI_ALL         = 0x00000100
-	AI_ADDRCONFIG  = 0x00000400
-	AI_V4MAPPED    = 0x00000800
-	AI_DEFAULT     = (AI_V4MAPPED | AI_ADDRCONFIG)
-)
-
-const (
-	EAI_ADDRFAMILY = 1
-	EAI_AGAIN      = 2
-	EAI_BADFLAGS   = 3
-	EAI_FAIL       = 4
-	EAI_FAMILY     = 5
-	EAI_MEMORY     = 6
-	EAI_NODATA     = 7
-	EAI_NONAME     = 8
-	EAI_SERVICE    = 9
-	EAI_SOCKTYPE   = 10
-	EAI_SYSTEM     = 11
-	EAI_BADHINTS   = 12
-	EAI_OVERFLOW   = 13
-	EAI_MAX        = 14
-)
-
-func anyToSockaddrOS(rsa *RawSockaddrAny) (Sockaddr, error) {
-	return nil, EAFNOSUPPORT
-}
-
-// <netinet/in.h.h> only provides IPV6_* etc. if  _NO_XOPEN4 && _NO_XOPEN5,
-// so as above simply provide them here.
-const (
-	IPV6_UNICAST_HOPS   = 48
-	IPV6_MULTICAST_IF   = IP_MULTICAST_IF
-	IPV6_MULTICAST_HOPS = IP_MULTICAST_TTL
-	IPV6_MULTICAST_LOOP = IP_MULTICAST_LOOP
-)
diff --git a/libgo/go/time/zoneinfo_unix.go b/libgo/go/time/zoneinfo_unix.go
--- a/libgo/go/time/zoneinfo_unix.go
+++ b/libgo/go/time/zoneinfo_unix.go
@@ -23,11 +23,10 @@  func initTestingZone() {
 }
 
 // Many systems use /usr/share/zoneinfo, Solaris 2 has
-// /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ.
+// /usr/share/lib/zoneinfo.
 var zoneDirs = []string{
 	"/usr/share/zoneinfo/",
 	"/usr/share/lib/zoneinfo/",
-	"/usr/lib/locale/TZ/",
 	runtime.GOROOT() + "/lib/time/zoneinfo/",
 }
 
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -30,15 +30,6 @@  cat > sysinfo.c <<EOF
 #include <errno.h>
 #include <fcntl.h>
 #include <netinet/in.h>
-/* <netinet/tcp.h> needs u_char/u_short, but <sys/bsd_types> is only
-   included by <netinet/in.h> if _SGIAPI (i.e. _SGI_SOURCE
-   && !_XOPEN_SOURCE.
-   <sys/termios.h> only defines TIOCNOTTY if !_XOPEN_SOURCE, while
-   <sys/ttold.h> does so unconditionally.  */
-#ifdef __sgi__
-#include <sys/bsd_types.h>
-#include <sys/ttold.h>
-#endif
 #include <netinet/tcp.h>
 #include <signal.h>
 #include <sys/ioctl.h>
@@ -375,17 +366,12 @@  echo $timeval | \
       -e 's/tv_sec *[a-zA-Z0-9_]*/Sec Timeval_sec_t/' \
       -e 's/tv_usec *[a-zA-Z0-9_]*/Usec Timeval_usec_t/' >> ${OUT}
 timespec=`grep '^type _timespec ' gen-sysinfo.go || true`
-if test "$timespec" = ""; then
-  # IRIX 6.5 has __timespec instead.
-  timespec=`grep '^type ___timespec ' gen-sysinfo.go || true`
-fi
 timespec_sec=`echo $timespec | sed -n -e 's/^.*tv_sec \([^ ]*\);.*$/\1/p'`
 timespec_nsec=`echo $timespec | sed -n -e 's/^.*tv_nsec \([^ ]*\);.*$/\1/p'`
 echo "type Timespec_sec_t $timespec_sec" >> ${OUT}
 echo "type Timespec_nsec_t $timespec_nsec" >> ${OUT}
 echo $timespec | \
-  sed -e 's/^type ___timespec /type Timespec /' \
-      -e 's/^type _timespec /type Timespec /' \
+  sed -e 's/^type _timespec /type Timespec /' \
       -e 's/tv_sec *[a-zA-Z0-9_]*/Sec Timespec_sec_t/' \
       -e 's/tv_nsec *[a-zA-Z0-9_]*/Nsec Timespec_nsec_t/' >> ${OUT}