gcc-snapshot 1:20180425-1: Updated patch for Hurd gccgo
Hello,
The recent gcc-snapshot 1:20180425-1 in sid FTBFS on GNU/Hurd due to
that one patch does not apply correctly. The problem was a comment line
in src/libgo/configure.ac was removed. The attached updated patch,
src_libgo_build.diff, fixes this problem.
Thanks!
Index: gcc-snapshot-20180425/src/libgo/configure.ac
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/configure.ac
+++ gcc-snapshot-20180425/src/libgo/configure.ac
@@ -154,7 +154,7 @@ AC_SUBST(go_include)
# All known GOOS values. This is the union of all operating systems
# supported by the gofrontend and all operating systems supported by
# the gc toolchain.
-ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows"
+ALLGOOS="aix android darwin dragonfly freebsd irix gnu linux netbsd openbsd plan9 rtems solaris windows"
is_darwin=no
is_freebsd=no
@@ -166,6 +166,7 @@ is_dragonfly=no
is_rtems=no
is_solaris=no
is_aix=no
+is_gnu=no
GOOS=unknown
case ${host} in
*-*-darwin*) is_darwin=yes; GOOS=darwin ;;
@@ -178,6 +179,7 @@ case ${host} in
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
*-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
*-*-aix*) is_aix=yes; GOOS=aix ;;
+ *-*-gnu*) is_gnu=yes; GOOS=gnu ;;
esac
AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)
AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
@@ -189,6 +191,7 @@ AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test
AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
AM_CONDITIONAL(LIBGO_IS_AIX, test $is_aix = yes)
+AM_CONDITIONAL(LIBGO_IS_GNU, test $is_gnu = yes)
AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes)
AC_SUBST(GOOS)
AC_SUBST(ALLGOOS)
@@ -798,6 +801,13 @@ main ()
CFLAGS="$CFLAGS_hold"
LIBS="$LIBS_hold"
])
+case ${host} in
+ *-*-gnu*)
+ LIBS="$LIBS -lpthread"
+ AC_SUBST(LIBS)
+ ;;
+esac
+
if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then
AC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,
[Define if setcontext clobbers TLS variables])
Index: gcc-snapshot-20180425/src/libgo/Makefile.am
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/Makefile.am
+++ gcc-snapshot-20180425/src/libgo/Makefile.am
@@ -429,10 +429,14 @@ else
if LIBGO_IS_AIX
runtime_getncpu_file = runtime/getncpu-aix.c
else
+if LIBGO_IS_GNU
+runtime_getncpu_file = runtime/getncpu-gnu.c
+else
runtime_getncpu_file = runtime/getncpu-none.c
endif
endif
endif
+endif
endif
endif
endif
Index: gcc-snapshot-20180425/src/libgo/Makefile.in
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/Makefile.in
+++ gcc-snapshot-20180425/src/libgo/Makefile.in
@@ -186,7 +186,8 @@ am__DEPENDENCIES_4 = $(am__DEPENDENCIES_
$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3)
libgo_llgo_la_DEPENDENCIES = $(am__DEPENDENCIES_4)
@LIBGO_IS_RTEMS_TRUE@am__objects_1 = rtems-task-variable-add.lo
-@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-none.lo
+@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-none.lo
+@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-gnu.lo
@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-aix.lo
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_2 = getncpu-bsd.lo
@@ -762,7 +763,8 @@ noinst_DATA = golang_org/x/net/internal/
zstdpkglist.go zdefaultcc.go
@LIBGO_IS_RTEMS_FALSE@rtems_task_variable_add_file =
@LIBGO_IS_RTEMS_TRUE@rtems_task_variable_add_file = runtime/rtems-task-variable-add.c
-@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-none.c
+@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-none.c
+@LIBGO_IS_AIX_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-gnu.c
@LIBGO_IS_AIX_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-aix.c
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_TRUE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_SOLARIS_FALSE@runtime_getncpu_file = runtime/getncpu-bsd.c
@@ -1561,6 +1563,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env_posix.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-aix.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-bsd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-gnu.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-irix.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-linux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getncpu-none.Plo@am__quote@
@@ -1925,6 +1928,13 @@ getncpu-none.lo: runtime/getncpu-none.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getncpu-none.lo `test -f 'runtime/getncpu-none.c' || echo '$(srcdir)/'`runtime/getncpu-none.c
+getncpu-gnu.lo: runtime/getncpu-gnu.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getncpu-gnu.lo -MD -MP -MF $(DEPDIR)/getncpu-gnu.Tpo -c -o getncpu-gnu.lo `test -f 'runtime/getncpu-gnu.c' || echo '$(srcdir)/'`runtime/getncpu-gnu.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/getncpu-gnu.Tpo $(DEPDIR)/getncpu-gnu.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime/getncpu-gnu.c' object='getncpu-gnu.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getncpu-gnu.lo `test -f 'runtime/getncpu-gnu.c' || echo '$(srcdir)/'`runtime/getncpu-gnu.c
+
getncpu-aix.lo: runtime/getncpu-aix.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getncpu-aix.lo -MD -MP -MF $(DEPDIR)/getncpu-aix.Tpo -c -o getncpu-aix.lo `test -f 'runtime/getncpu-aix.c' || echo '$(srcdir)/'`runtime/getncpu-aix.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/getncpu-aix.Tpo $(DEPDIR)/getncpu-aix.Plo
Index: gcc-snapshot-20180425/src/libgo/match.sh
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/match.sh
+++ gcc-snapshot-20180425/src/libgo/match.sh
@@ -113,7 +113,7 @@ for f in $gofiles; do
"") ;;
$goarch) ;;
$goos) ;;
- aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
+ aix | android | darwin | dragonfly | freebsd | gnu | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
tag1=nonmatchingtag
;;
386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
@@ -125,7 +125,7 @@ for f in $gofiles; do
"") ;;
$goarch) ;;
$goos) ;;
- aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
+ aix | android | darwin | dragonfly | freebsd | gnu | linux | nacl | netbsd | openbsd | plan9 | solaris | windows)
tag2=nonmatchingtag
;;
386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64)
Index: gcc-snapshot-20180425/src/libgo/mksigtab.sh
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/mksigtab.sh
+++ gcc-snapshot-20180425/src/libgo/mksigtab.sh
@@ -43,7 +43,13 @@ addsig _SIGINT '{_SigNotify + _SigKi
addsig _SIGQUIT '{_SigNotify + _SigThrow, "SIGQUIT: quit"}'
addsig _SIGILL '{_SigThrow + _SigUnblock, "SIGILL: illegal instruction"}'
addsig _SIGTRAP '{_SigThrow + _SigUnblock, "SIGTRAP: trace trap"}'
+# Special treatment of SIGABRT for GNU/Hurd
+# /usr/include/i386-gnu/bits/signum.h: #define SIGABRT SIGIOT
+if egrep 'define SIGABRT SIGIOT' gen-sysinfo.go > /dev/null 2>&1; then
+addsig _SIGIOT '{_SigNotify + _SigThrow, "SIGIOT: abort"}'
+else
addsig _SIGABRT '{_SigNotify + _SigThrow, "SIGABRT: abort"}'
+fi
addsig _SIGBUS '{_SigPanic + _SigUnblock, "SIGBUS: bus error"}'
addsig _SIGFPE '{_SigPanic + _SigUnblock, "SIGFPE: floating-point exception"}'
addsig _SIGKILL '{0, "SIGKILL: kill"}'
@@ -91,6 +97,7 @@ checksig _SIGCANCEL '{_SigSetStack + _S
checksig _SIGXRES '{_SigNotify, "SIGXRES: resource control exceeded"}'
checksig _SIGJVM1 '{_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"}'
checksig _SIGJVM2 '{_SigNotify, "SIGJVM2: reserved signal for Java Virtual Machine"}'
+checksig _SIGLOST ' {_SigNotify, "SIGLOST: resource lost (Sun); server died (GNU)"}'
# Special handling of signals 32 and 33 on GNU/Linux systems,
# because they are special to glibc.
@@ -112,6 +119,11 @@ else
rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
if test -n "$rtmax"; then
nsig=`expr $rtmax + 1`
+ elif grep 'const _*SIGRTMAX = [ (]*_*SIGRTMIN[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+ rtmin=`grep 'const _*SIGRTMIN = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+ if test -n "$rtmin"; then
+ nsig=`expr $rtmin + 1`
+ fi
fi
fi
fi
Index: gcc-snapshot-20180425/src/libgo/mksysinfo.sh
===================================================================
--- gcc-snapshot-20180425.orig/src/libgo/mksysinfo.sh
+++ gcc-snapshot-20180425/src/libgo/mksysinfo.sh
@@ -54,8 +54,33 @@ grep '^type _mld_hdr_t ' gen-sysinfo.go
sed -e 's/_in6_addr/[16]byte/' >> ${OUT}
# The errno constants. These get type Errno.
- egrep '#define E[A-Z0-9_]+ ' errno.i | \
- sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT}
+# egrep '#define E[A-Z0-9_]+ ' errno.i | \
+# sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT}
+
+egrep '#define E[A-Z0-9_]+ [0-9]' errno.i | \
+ sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT}
+# Workaround for GNU/Hurd _EMIG_* errors having negative values
+egrep '#define E[A-Z0-9_]+ -[0-9]' errno.i | \
+ sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(-_\1)/' >> ${OUT}
+
+# Special treatment of EWOULDBLOCK for GNU/Hurd
+# /usr/include/i386-gnu/bits/errno.h: #define EWOULDBLOCK EAGAIN
+if egrep '^const _EWOULDBLOCK = _EAGAIN' gen-sysinfo.go > /dev/null 2>&1; then
+ if egrep '^const EAGAIN = Errno\(_EAGAIN\)' ${OUT}; then
+ echo 'const EWOULDBLOCK = Errno(_EAGAIN)' >> ${OUT}
+ fi
+fi
+
+# Special treatment of _NSIG for GNU/Hurd
+# /usr/include/i386-gnu/bits/signum-generic.h:
+#define __SIGRTMIN 32
+#define __SIGRTMAX __SIGRTMIN
+#define _NSIG (__SIGRTMAX + 1)
+# Brute force method (mksigtab.sh bug):
+#if egrep '^const ___SIGRTMAX = ___SIGRTMIN' gen-sysinfo.go > /dev/null 2>&1; then
+# egrep '^const ___SIGRTMIN = 32' gen-sysinfo.go > /dev/null 2>&1 | \
+# echo "const __SIGRTMAX = 32" >> gen-sysinfo.go
+#fi
# The O_xxx flags.
egrep '^const _(O|F|FD)_' gen-sysinfo.go | \
@@ -124,6 +149,11 @@ grep '^const _SYS_' gen-sysinfo.go | \
echo "const $sup = _$sys" >> ${OUT}
done
+# Special treatment of SYS_IOCTL for GNU/Hurd
+if ! grep '^const SYS_IOCTL' ${OUT} > /dev/null 2>&1; then
+ echo "const SYS_IOCTL = 0" >> ${OUT}
+fi
+
# The GNU/Linux support wants to use SYS_GETDENTS64 if available.
if ! grep '^const SYS_GETDENTS ' ${OUT} >/dev/null 2>&1; then
echo "const SYS_GETDENTS = 0" >> ${OUT}
@@ -451,6 +481,11 @@ grep '^type _st_timespec ' gen-sysinfo.g
# The stat type.
# Prefer largefile variant if available.
+# Special treatment of st_dev for GNU/Hurd
+# /usr/include/i386-gnu/bits/stat.h: #define st_dev st_fsid
+if grep 'define st_dev st_fsid' gen-sysinfo.go > /dev/null 2>&1; then
+ sed -i -e 's/; st_fsid/; st_dev/' gen-sysinfo.go
+fi
stat=`grep '^type _stat64 ' gen-sysinfo.go || true`
if test "$stat" != ""; then
grep '^type _stat64 ' gen-sysinfo.go
Reply to: