From patchwork Mon Apr 30 17:28:12 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: 155931 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 EF139B6FA4 for ; Tue, 1 May 2012 03:28:54 +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=1336411735; 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=9CIvk6p0s7aVYIsKaIf1GRtA5vc=; b=eIJXLIPaIwPJohJ JWxdRaJMGcJfpDJeepKho8xoImYlfVh0IASLvNJ+SdeyFVql9cCd2/L0kBYSRkWr 2QVn8wXzRJOuBIavRarHtiTbo/nZf9kUdiSjk/o1TT7TTFkwaP2QNs4vGOSzV7uV sjuNQ/zFhL6OfLrw67LRe9K7Ulhg= 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=Xg5MKXZPhkjX6tHfE7FN3naPpK/jTrGeFxOY6eyqvTqUU8tiQUP7ZXtr5K/a3B BB2l7Is2uwb+Fa/etdHwPXFb6bRRZkSFeKs4OOgnDMy3p5KmPYcsrDFq4oYccRdL 6YuNpu+fyJD7E+hqtci01oYpFllbgU31RZvoABkrON2j8=; Received: (qmail 9149 invoked by alias); 30 Apr 2012 17:28:37 -0000 Received: (qmail 8965 invoked by uid 22791); 30 Apr 2012 17:28:33 -0000 X-SWARE-Spam-Status: No, hits=-4.4 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, T_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; Mon, 30 Apr 2012 17:28:15 +0000 Received: by pbbrq2 with SMTP id rq2so3706513pbb.20 for ; Mon, 30 Apr 2012 10:28:15 -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=zn89qy9hFP75dbYtXS/b4iaZ9561bg6/hOeGzLbtfvo=; b=Q/74ztJ8VZmo+JItx3Prkf36wIeUOWSeiGXijY+td7hCNRVCsu6Vklwr43xhN1ZC5/ bloRdXzmXgCpm1etzRup3R6ci4rNGT4jWx/r4+OPC22nIYkALq5VfjKIIBpoMBgJh8G7 LYI0p8L9uWnLGY3n8RGfUb2VsHwzqH1q2rOMBZ7S3Cjz9/MbP0Lpj91wXQcZ89MQ6Pu5 C02MgVfbc5t+tVCVj99c02KxoAnCbfCHtxsbmPEHAo7klwYjfCknK3hSlz/TFaDlmS4C +wQtTQeVnrPlEhURzRPUBtuYjgdqw04mnclHu1Grtd3kc/9kRLvJrDnt7q5fiUfC0/Lf e01A== Received: by 10.68.218.198 with SMTP id pi6mr17230976pbc.121.1335806895032; Mon, 30 Apr 2012 10:28:15 -0700 (PDT) Received: by 10.68.218.198 with SMTP id pi6mr17230954pbc.121.1335806894909; Mon, 30 Apr 2012 10:28:14 -0700 (PDT) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id pn5sm16586928pbb.71.2012.04.30.10.28.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Apr 2012 10:28:14 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Fix build on MIPS GNU/Linux Date: Mon, 30 Apr 2012 10:28:12 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnolx4TuBQqp/wrpoliO5oeb2n+0H8XqVAc57Oco+ac6quo3Aw5BAZFhk82PpvplwRvPL4Wfliosm+Cri6ymZaBF99m3Hi8ExlkOi+UenEbNZibCXsw0rnkUbiPKvFBEIJqGP8uTZavKYsXRMDS35md7zH7NFZRQ9Yr9MKi7Lm6/i+N0qI= 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 This patch to libgo fixes the build on MIPS GNU/Linux. I haven't been able to fully test gccgo, as the MIPS64 machine in the GCC compile farm is running a version of glibc that is too old--it does not support makecontext and friends. However, this patch at least gets past the immediate build problem reported in PR 52586. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r a5f055c95162 libgo/go/syscall/libcall_linux.go --- a/libgo/go/syscall/libcall_linux.go Fri Apr 27 21:56:09 2012 -0700 +++ b/libgo/go/syscall/libcall_linux.go Mon Apr 30 08:54:38 2012 -0700 @@ -203,7 +203,11 @@ p = (*byte)(unsafe.Pointer(&_zero)) } Entersyscall() - r1, _, errno := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(len(buf))) + s := SYS_GETDENTS64 + if s == 0 { + s = SYS_GETDENTS + } + r1, _, errno := Syscall(uintptr(s), uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(len(buf))) n = int(r1) if n < 0 { err = errno diff -r a5f055c95162 libgo/mksysinfo.sh --- a/libgo/mksysinfo.sh Fri Apr 27 21:56:09 2012 -0700 +++ b/libgo/mksysinfo.sh Mon Apr 30 08:54:38 2012 -0700 @@ -224,6 +224,14 @@ echo "const $sup = _$sys" >> ${OUT} done +# 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} +fi +if ! grep '^const SYS_GETDENTS64 ' ${OUT} >/dev/null 2>&1; then + echo "const SYS_GETDENTS64 = 0" >> ${OUT} +fi + # Stat constants. grep '^const _S_' gen-sysinfo.go | \ sed -e 's/^\(const \)_\(S_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}