From patchwork Thu Nov 21 01:04:06 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: 1198622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514265-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="KCagx6Jh"; 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="E1dtAyBo"; 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 47JLtk2GH7z9sPL for ; Thu, 21 Nov 2019 12:04:28 +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=UnhdW2SmcQWKgdyAwOOfxOtBXg6PljCH2wmFWaTHURlOLo IQqzTj/1gZLT0zTnCY+1xm0OdkBArHwFbseytzpOkM0T7+a2k9PcsKwbhFOnhDsd gCp8WsGKof9+JI4E6n2hc/zhpyjCfP/rprcjGvwhkJuXMAlgA0FENgCgWMsa4= 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=HwB/mW2ldzi6SZCibN0rB7C6gbU=; b=KCagx6JhyR+a4eSalsgm 68ThNFgBP/vth9JJWI6b+Ua4UcJw6Dvlody/JfMuWeeesoufRHz2Pbw6qvzTJ42M 9g1QnjDyZja6SFm5M/oajYv2X1tur2tJrMozy0M9jal2Xf2vyEgxwDiIKDoCFsUK wSnbwbM+Y7T27gqy/2JkQZ8= Received: (qmail 55699 invoked by alias); 21 Nov 2019 01:04:22 -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 55691 invoked by uid 89); 21 Nov 2019 01:04:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:golang.org, sk:245904a, H*MI:sk:CAOyqgc, 277299 X-HELO: mail-ed1-f45.google.com Received: from mail-ed1-f45.google.com (HELO mail-ed1-f45.google.com) (209.85.208.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Nov 2019 01:04:20 +0000 Received: by mail-ed1-f45.google.com with SMTP id k14so1263626eds.4 for ; Wed, 20 Nov 2019 17:04:19 -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=iZRsLu+4mqtI0B5wmPmYahyD5K0JPKb4kEPNWSK1QXc=; b=E1dtAyBoGR+2zLbNLeav7+D5rqhX1irWFVxIQe5VqiDiAVK6n+gbZAStAEo6lSpasM fTOtHySxe9PEHftTR904GMbJkaLFbI8pnD8kWkebdbsuBnlt29xse9ZbRwr3Xk+I4MTP sNSYK4igZGRVXX6VIf4uM3BIZ8Rmp6wHn7oCNjnVX8b3mQdflVGYI+do2jbHDcbsf6Ty 1MscuUQpESPfO/IWdljXPp1oKa5Q7pMAFm7hAes6zdNRL6SEUy5LEIFxlMKgJjRVuSfh ZT0RXbFmuH5gKYjclbO2qv4b5xxGTiF5HyXz64CTyaut4E0XMvl4k6N0Ma8Qt0Hk83rZ phGg== MIME-Version: 1.0 From: Ian Lance Taylor Date: Wed, 20 Nov 2019 17:04:06 -0800 Message-ID: Subject: libgo patch committed: Use type aliases for time struct field types To: gcc-patches , gofrontend-dev This patch to the libgo mksysinfo script uses type aliases for time struct field types. It also fixes a case where grep wasn't redirecting to /dev/null. This lets some syscall package types be identical to some golang.org/x/sys/unix types, and fixes https://golang.org/issue/35713. 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 278470) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -245904ac148f15db530fb8d50f526c47d08024c5 +9cc7092b84c38d77d98ed856f1f613a6ca27122d 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 277299) +++ libgo/mksysinfo.sh (working copy) @@ -436,8 +436,8 @@ fi timeval=`grep '^type _timeval ' gen-sysinfo.go` timeval_sec=`echo $timeval | sed -n -e 's/^.*tv_sec \([^ ]*\);.*$/\1/p'` timeval_usec=`echo $timeval | sed -n -e 's/^.*tv_usec \([^ ]*\);.*$/\1/p'` -echo "type Timeval_sec_t $timeval_sec" >> ${OUT} -echo "type Timeval_usec_t $timeval_usec" >> ${OUT} +echo "type Timeval_sec_t = $timeval_sec" >> ${OUT} +echo "type Timeval_usec_t = $timeval_usec" >> ${OUT} echo $timeval | \ sed -e 's/type _timeval /type Timeval /' \ -e 's/tv_sec *[a-zA-Z0-9_]*/Sec Timeval_sec_t/' \ @@ -449,8 +449,8 @@ if test "$timespec" = ""; then fi timespec_sec=`echo $timespec | sed -n -e 's/^.*tv_sec \([^ ]*\);.*$/\1/p'` timespec_nsec=`echo $timespec | sed -n -e 's/^.*tv_nsec \([^ ]*\);.*$/\1/p'` -echo "type Timespec_sec_t $timespec_sec" >> ${OUT} -echo "type Timespec_nsec_t $timespec_nsec" >> ${OUT} +echo "type Timespec_sec_t = $timespec_sec" >> ${OUT} +echo "type Timespec_nsec_t = $timespec_nsec" >> ${OUT} echo $timespec | \ sed -e 's/^type ___timespec /type Timespec /' \ -e 's/^type _timespec /type Timespec /' \ @@ -461,8 +461,8 @@ timestruc=`grep '^type _timestruc_t ' ge if test "$timestruc" != ""; then timestruc_sec=`echo $timestruc | sed -n -e 's/^.*tv_sec \([^ ]*\);.*$/\1/p'` timestruc_nsec=`echo $timestruc | sed -n -e 's/^.*tv_nsec \([^ ]*\);.*$/\1/p'` - echo "type Timestruc_sec_t $timestruc_sec" >> ${OUT} - echo "type Timestruc_nsec_t $timestruc_nsec" >> ${OUT} + echo "type Timestruc_sec_t = $timestruc_sec" >> ${OUT} + echo "type Timestruc_nsec_t = $timestruc_nsec" >> ${OUT} echo $timestruc | \ sed -e 's/^type _timestruc_t /type Timestruc /' \ -e 's/tv_sec *[a-zA-Z0-9_]*/Sec Timestruc_sec_t/' \ @@ -1126,7 +1126,7 @@ statfs=`grep '^type _statfs64 ' gen-sysi if test "$statfs" = ""; then statfs=`grep '^type _statfs ' gen-sysinfo.go || true` fi -if ! echo "$statfs" | grep f_flags; then +if ! echo "$statfs" | grep f_flags >/dev/null 2>&1; then statfs=`echo "$statfs" | sed -e 's/f_spare \[4+1\]\([^ ;]*\)/f_flags \1; f_spare [3+1]\1/'` fi echo "$statfs" | sed -e 's/type _statfs64/type Statfs_t/' \