From patchwork Wed May 2 22:28:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 907753 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-477147-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="SlW+oixS"; 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 40btHH0RyRz9s4r for ; Thu, 3 May 2018 08:29:11 +1000 (AEST) 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=tcJ5Me1aHQ2wcjmkQ+LLuzS6xdLYUGEF3R3M75zigrTkSY wH898/2+yE8xDA8HJKx0CeXHA/PcuAp49vO7+HEnBTl99ittK0NR5rv/1IZ2voaK /uh1/Jgy27S9VlvAtxaPoOKhJHxhgwE6MlGbv93emeYC/vYXA6JtKJi2efFt8= 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=b1F0Ay91t7ZOudoPf2EokE1oJKw=; b=SlW+oixS8hikY/1T+zMU 6T6VW/r4POX0HQDGGwRCNZfd1IIhQkO6lQgTMTbrdJOS9n39b0HB/goHRtdLRNix iDMi3H3TEINxtKHgZjP8Z7xrTfQpLhqUpOjHli8P/AXkaQg2cY12IekhMMP+qaJ9 A4d3XjBDL1Ovo0+iTymk/FM= Received: (qmail 16178 invoked by alias); 2 May 2018 22:29:04 -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 16166 invoked by uid 89); 2 May 2018 22:29:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 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.2 spammy=sk:380527c, family 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; Wed, 02 May 2018 22:28:55 +0000 Received: by mail-wm0-f47.google.com with SMTP id a8so25320672wmg.5 for ; Wed, 02 May 2018 15:28:55 -0700 (PDT) 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=w6yAozrTmErUqMs5TL0bTmW9uq3Svl5sDQK3Pk3LBQ0=; b=JuWPZoiVPH+YiMCyhE9C2y6ei4K4rd3ewVNIVvl2z3oCB7h4q3Bq4sIxgnav89QVX1 9CMaMepfCYqpXd9pATfj21lcv4m7pfojZR2bQkx/DDHeDLWq35NoIjnckioCvYDq5TRe twECkAgSpNGKpBCX3JVYtBILvQZrm2V8g9fCDdqJ6Ry+Mge+NdQcNLU3RlZXPkyFcs95 35vSg01LGPAftnmb5YMLgBW/s4DoNHJyJyf6C05L4S9MDeelvVMnS9J6b7Y19MqckvVl qlIo5i1Pz2qlxaOImoZ+u6VbA5JvF5WaRs/Pwdpfit0ZuiWkBiQMNNCoHHpYwVYy/jHC 90UA== X-Gm-Message-State: ALQs6tAMLby0qZfvkOtrVcSyKpZ8k4RwNSEt//4J1TeSEpemXE341Lv9 ESDBLvarckVhQVgoHZp+R1+wGcm/1K4bFJpGz4tujs+u X-Google-Smtp-Source: AB8JxZpo79c4YWjh/wjuUJq/lQvIz+f31CUdmSzN5lV0B139GaEQZZ6YRXpa5x29LYiU6avFv/QNn5wTTG6rwkZLqEM= X-Received: by 2002:a50:8e83:: with SMTP id w3-v6mr27845176edw.140.1525300133329; Wed, 02 May 2018 15:28:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.245.189 with HTTP; Wed, 2 May 2018 15:28:52 -0700 (PDT) From: Ian Lance Taylor Date: Wed, 2 May 2018 15:28:52 -0700 Message-ID: Subject: libgo patch committed: Add support for NIOS II To: gcc-patches , gofrontend-dev@googlegroups.com This patch by Tobias Klauser adds libgo support for NIOS II. 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 259805) +++ gcc/go/gofrontend/MERGE (working copy) @@ -1,4 +1,4 @@ -380527c032f02446438c71b0ac0026bcab416be5 +24cd2e0542cc227200c3f91b9e0eefaa726cbc1c The first line of this file holds the git revision number of the last merge done from the gofrontend repository. Index: libgo/configure.ac =================================================================== --- libgo/configure.ac (revision 259805) +++ libgo/configure.ac (working copy) @@ -224,10 +224,10 @@ AC_SUBST(USE_DEJAGNU) # - libgo/go/syscall/endian_XX.go # - possibly others # - possibly update files in libgo/go/internal/syscall/unix -ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le ppc ppc64 ppc64le riscv64 s390 s390x sh shbe sparc sparc64" +ALLGOARCH="386 alpha amd64 amd64p32 arm armbe arm64 arm64be ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le nios2 ppc ppc64 ppc64le riscv64 s390 s390x sh shbe sparc sparc64" # All known GOARCH family values. -ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 PPC PPC64 RISCV64 S390 S390X SH SPARC SPARC64" +ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 NIOS2 PPC PPC64 RISCV64 S390 S390X SH SPARC SPARC64" GOARCH=unknown case ${host} in @@ -290,6 +290,9 @@ changequote([,])dnl ;; esac ;; + nios2-*-*) + GOARCH=nios2 + ;; rs6000*-*-* | powerpc*-*-*) AC_COMPILE_IFELSE([ #ifdef _ARCH_PPC64 Index: libgo/go/cmd/cgo/main.go =================================================================== --- libgo/go/cmd/cgo/main.go (revision 259805) +++ libgo/go/cmd/cgo/main.go (working copy) @@ -165,6 +165,7 @@ var ptrSizeMap = map[string]int64{ "mips64le": 8, "mips64p32": 4, "mips64p32le": 4, + "nios2": 4, "ppc": 4, "ppc64": 8, "ppc64le": 8, @@ -190,6 +191,7 @@ var intSizeMap = map[string]int64{ "mips64le": 8, "mips64p32": 8, "mips64p32le": 8, + "nios2": 4, "ppc": 4, "ppc64": 8, "ppc64le": 8, Index: libgo/go/go/build/syslist.go =================================================================== --- libgo/go/go/build/syslist.go (revision 259805) +++ libgo/go/go/build/syslist.go (working copy) @@ -5,4 +5,4 @@ package build const goosList = "aix android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows zos " -const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be alpha m68k ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv64 s390 s390x sh shbe sparc sparc64" +const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be alpha m68k ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le nios2 ppc riscv64 s390 s390x sh shbe sparc sparc64" Index: libgo/go/internal/syscall/unix/getrandom_linux_generic.go =================================================================== --- libgo/go/internal/syscall/unix/getrandom_linux_generic.go (revision 259805) +++ libgo/go/internal/syscall/unix/getrandom_linux_generic.go (working copy) @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64 riscv64 +// +build arm64 nios2 riscv64 package unix Index: libgo/go/runtime/hash32.go =================================================================== --- libgo/go/runtime/hash32.go (revision 259805) +++ libgo/go/runtime/hash32.go (working copy) @@ -6,7 +6,7 @@ // xxhash: https://code.google.com/p/xxhash/ // cityhash: https://code.google.com/p/cityhash/ -// +build 386 arm armbe m68k mips mipsle ppc s390 sh shbe sparc +// +build 386 arm armbe m68k mips mipsle nios2 ppc s390 sh shbe sparc package runtime Index: libgo/go/runtime/lfstack_32bit.go =================================================================== --- libgo/go/runtime/lfstack_32bit.go (revision 259805) +++ libgo/go/runtime/lfstack_32bit.go (working copy) @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build 386 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le ppc s390 sh shbe sparc +// +build 386 arm nacl armbe m68k mips mipsle mips64p32 mips64p32le nios2 ppc s390 sh shbe sparc package runtime Index: libgo/go/runtime/unaligned2.go =================================================================== --- libgo/go/runtime/unaligned2.go (revision 259805) +++ libgo/go/runtime/unaligned2.go (working copy) @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm mips mipsle mips64 mips64le armbe m68k sparc alpha ia64 mips64p32 mips64p32le sh shbe sparc64 +// +build alpha arm armbe ia64 m68k mips mipsle mips64 mips64le mips64p32 mips64p32le nios2 sh shbe sparc sparc64 package runtime Index: libgo/go/syscall/endian_little.go =================================================================== --- libgo/go/syscall/endian_little.go (revision 259805) +++ libgo/go/syscall/endian_little.go (working copy) @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // -// +build 386 amd64 amd64p32 arm arm64 ppc64le mips64le mipsle alpha ia64 mips64p32le sh riscv64 +// +build 386 alpha amd64 amd64p32 arm arm64 ia64 mips64le mipsle mips64p32le nios2 ppc64le riscv64 sh package syscall Index: libgo/go/syscall/libcall_linux_ustat.go =================================================================== --- libgo/go/syscall/libcall_linux_ustat.go (revision 259805) +++ libgo/go/syscall/libcall_linux_ustat.go (working copy) @@ -4,7 +4,7 @@ // GNU/Linux library ustat call. // This is not supported on some kernels, such as arm64. -// +build !arm64,!riscv64 +// +build !arm64,!nios2,!riscv64 package syscall Index: libgo/goarch.sh =================================================================== --- libgo/goarch.sh (revision 259805) +++ libgo/goarch.sh (working copy) @@ -126,6 +126,13 @@ case $goarch in ;; esac ;; + nios2) + family=NIOS2 + cachelinesize=32 + minframesize=16 + pcquantum=4 + ptrsize=4 + ;; ppc) family=PPC bigendian=true Index: libgo/match.sh =================================================================== --- libgo/match.sh (revision 259805) +++ libgo/match.sh (working copy) @@ -116,7 +116,7 @@ for f in $gofiles; do aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) tag1=nonmatchingtag ;; esac @@ -128,7 +128,7 @@ for f in $gofiles; do aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) tag2=nonmatchingtag ;; esac Index: libgo/testsuite/gotest =================================================================== --- libgo/testsuite/gotest (revision 259805) +++ libgo/testsuite/gotest (working copy) @@ -314,7 +314,7 @@ x) aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag1=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) tag1=nonmatchingtag ;; esac @@ -326,7 +326,7 @@ x) aix | android | darwin | dragonfly | freebsd | linux | nacl | netbsd | openbsd | plan9 | solaris | windows) tag2=nonmatchingtag ;; - 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | ppc64 | ppc64le | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le | ppc | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) + 386 | amd64 | amd64p32 | arm | armbe | arm64 | arm64be | alpha | ia64 | m68k | mips | mipsle | mips64 | mips64le | mips64p32 | mips64p32le·| nios2 | ppc | ppc64 | ppc64le | riscv64 | s390 | s390x | sh | shbe | sparc | sparc64) tag2=nonmatchingtag ;; esac