This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgo patch committed: Solaris portability patches
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Cc: ro at TechFak dot Uni-Bielefeld dot DE
- Date: Mon, 11 Feb 2013 11:03:06 -0800
- Subject: libgo patch committed: Solaris portability patches
This patch from Rainer Orth in PR 56171 fixes some Solaris portability
problems in libgo.
* Check for nanosleep in -lrt.
* Pass $(LIBS) when testing so that the tests use -lrt as needed.
* Make sure that AF_LOCAL is defined.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
diff -r 4466c8235d4a libgo/Makefile.am
--- a/libgo/Makefile.am Sat Feb 09 21:58:14 2013 -0800
+++ b/libgo/Makefile.am Mon Feb 11 10:56:06 2013 -0800
@@ -1997,7 +1997,7 @@
CHECK = \
GC="$(GOC) $(GOCFLAGS) $($(subst /,_,$@)_GOCFLAGS) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \
export GC; \
- GOLIBS="$(MATH_LIBS) $(NET_LIBS)"; \
+ GOLIBS="$(MATH_LIBS) $(NET_LIBS) $(LIBS)"; \
export GOLIBS; \
RUNTESTFLAGS="$(RUNTESTFLAGS)"; \
export RUNTESTFLAGS; \
diff -r 4466c8235d4a libgo/configure.ac
--- a/libgo/configure.ac Sat Feb 09 21:58:14 2013 -0800
+++ b/libgo/configure.ac Mon Feb 11 10:56:06 2013 -0800
@@ -413,8 +413,9 @@
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
-dnl Test if -lrt is required for sched_yield.
+dnl Test if -lrt is required for sched_yield and/or nanosleep.
AC_SEARCH_LIBS([sched_yield], [rt])
+AC_SEARCH_LIBS([nanosleep], [rt])
AC_C_BIGENDIAN
diff -r 4466c8235d4a libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh Sat Feb 09 21:58:14 2013 -0800
+++ b/libgo/mksysinfo.sh Mon Feb 11 10:56:06 2013 -0800
@@ -309,6 +309,13 @@
fi
done
+# The syscall package requires AF_LOCAL.
+if ! grep '^const AF_LOCAL ' ${OUT} >/dev/null 2>&1; then
+ if grep '^const AF_UNIX ' ${OUT} >/dev/null 2>&1; then
+ echo "const AF_LOCAL = AF_UNIX" >> ${OUT}
+ fi
+fi
+
# pathconf constants.
grep '^const __PC' gen-sysinfo.go |
sed -e 's/^\(const \)__\(PC[^= ]*\)\(.*\)$/\1\2 = __\2/' >> ${OUT}