From patchwork Tue Aug 21 05:29:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 178965 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]) by ozlabs.org (Postfix) with SMTP id 7C2352C0099 for ; Tue, 21 Aug 2012 15:30:16 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1346131816; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=EWg4r75YJUNK629cUuwn+NbSETg=; b=vforwYExwVzZXpY WvdwSl7S1P+P3M54rWl7WWLmFLoZFHeKs1pdoDoRbmin8WDDUSqvOg2ybciUE59m 4uSwJ54cVqkEItbY/vVIO+ghKyR7A6ytH+nOeOy9i2XvDEu+9YptA5EyY9y3zy7v w5vBIOQbj2sgr7a+25LXg9CaWBCQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tjzObWByqaT9BZeMuRcvhC8dSrrpkKwYoL8EQoW4gbVb+z1926nPVsVO0TvHQ3 PVDY49+fPXiZ2KZYPPS8PlwenR85cLCP5S1VS3YFPj2rPVUZ+n8lvnHcRqGmArGA yHW3cfxwL88HJialP0mTcFppODWfZAbxtUShiDEtn/Qgo=; Received: (qmail 967 invoked by alias); 21 Aug 2012 05:30:04 -0000 Received: (qmail 948 invoked by uid 22791); 21 Aug 2012 05:30:03 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 05:29:50 +0000 Received: by pbcwy7 with SMTP id wy7so8275601pbc.20 for ; Mon, 20 Aug 2012 22:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=kuRWYYVqSi/mpQgl7w+8bMPvoOORuQqXXuR/yLRwcYI=; b=SfFZkvmpHJVAkAmRkT7DQlrdtV2WaeOZuYbnJWJ9wik1rM0yu3r86w7yuwSf0zlLRz phrp0C/Q145T2lpv0eu+8ojghjyhTG2Lw8EYsONErPBY5w43Ula5VLrMWsg4goNBF/3e gk6BRBv/IEBNAgnOj4ER/8yigEpoaR/6ZhXm2cKpfuNuFaMpE/mjAWhge7F+jkBxua80 oJKINQSbl+wvz1ezFFvr6D7nOSBUTxIKT856wGTlOQ+RhwuDwMzgVwpOgjWlzwRwdzn2 HQ3rakH770pqC1meY1C54grB/oz2/TJoxOCmyTgcG/LDnD0UQFQT3M0yIT3rwFoarvKE FEjA== Received: by 10.68.223.164 with SMTP id qv4mr40573633pbc.20.1345526990317; Mon, 20 Aug 2012 22:29:50 -0700 (PDT) Received: by 10.68.223.164 with SMTP id qv4mr40573602pbc.20.1345526990133; Mon, 20 Aug 2012 22:29:50 -0700 (PDT) Received: from coign.google.com ([172.26.54.164]) by mx.google.com with ESMTPS id nk3sm683925pbc.27.2012.08.20.22.29.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 22:29:49 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Define F_GETLK and friends on i386 GNU/Linux Date: Mon, 20 Aug 2012 22:29:48 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmE9RG9Xi8m1bMQnncSQln1pGlUGEj4MQs3OUWHqoEIWKl71Mjlz/ku/Sy234YkpznNloql185xSAiZsQETqPUB46so7a1UbUUC1Hbff9ju5g5HW6UIwozg/Ayxb0+xQLy6gOAiQn0v2f5k5ep39RP5xElifvYhJdGEyBsxjb+ismnJW+2jWxBMp29BygA4zlurJShl X-IsSubscribed: yes 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 On i386 GNU/Linux, when compiling with -D_FILE_OFFSET_BITS=64, winds up doing this: # define F_GETLK F_GETLK64 /* Get record locking info. */ ... # define F_GETLK64 12 /* Get record locking info. */ Because of the ordering, -fdump-go-spec does not write F_GETLK into the file that it creates. The effect is that syscall.F_GETLK is not defined for i386 GNU/Linux. This patch fixes the problem. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu, both 32-bit and 64-bit mode. Committed to mainline and 4.7 branch. Ian diff -r a602dc132c2d libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Tue Aug 14 20:46:42 2012 -0700 +++ b/libgo/mksysinfo.sh Mon Aug 20 22:10:34 2012 -0700 @@ -211,6 +211,16 @@ echo "const O_CLOEXEC = 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. +for flag in F_GETLK F_SETLK F_SETLKW; do + if ! grep "^const ${flag} " ${OUT} >/dev/null 2>&1 \ + && grep "^const ${flag}64 " ${OUT} >/dev/null 2>&1; then + echo "const ${flag} = ${flag}64" >> ${OUT} + fi +done + # The signal numbers. grep '^const _SIG[^_]' gen-sysinfo.go | \ grep -v '^const _SIGEV_' | \