summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-10 21:38:30 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-10 21:38:30 +0000
commit5c55b1cf5fc3e238781256827faebd3990c565ad (patch)
treee38fc2fdc0a9b1da894862589e730173bb0f4948 /libgo
parentb408dd85568c5d0c0a9673810280a8438753b60f (diff)
downloadgcc-5c55b1cf5fc3e238781256827faebd3990c565ad.tar.gz
libgo: use Solaris sendfile lib, fix Solaris _in6_addr_t fields
Before Solaris 12 the sendfile function is found in -lsendfile, so look for it there. Solaris 12 adds some more types that use _in6_addr_t, that need to be edited in mksysinfo. Patch by Rainer Orth. Reviewed-on: https://go-review.googlesource.com/16779 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230132 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/configure40
-rw-r--r--libgo/configure.ac3
-rwxr-xr-xlibgo/mksysinfo.sh20
3 files changed, 63 insertions, 0 deletions
diff --git a/libgo/configure b/libgo/configure
index 08a197d5a61..eb37e29d2f8 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -14249,6 +14249,46 @@ fi
fi
unset ac_cv_func_gethostbyname
+ ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile"
+if test "x$ac_cv_func_sendfile" = x""yes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsendfile" >&5
+$as_echo_n "checking for main in -lsendfile... " >&6; }
+if test "${ac_cv_lib_sendfile_main+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsendfile $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_sendfile_main=yes
+else
+ ac_cv_lib_sendfile_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_main" >&5
+$as_echo "$ac_cv_lib_sendfile_main" >&6; }
+if test "x$ac_cv_lib_sendfile_main" = x""yes; then :
+ libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lsendfile"
+fi
+
+fi
+
LIBS=$libgo_old_libs
fi
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 332e540a302..6e23a85fa6d 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -473,6 +473,9 @@ AC_CACHE_CHECK([for socket libraries], libgo_cv_lib_sockets,
[AC_CHECK_LIB(nsl, main,
[libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lnsl"])])
unset ac_cv_func_gethostbyname
+ AC_CHECK_FUNC(sendfile, ,
+ [AC_CHECK_LIB(sendfile, main,
+ [libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lsendfile"])])
LIBS=$libgo_old_libs
])
NET_LIBS="$libgo_cv_lib_sockets"
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 6d39df96e95..662619f2076 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -1488,4 +1488,24 @@ grep '^type _zone_net_addr_t ' gen-sysinfo.go | \
sed -e 's/_in6_addr/[16]byte/' \
>> ${OUT}
+# The Solaris 12 _flow_arp_desc_t struct.
+grep '^type _flow_arp_desc_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr_t/[16]byte/g' \
+ >> ${OUT}
+
+# The Solaris 12 _flow_l3_desc_t struct.
+grep '^type _flow_l3_desc_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr_t/[16]byte/g' \
+ >> ${OUT}
+
+# The Solaris 12 _mac_ipaddr_t struct.
+grep '^type _mac_ipaddr_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr_t/[16]byte/g' \
+ >> ${OUT}
+
+# The Solaris 12 _mactun_info_t struct.
+grep '^type _mactun_info_t ' gen-sysinfo.go | \
+ sed -e 's/_in6_addr_t/[16]byte/g' \
+ >> ${OUT}
+
exit $?