Alpha's <asm/unistd.h> defines __NR_getpid as __NR_getxpid before
including the header that defines __NR_getxpid.  -fdump-go-spec cannot
resolve the forward reference, so SYS_GETPID is missing and the
syscall tests fail to build:

  syscall_linux_test.go:631:66: error: reference to undefined identifier 
'syscall.SYS_GETPID'

Define it from SYS_GETXPID, as is done for SIGCLD.
---
 libgo/mksysinfo.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git ./libgo/mksysinfo.sh ./libgo/mksysinfo.sh
index ea1fa17d418..0b32b569b86 100755
--- ./libgo/mksysinfo.sh
+++ ./libgo/mksysinfo.sh
@@ -153,6 +153,14 @@ if ! grep '^const SYS_GETEUID ' ${OUT} >/dev/null 2>&1; 
then
   echo "const SYS_GETEUID = 0" >> ${OUT}
 fi
 
+# Alpha's asm/unistd.h defines __NR_getpid as __NR_getxpid before
+# __NR_getxpid itself, which -fdump-go-spec cannot resolve.
+if ! grep '^const SYS_GETPID ' ${OUT} >/dev/null 2>&1; then
+  if grep '^const SYS_GETXPID ' ${OUT} >/dev/null 2>&1; then
+    echo "const SYS_GETPID = SYS_GETXPID" >> ${OUT}
+  fi
+fi
+
 # Stat constants.
 grep '^const _S_' gen-sysinfo.go | \
   sed -e 's/^\(const \)_\(S_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
-- 
2.54.0

Reply via email to