From patchwork Fri May 16 08:03:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Svante Signell X-Patchwork-Id: 349469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 5AF7014001A for ; Fri, 16 May 2014 18:02:39 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:reply-to:to:cc:date:in-reply-to :references:content-type:mime-version; q=dns; s=default; b=m1GIR 2bsv0zbfyk7gIgsL8uIH8UzioOpwTGyiILnjFObsj8F2kxj/feA9/5Thu5C/q2KN CdEKqR7KkZkRWKhfMCyMZTNG5MMl6y5Kiq9TAmXfNM4nyI2Ry1KlL76Nv+q0txdh iLS2VMqkTnr7gE8JjTOq38uzskO/EoThvNSq4A= 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 :message-id:subject:from:reply-to:to:cc:date:in-reply-to :references:content-type:mime-version; s=default; bh=hFL/5MMn/MY 2xJ+gWJ4xDUtnzKY=; b=N66DB7TJnX+oCgTJMMxIJHbgd6gIvoAn2aOF00KdmRx gn9u/H7+mGzK+d3zo2ycZ9UMqawZogLNaIYaKI08AZVtayP5kRgTjUjmckYfdts3 bO7iMHmNP/0PWGyeFfF1+Pd0lCSlMvzDPILa5uGRVSdqcsjVk7qwZBnTG3O7B0OE = Received: (qmail 15709 invoked by alias); 16 May 2014 08:02:33 -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 15699 invoked by uid 89); 16 May 2014 08:02:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f50.google.com Received: from mail-la0-f50.google.com (HELO mail-la0-f50.google.com) (209.85.215.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 16 May 2014 08:02:30 +0000 Received: by mail-la0-f50.google.com with SMTP id b8so1681516lan.9 for ; Fri, 16 May 2014 01:02:26 -0700 (PDT) X-Received: by 10.112.12.8 with SMTP id u8mr10483798lbb.9.1400227346828; Fri, 16 May 2014 01:02:26 -0700 (PDT) Received: from [192.168.1.4] (178-78-231-178.customers.ownit.se. [178.78.231.178]) by mx.google.com with ESMTPSA id z10sm7828638lbu.1.2014.05.16.01.02.24 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Fri, 16 May 2014 01:02:24 -0700 (PDT) Message-ID: <1400227385.10012.98.camel@G3620.my.own.domain> Subject: Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate From: Svante Signell Reply-To: svante.signell@gmail.com To: Samuel Thibault Cc: Thomas Schwinge , Ian Lance Taylor , gcc-patches@gcc.gnu.org, bug-hurd@gnu.org, Roland McGrath Date: Fri, 16 May 2014 10:03:05 +0200 In-Reply-To: <1399450727.13092.106.camel@G3620.my.own.domain> References: <1399018692.8487.7.camel@PackardBell-PC> <20140502095753.GC6577@type> <20140502100027.GD6577@type> <1399027556.8487.12.camel@PackardBell-PC> <20140502105234.GM6577@type> <1399363609.13092.29.camel@G3620.my.own.domain> <20140506125157.GH5788@type.bordeaux.inria.fr> <1399381520.13092.67.camel@G3620.my.own.domain> <20140506130755.GL5788@type.bordeaux.inria.fr> <1399382738.13092.70.camel@G3620.my.own.domain> <20140506132605.GD1010@type.bordeaux.inria.fr> <1399450727.13092.106.camel@G3620.my.own.domain> Mime-Version: 1.0 On Wed, 2014-05-07 at 10:18 +0200, Svante Signell wrote: > On Tue, 2014-05-06 at 15:26 +0200, Samuel Thibault wrote: Attached is an updated patch8.diff. Arch specific code to src/libgo/mksysinfo.sh has been added, now other systems are not affected by the patch except the SYS_FCNTL part. For that part of the patch without it the build on GNU/Hurd fails. On the other hand SYS_FCNTL is not defined for e.g. GNU/Linux either. This is used in gcc-4.9-4.9.0/src/libgo/go/net/fd_unix.go: func dupCloseOnExec(fd int) (newfd int, err error) { if atomic.LoadInt32(&tryDupCloexec) == 1 && syscall.F_DUPFD_CLOEXEC!=0 { r0, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), syscall.F_DUPFD_CLOEXEC, 0) It is yet unknown how the build succeeds on Linux without the SYS_FCNTL being defined? Maybe any the conditions above are not met. --- a/src/libgo/mksysinfo.sh +++ b/src/libgo/mksysinfo.sh @@ -210,6 +210,13 @@ egrep '#define E[A-Z0-9_]+ ' | \ sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT} +# Special treatment of EWOULDBLOCK for GNU/Hurd +# /usr/include/bits/errno.h: #define EWOULDBLOCK EAGAIN +if egrep 'define EWOULDBLOCK EAGAIN' gen-sysinfo.go > /dev/null 2>&1; then + egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' ${OUT} | \ + sed -i.bak -e 's/_EWOULDBLOCK/_EAGAIN/' ${OUT} +fi + # The O_xxx flags. egrep '^const _(O|F|FD)_' gen-sysinfo.go | \ sed -e 's/^\(const \)_\([^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} @@ -225,6 +232,11 @@ echo "const F_DUPFD_CLOEXEC = 0" >> ${OUT} fi +# Special treatment of SYS_FCNTL for GNU/Hurd +if ! grep '^const SYS_FCNTL' ${OUT} > /dev/null 2>&1; then + echo "const SYS_FCNTL = 0" >> ${OUT} +fi + # These flags can be lost on i386 GNU/Linux when using # -D_FILE_OFFSET_BITS=64, because we see "#define F_SETLK F_SETLK64" # before we see the definition of F_SETLK64. @@ -528,6 +540,12 @@ # 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 + egrep '^type _stat ' gen-sysinfo.go > /dev/null 2>&1| \ + sed -i.bak -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