From patchwork Fri Feb 1 22:46:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 1035254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-495164-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=golang.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZkzLljSK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=golang-org.20150623.gappssmtp.com header.i=@golang-org.20150623.gappssmtp.com header.b="X4iWFNbD"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43rsg63jKxz9s4Z for ; Sat, 2 Feb 2019 09:47:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=RPlCQ5UiMwQzEhqQ7u3BDuFJs5CYmUNfc/amG+IRa7WXHS 76Hccp81QSn8EIgpIsRvKZxwmgKHuqYv3Ig6619O6fRkxncSnx1iuEAWVAlBrjWa KKINDZmjFWyBEJO+/nJJLeejkpjAv82xq3Sd3BVfAJd9RU9Ctpt/FQK3AlyTM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=j5R74iIdtiTN8P6zFx1gG0YVrxw=; b=ZkzLljSK+LH0l9ehwALB h0/V5SCfz7Ctvhp5QJQdJ52fOCD41TQOH21u/Fi4N7sUQIvw7lxCp6pt97Xyf9bq st8gIEYTpibv4USd7MqYPUr2dD8xGdbUlciJAPL3lc3PFOCHshOI5pE42R2jWwpX MyaYx2RaClovFsqqFS9LSsk= Received: (qmail 60081 invoked by alias); 1 Feb 2019 22:47:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 60046 invoked by uid 89); 1 Feb 2019 22:47:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Virtual, HX-Gm-Message-State:AJcUukf, died X-HELO: mail-lj1-f171.google.com Received: from mail-lj1-f171.google.com (HELO mail-lj1-f171.google.com) (209.85.208.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Feb 2019 22:47:00 +0000 Received: by mail-lj1-f171.google.com with SMTP id u89-v6so7217483lje.1 for ; Fri, 01 Feb 2019 14:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golang-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=9f7ElP/1dxuFynh5c88tN/LsWEMKSl+r+IyIk8P1hxc=; b=X4iWFNbDjbUzD509BVP3jvDvWWh9pl+jVObqR89Aahq/zvJUzDdeyjYm3OhQ5rXzz+ jCT+riDCtde+SQPlKy++iOHgN+rmXvt8S93EPyUlGm/+uspbhgf8nBq/JVmPVgHwFP67 q4h0mWaxz0swjsG65+XA8hAEStwfoPkl7ntHaJaJi7B0RBKhhODay3SgLjfDzGMzp/eH uhTcJB7ysTc29lMd9oSG3QjvwxtvP4tXu2GnRbW6t4cMDsaJYpY6smNBF0cMBsFV/f1+ fSMSqrjgnA6iziDNemuhwj3iKqJvFyQm0P4UfLkI1IrDid+yHh0Asa3MoUbT/tjfDkeY ocVw== MIME-Version: 1.0 From: Ian Lance Taylor Date: Fri, 1 Feb 2019 14:46:46 -0800 Message-ID: Subject: libgo patch committed: Hurd configury To: gcc-patches , gofrontend-dev This libgo patch by Svante Signell adds Hurd configury support, and also sysinfo/sigtab support. On Hurd systems it expects a file that will be added in a later patch. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 268460) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -87dd981901c645a7d54a52c5f4c35caec31a8978 +51fb93fd71b8a0a690455dfdd3d12b2aa0171f5c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/Makefile.am =================================================================== --- libgo/Makefile.am (revision 268458) +++ libgo/Makefile.am (working copy) @@ -428,10 +428,14 @@ else if LIBGO_IS_AIX runtime_getncpu_file = runtime/getncpu-aix.c else +if LIBGO_IS_HURD +runtime_getncpu_file = runtime/getncpu-hurd.c +else runtime_getncpu_file = runtime/getncpu-none.c endif endif endif +endif endif endif endif Index: libgo/configure.ac =================================================================== --- libgo/configure.ac (revision 268458) +++ libgo/configure.ac (working copy) @@ -165,6 +165,7 @@ is_dragonfly=no is_rtems=no is_solaris=no is_aix=no +is_hurd=no GOOS=unknown case ${host} in *-*-darwin*) is_darwin=yes; GOOS=darwin ;; @@ -177,6 +178,7 @@ case ${host} in *-*-rtems*) is_rtems=yes; GOOS=rtems ;; *-*-solaris2*) is_solaris=yes; GOOS=solaris ;; *-*-aix*) is_aix=yes; GOOS=aix ;; + *-*-gnu*) is_hurd=yes; GOOS=hurd ;; esac AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes) AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes) @@ -188,6 +190,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_HURD, test $is_hurd = 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) Index: libgo/mksigtab.sh =================================================================== --- libgo/mksigtab.sh (revision 268369) +++ libgo/mksigtab.sh (working copy) @@ -91,6 +91,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 +113,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: libgo/mksysinfo.sh =================================================================== --- libgo/mksysinfo.sh (revision 268369) +++ libgo/mksysinfo.sh (working copy) @@ -55,9 +55,13 @@ 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 | \ +egrep '#define E[A-Z0-9_]+ [0-9E]' 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} + # The O_xxx flags. egrep '^const _(O|F|FD)_' gen-sysinfo.go | \ sed -e 's/^\(const \)_\([^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} @@ -130,6 +134,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} @@ -475,6 +484,13 @@ grep '^type _st_timespec ' gen-sysinfo.g -e 's/tv_sec/Sec/' \ -e 's/tv_nsec/Nsec/' >> ${OUT} +# Special treatment of struct stat st_dev for GNU/Hurd +# /usr/include/i386-gnu/bits/stat.h: #define st_dev st_fsid +fsid_to_dev= +if grep 'define st_dev st_fsid' gen-sysinfo.go > /dev/null 2>&1; then + fsid_to_dev="-e 's/st_fsid/Dev/'" +fi + # The stat type. # Prefer largefile variant if available. stat=`grep '^type _stat64 ' gen-sysinfo.go || true` @@ -485,6 +501,7 @@ else fi | sed -e 's/type _stat64/type Stat_t/' \ -e 's/type _stat/type Stat_t/' \ -e 's/st_dev/Dev/' \ + ${fsid_to_dev} \ -e 's/st_ino/Ino/g' \ -e 's/st_nlink/Nlink/' \ -e 's/st_mode/Mode/' \