From patchwork Fri Jan 19 05:10:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 863324 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-471633-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FIwhD0Ah"; 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 3zN88d4wfLz9s74 for ; Fri, 19 Jan 2018 16:12:33 +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=SeKJGu+xBDnpmL/jPH9PH0Wqw2eYRNXptcpzvrgwp3t6Ik ff6BPoMGbZLceo3/SQKitJm7Devb6oOYOVpzNfF+EIWlS2R747mRZMq87bS3a+GQ YBjYaLe6kyGKB3q00fe+XFcw1+qDKtMo7DWOowXh9wXeWyAcwHumRj3ZWv9ZA= 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=uMexBjnQbIMmE10h9+be899v3a4=; b=FIwhD0AhCOn33U/KFJFy cGbdbBbkZ2oHSZWysANApFi4YWwxmL09F8txAHEa6UZB6s6QqVzs5XsOxneGoFPD UyFb5/kmaUyPPW2qVFZ1XfPqVBta9R023uAARxbWQlPjNRemjtz//okP1cppktlU F6B7INX1OT5xzMRqYFFoQ5s= Received: (qmail 21995 invoked by alias); 19 Jan 2018 05:11:54 -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 21028 invoked by uid 89); 19 Jan 2018 05:10:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2819 X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jan 2018 05:10:51 +0000 Received: by mail-wm0-f47.google.com with SMTP id v123so1038956wmd.5 for ; Thu, 18 Jan 2018 21:10:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MvsugpWz6OvGtZ7j3if7m+HDkYlPcR9NZpMVYMni3yI=; b=AVFbSBkWxP551HQzNyWATWfmxVziKIBz29HWeSBMcZ8dL7wKbPt3cGDUzv6vS0aV2m b59ss4IREUK4BwLa8I+kB2o07ZBTjcNgVHI3//q8o8xEA+6ktXH4r0Y9PzHl0Au5yiP5 6bnH6POeUzIX0EQHDhgOBnUpdusi8fsA6ZC9xufLI8+1MsnVrz31th9Rzv1pEYDdHQcl Uugqa+Zlt1paHjSy1lzDMrjc587APX176bEZjNYSX7GEavCrojmrZU6G14CdYsExnVIp 14gs/3TzZNsl30O2L8JyOCmClHD37Nu+lUPL8WDOkrIybk+QT07lyR9fFeAgZFM2Bf3Z hWLQ== X-Gm-Message-State: AKwxytdBdFFS7UbZqUJ2SnWOHUC7x/muVEkHXMhNsmfvYoLKwsw5v60h ieSLjmAFWJo2poHL8xSN4QJbsF/FRgHSHwacV2fEl9uQ X-Google-Smtp-Source: ACJfBouSCY8/UQcwjKZIujEYwjbHsKT/9u4kgMcjbyXsk6eByuxs8xY6oc16e8zq8JX+q389hkWT7liWwQtmXj5M5/g= X-Received: by 10.80.181.93 with SMTP id z29mr11060649edd.223.1516338648730; Thu, 18 Jan 2018 21:10:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.179.219 with HTTP; Thu, 18 Jan 2018 21:10:48 -0800 (PST) From: Ian Lance Taylor Date: Thu, 18 Jan 2018 21:10:48 -0800 Message-ID: Subject: libgo patch committed: Use rlimit64 when we use getrlimit64 To: gcc-patches , gofrontend-dev@googlegroups.com This libgo patch changes the syscall package to use the rlimit64 type, if available, when we use getrlimit64. This makes no difference on most systems, because renames the type appropriately anyhow, but apparently it makes a difference on AIX. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu, and got a confirmation that this fixes the problem on AIX. Committed to mainline. Ian Index: gcc/go/gofrontend/MERGE =================================================================== --- gcc/go/gofrontend/MERGE (revision 256875) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -bce8720d4eb662f31026e9c7be6ce4d0aeb4ae3b +87525458bcd5ab4beb5b95e7d58e3dfdbc1bd478 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 256794) +++ libgo/Makefile.am (working copy) @@ -674,7 +674,7 @@ s-errno: sysinfo.go: s-sysinfo; @true s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i - GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh + GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go $(STAMP) $@ Index: libgo/mksysinfo.sh =================================================================== --- libgo/mksysinfo.sh (revision 256875) +++ libgo/mksysinfo.sh (working copy) @@ -1120,8 +1120,16 @@ if test "$timex" != ""; then fi # The rlimit struct. -grep '^type _rlimit ' gen-sysinfo.go | \ - sed -e 's/_rlimit/Rlimit/' \ +# On systems that use syscall/libcall_posix_largefile.go, use rlimit64 +# if it exists. +rlimit="_rlimit" +if test "${GOOS}" = "aix" || test "${GOOS}" = "linux" || (test "${GOOS}" = "solaris" && (test "${GOARCH}" = "386" || test "${GOARCH}" = "sparc")); then + if grep '^type _rlimit64 ' gen-sysinfo.go > /dev/null 2>&1; then + rlimit="_rlimit64" + fi +fi +grep "^type ${rlimit} " gen-sysinfo.go | \ + sed -e "s/${rlimit}/Rlimit/" \ -e 's/rlim_cur/Cur/' \ -e 's/rlim_max/Max/' \ >> ${OUT} @@ -1130,7 +1138,13 @@ grep '^type _rlimit ' gen-sysinfo.go | \ grep '^const _RLIMIT_' gen-sysinfo.go | sed -e 's/^\(const \)_\(RLIMIT_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} grep '^const _RLIM_' gen-sysinfo.go | + grep -v '^const _RLIM_INFINITY ' | sed -e 's/^\(const \)_\(RLIM_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +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; then + echo 'const RLIM_INFINITY = _RLIM_INFINITY' >> ${OUT} +fi # The sysinfo struct. grep '^type _sysinfo ' gen-sysinfo.go | \