This libgo patch changees RLIM_INFINITY from 0xffffffffffffffff to -1 on GNU/Linux. 0xffffffffffffffff is arguably the correct value, but in the gc toolchain's syscall package the value is -1. So we are compatible. New programs should be using the golang.org/x/sys/unix package anyhow. This fixes https://golang.org/issue/28665. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to trunk and to 7 and 8 branches.
Ian
Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 265820) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -5fcfe352ad91945a4f4d0dcfb6309df9bd072c7d +da8c968474690d1e77442ac3361b2302ea8e1f36 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/mksysinfo.sh =================================================================== --- libgo/mksysinfo.sh (revision 265710) +++ libgo/mksysinfo.sh (working copy) @@ -1152,10 +1152,17 @@ grep '^const _RLIMIT_' gen-sysinfo.go | grep '^const _RLIM_' gen-sysinfo.go | grep -v '^const _RLIM_INFINITY ' | sed -e 's/^\(const \)_\(RLIM_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +rliminf="" if test "${rlimit}" = "_rlimit64" && grep '^const _RLIM64_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then - echo 'const RLIM_INFINITY = _RLIM64_INFINITY' >> ${OUT} -elif grep '^const _RLIM_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then - echo 'const RLIM_INFINITY = _RLIM_INFINITY' >> ${OUT} + rliminf=`grep '^const _RLIM64_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'` +else + rliminf=`grep '^const _RLIM_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'` +fi +# For compatibility with the gc syscall package, treat 0xffffffffffffffff as -1. +if test "$rliminf" = "0xffffffffffffffff"; then + echo "const RLIM_INFINITY = -1" >> ${OUT} +elif test -n "$rliminf"; then + echo "const RLIM_INFINITY = $rliminf" >> ${OUT} fi # The sysinfo struct.