public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Define SO_RCVTIMEO on 32-bit GNU/Linux
@ 2020-11-30 20:17 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2020-11-30 20:17 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

This libgo patch defines SO_RCVTIMEO on 32-bit GNU/Linux.  It was not
being defined before because it is defined as a conditional expression
that is too complicated for -fdump-go-spec to handle.  This fixes
https://golang.org/issue/42872.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1769 bytes --]

e848a83f46f15280ad654f05545cc5ec4f5b8e50
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 41246030f13..e8cf468d8fc 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-45461eeba1db1a3b4194dc8ecc331c0e92f5ad4c
+be1738f1fff0e817d921ed568791f9b0585a6982
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index deac5ce8d67..b32a0266b71 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -194,6 +194,7 @@ fi
 
 # Networking constants.
 egrep '^const _(AF|ARPHRD|ETH|IN|SOCK|SOL|SO|IPPROTO|TCP|IP|IPV6)_' gen-sysinfo.go |
+  grep -v '_val =' |
   sed -e 's/^\(const \)_\([^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 grep '^const _SOMAXCONN' gen-sysinfo.go |
   sed -e 's/^\(const \)_\(SOMAXCONN[^= ]*\)\(.*\)$/\1\2 = _\2/' \
@@ -213,6 +214,14 @@ for m in SOCK_CLOEXEC SOCK_NONBLOCK; do
   fi
 done
 
+# On 32-bit GNU/Linux the expression for SO_RCVTIMEO is too complicated
+# for -fdump-go-spec.
+if ! grep '^const SO_RCVTIMEO ' ${OUT} >/dev/null 2>&1; then
+  if grep '^const _SO_RCVTIMEO_val' ${OUT} >/dev/null 2>&1; then
+    echo 'const SO_RCVTIMEO = _SO_RCVTIMEO_val' >> ${OUT}
+  fi
+fi
+
 # 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
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 7086381a14c..a060ea867a5 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -337,6 +337,9 @@ enum {
 #ifdef BIOCVERSION
   BIOCVERSION_val = BIOCVERSION,
 #endif
+#ifdef SO_RCVTIMEO
+  SO_RCVTIMEO_val = SO_RCVTIMEO,
+#endif
 };
 
 // SIOCGIFMTU can't be added in the above enum as it might

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-30 20:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 20:17 libgo patch committed: Define SO_RCVTIMEO on 32-bit GNU/Linux Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).