On Wed, Sep 26, 2018 at 12:57 AM, Uros Bizjak <ubiz...@gmail.com> wrote:
>> I've committed a patch to update libgo to the 1.11 release.  As usual
>> for these updates, the patch is too large to attach to this e-mail
>> message.  I've attached some of the more relevant directories.  This
>> update required some minor patches to the gotools directory and the Go
>> testsuite, also included here.  Bootstrapped and ran Go testsuite on
>> x86_64-pc-linux-gnu.  Committed to mainline.
>
> Fails to build on alpha-linux-gnu:
>
> /space/homedirs/uros/gcc-svn/trunk/libgo/go/syscall/setuidgid_linux.go:11:16:
> error: reference to undefined name ‘SYS_GETEUID’
> 11 |  sys_GETEUID = SYS_GETEUID
>    |                ^
>
> This is because /usr/include/asm/unistd.h says:
>
> /*
>  * Ignore legacy syscalls that we don't use.
>  */
> #define __IGNORE_alarm
> #define __IGNORE_creat
> #define __IGNORE_getegid
> #define __IGNORE_geteuid
> #define __IGNORE_getgid
> #define __IGNORE_getpid
> #define __IGNORE_getppid
> #define __IGNORE_getuid
> #define __IGNORE_pause
> #define __IGNORE_time
> #define __IGNORE_utime
> #define __IGNORE_umount2
>
> These legacy syscalls are undefined for alpha-linux-gnu.

Thanks for the report.  This is only used for testing.  I've committed
this patch, which I think should fix the problem.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 264593)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-e7b98cf0a380eb45791cd5c52897224a686dcdec
+944784a93cf89d3a238e5607c993ea5f18f99c12
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/syscall/syscall_linux_test.go
===================================================================
--- libgo/go/syscall/syscall_linux_test.go      (revision 264546)
+++ libgo/go/syscall/syscall_linux_test.go      (working copy)
@@ -302,6 +302,10 @@ func TestSyscallNoError(t *testing.T) {
                t.Skip("skipping root only test")
        }
 
+       if syscall.Sys_GETEUID == 0 {
+               t.Skip("skipping because there is no geteuid system call")
+       }
+
        // Copy the test binary to a location that a non-root user can 
read/execute
        // after we drop privileges
        tempDir, err := ioutil.TempDir("", "TestSyscallNoError")
Index: libgo/mksysinfo.sh
===================================================================
--- libgo/mksysinfo.sh  (revision 264572)
+++ libgo/mksysinfo.sh  (working copy)
@@ -138,6 +138,12 @@ if ! grep '^const SYS_GETDENTS64 ' ${OUT
   echo "const SYS_GETDENTS64 = 0" >> ${OUT}
 fi
 
+# The syscall package wants the geteuid system call number.  It isn't
+# defined on Alpha, which only provides the getresuid system call.
+if ! grep '^const SYS_GETEUID ' ${OUT} >/dev/null 2>&1; then
+  echo "const SYS_GETEUID = 0" >> ${OUT}
+fi
+
 # Stat constants.
 grep '^const _S_' gen-sysinfo.go | \
   sed -e 's/^\(const \)_\(S_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}

Reply via email to