libgo patch committed: Add riscv and js/wasm

Message ID CAOyqgcWwRd3OiTKZHGCT2Q8rAEd1L_HzUH5JtWFiJorHm_L8QA@mail.gmail.com
State New
Headers show
Series
  • libgo patch committed: Add riscv and js/wasm
Related show

Commit Message

Ian Lance Taylor June 11, 2018, 7:16 p.m.
This libgo patch add riscv and js/wasm as known targets.  This
incorporates cut down versions of https://golang.org/cl/102835 and
https://golang.org/cl/106256 from the master sources.  This will tell
the go/build to skip files with those tags.  Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian

Comments

Palmer Dabbelt June 11, 2018, 7:22 p.m. | #1
On Mon, 11 Jun 2018 12:16:39 PDT (-0700), iant@golang.org wrote:
> This libgo patch add riscv and js/wasm as known targets.  This
> incorporates cut down versions of https://golang.org/cl/102835 and
> https://golang.org/cl/106256 from the master sources.  This will tell
> the go/build to skip files with those tags.  Bootstrapped and ran Go
> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

[...]

> --- libgo/goarch.sh	(revision 261203)
> +++ libgo/goarch.sh	(working copy)
> @@ -153,6 +153,11 @@ case $goarch in
>  		;;
>  	esac
>  	;;
> +    riscv)
> +	family=RISCV
> +	pcquantum=2
> +	ptrsize=4
> +	;;
>      riscv64)
>  	family=RISCV64
>  	pcquantum=2

I don't know anything about Go, but we've generally been calling the RISC-V 
architectures "riscv32" and "riscv64" as opposed to "riscv" and "riscv64", with 
the idea being that it's a bit more explicit.  Technically, RISC-V is the name 
of a family of ISAs, with "RV32I" and "RV64I" being two base ISAs so this also 
matches the ISA's naming scheme.

Obviously this isn't a big deal, I just saw the patch go by and thought I'd 
bring it up.
Ian Lance Taylor June 12, 2018, 3:46 a.m. | #2
On Mon, Jun 11, 2018 at 12:22 PM, Palmer Dabbelt <palmer@sifive.com> wrote:
> On Mon, 11 Jun 2018 12:16:39 PDT (-0700), iant@golang.org wrote:
>>
>> This libgo patch add riscv and js/wasm as known targets.  This
>> incorporates cut down versions of https://golang.org/cl/102835 and
>> https://golang.org/cl/106256 from the master sources.  This will tell
>> the go/build to skip files with those tags.  Bootstrapped and ran Go
>> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
>
>
> [...]
>
>> --- libgo/goarch.sh     (revision 261203)
>> +++ libgo/goarch.sh     (working copy)
>> @@ -153,6 +153,11 @@ case $goarch in
>>                 ;;
>>         esac
>>         ;;
>> +    riscv)
>> +       family=RISCV
>> +       pcquantum=2
>> +       ptrsize=4
>> +       ;;
>>      riscv64)
>>         family=RISCV64
>>         pcquantum=2
>
>
> I don't know anything about Go, but we've generally been calling the RISC-V
> architectures "riscv32" and "riscv64" as opposed to "riscv" and "riscv64",
> with the idea being that it's a bit more explicit.  Technically, RISC-V is
> the name of a family of ISAs, with "RV32I" and "RV64I" being two base ISAs
> so this also matches the ISA's naming scheme.
>
> Obviously this isn't a big deal, I just saw the patch go by and thought I'd
> bring it up.

Thanks.  This is just copying the master sources for the library, at
https://go.googlesource.com/go/+/master/src/go/build/syslist.go .

The naming scheme used here--riscv and riscv64--is pretty conventional for Go.

Ian
Palmer Dabbelt June 12, 2018, 5:12 p.m. | #3
On Mon, 11 Jun 2018 20:46:01 PDT (-0700), iant@golang.org wrote:
> On Mon, Jun 11, 2018 at 12:22 PM, Palmer Dabbelt <palmer@sifive.com> wrote:
>> On Mon, 11 Jun 2018 12:16:39 PDT (-0700), iant@golang.org wrote:
>>>
>>> This libgo patch add riscv and js/wasm as known targets.  This
>>> incorporates cut down versions of https://golang.org/cl/102835 and
>>> https://golang.org/cl/106256 from the master sources.  This will tell
>>> the go/build to skip files with those tags.  Bootstrapped and ran Go
>>> testsuite on x86_64-pc-linux-gnu.  Committed to mainline.
>>
>>
>> [...]
>>
>>> --- libgo/goarch.sh     (revision 261203)
>>> +++ libgo/goarch.sh     (working copy)
>>> @@ -153,6 +153,11 @@ case $goarch in
>>>                 ;;
>>>         esac
>>>         ;;
>>> +    riscv)
>>> +       family=RISCV
>>> +       pcquantum=2
>>> +       ptrsize=4
>>> +       ;;
>>>      riscv64)
>>>         family=RISCV64
>>>         pcquantum=2
>>
>>
>> I don't know anything about Go, but we've generally been calling the RISC-V
>> architectures "riscv32" and "riscv64" as opposed to "riscv" and "riscv64",
>> with the idea being that it's a bit more explicit.  Technically, RISC-V is
>> the name of a family of ISAs, with "RV32I" and "RV64I" being two base ISAs
>> so this also matches the ISA's naming scheme.
>>
>> Obviously this isn't a big deal, I just saw the patch go by and thought I'd
>> bring it up.
>
> Thanks.  This is just copying the master sources for the library, at
> https://go.googlesource.com/go/+/master/src/go/build/syslist.go .
>
> The naming scheme used here--riscv and riscv64--is pretty conventional for Go.

Ya, it looks like that's what everyone else is doing so I don't see any reason 
to mess with it.

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 261284)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-3ec698690d2a8ecbf115489f17d85e848a2f7293
+bfe3a9b26c8b2e1b9ef34a7232a2d1529e639bbf
 
 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 261203)
+++ 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 nios2 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 riscv riscv64 s390 s390x sh shbe sparc sparc64 wasm"
 
 # All known GOARCH family values.
-ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 NIOS2 PPC PPC64 RISCV64 S390 S390X SH SPARC SPARC64"
+ALLGOARCHFAMILY="I386 ALPHA AMD64 ARM ARM64 IA64 M68K MIPS MIPS64 NIOS2 PPC PPC64 RISCV RISCV64 S390 S390X SH SPARC SPARC64 WASM"
 
 GOARCH=unknown
 case ${host} in
Index: libgo/go/go/build/syslist.go
===================================================================
--- libgo/go/go/build/syslist.go	(revision 261203)
+++ libgo/go/go/build/syslist.go	(working copy)
@@ -4,5 +4,5 @@ 
 
 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 nios2 ppc riscv64 s390 s390x sh shbe sparc sparc64"
+const goosList = "aix android darwin dragonfly freebsd js 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 nios2 ppc riscv riscv64 s390 s390x sh shbe sparc sparc64 wasm "
Index: libgo/go/go/types/sizes.go
===================================================================
--- libgo/go/go/types/sizes.go	(revision 261203)
+++ libgo/go/go/types/sizes.go	(working copy)
@@ -167,6 +167,7 @@  var gcArchSizes = map[string]*StdSizes{
 	"ppc64":    {8, 8},
 	"ppc64le":  {8, 8},
 	"s390x":    {8, 8},
+	"wasm":     {8, 8},
 	// When adding more architectures here,
 	// update the doc string of SizesFor below.
 }
@@ -176,7 +177,7 @@  var gcArchSizes = map[string]*StdSizes{
 //
 // Supported architectures for compiler "gc":
 // "386", "arm", "arm64", "amd64", "amd64p32", "mips", "mipsle",
-// "mips64", "mips64le", "ppc64", "ppc64le", "s390x".
+// "mips64", "mips64le", "ppc64", "ppc64le", "s390x", "wasm".
 func SizesFor(compiler, arch string) Sizes {
 	var m map[string]*StdSizes
 	switch compiler {
Index: libgo/goarch.sh
===================================================================
--- libgo/goarch.sh	(revision 261203)
+++ libgo/goarch.sh	(working copy)
@@ -153,6 +153,11 @@  case $goarch in
 		;;
 	esac
 	;;
+    riscv)
+	family=RISCV
+	pcquantum=2
+	ptrsize=4
+	;;
     riscv64)
 	family=RISCV64
 	pcquantum=2
@@ -198,6 +203,10 @@  case $goarch in
 	defaultphyspagesize=8192
 	pcquantum=4
 	;;
+    wasm)
+	family=WASM
+	defaultphyspagesize=65536
+	;;
     *)
 	echo 1>&2 "unrecognized goarch value \"$goarch\""
 	exit 1