-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: port to RISC-V #27532
Comments
Change https://golang.org/cl/133735 mentions this issue: |
Add syscall wrappers, error constants and types for linux/riscv64 Switch docker image to Ubuntu 18.10 in order to get qemu supporting riscv64. Also set the uname release string for qemu to 4.15 (the first Linux kernel version with riscv64 support), because otherwise running the generating C program in mkerrors.sh on a host with an older kernel would fail with a "FATAL: kernel too old". Note that linux/riscv64 is currently only usable using gccgo. Updates golang/go#27532 Change-Id: Ic420f842342418443474cac72d38adff14d1b938 Reviewed-on: https://go-review.googlesource.com/133735 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
/cc myself as Fedora/RISC-V maintainer. I would be happy to incl. this into the distribution (once it compiles) and do some testing. |
Thanks for raising this. Does anyone know where I can get hardware to test on ? |
New house, CPU and fgpa efforts are going on using risc-v. Here is the main news feed on all of it: |
@gedw99 At the moment SiFive is the only company that has produced a RISC-V dev board (HiFive Unleashed). One caveat to this board is the price, which is around $1,000 USD. |
@hugelgupf, when you're far enough along to want a builder set up, file a bug and copy me and I'd be more than happy to help. |
I recently starting using qemu to run a riscv fedora build. Here are the links in case it's useful for devving without a board. https://github.com/riscv/riscv-qemu Using |
Just reminder that RISC-V is supported in released versions of QEMU and libvirt, which makes it easy to setup multiple VMs with management. See: https://fedoraproject.org/wiki/Architectures/RISC-V/Installing#Boot_with_libvirt Note, that our libffi does not support Go closures thus some functionality does not work. The patch exist already, but I need to backport it to our libffi version. Should I bump priority on this? |
FWIW, I started rebasing the Go 1.18-based https://github.com/riscv/go-riscv to current Go tip at https://github.com/tklauser/go-riscv. It currently builds on I currently lack the time and resources to really push it forward but maybe someone else working on it might find it useful. |
Just saw that you can apparently run RISC-V in the cloud via an FPGA AWS instance: That might be a possible temporary builder strategy. |
@bradfitz https://fires.im/ is a risc-v deployment on aws fpgas but the underlying risc-v implementation only runs up to something like 100mhz. Working with a team that's doing some research in that area and it seems to be the norm. So far emulation has been the most performant by far. |
QEMU supports up to 8 cores (MTTCG - multi-threaded TCG), which is great if you can compile in parallel. Alternatively contact Palmer Dabbelt from SiFive and ask for a free SiFive HiFive Unleashed board (multiple projects have received one for porting efforts). |
Change https://golang.org/cl/157899 mentions this issue: |
Change https://golang.org/cl/157900 mentions this issue: |
Change https://golang.org/cl/157901 mentions this issue: |
On linux/riscv64, the renameat syscall no longer exists and has been superseded by renameat2. Use Renameat2 to implement Renameat on linux/riscv64. Based on a patch by Ryan O'Leary. Updates golang/go#27532 Change-Id: I7c60c7f824750408265f67397b8ac1fa7226f425 Reviewed-on: https://go-review.googlesource.com/c/157899 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
On linux/riscv64, char defaults to unsigned, so explicitly make RawSockaddrUnix.Path signed. Patch by Ryan O'Leary. Updates golang/go#27532 Change-Id: If99a3953462ad98f61d8fafcda3ebb71b44e6018 Reviewed-on: https://go-review.googlesource.com/c/157900 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Issue for setting up a qemu-based RISC-V builder: #30262 |
Although RISC-V 64-bit doesn't have official golang support there are forks that now exist with at least some support and work is ongoing in the upstream tree. In order to be able to use the goarch class add support for RISC-V. For more details see here: golang/go#27532 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Although RISC-V 64-bit doesn't have official golang support there are forks that now exist with at least some support and work is ongoing in the upstream tree. In order to be able to use the goarch class add support for RISC-V. For more details see here: golang/go#27532 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Source: poky MR: 00000 Type: Integration Disposition: Merged from poky ChangeID: 2187d06 Description: Although RISC-V 64-bit doesn't have official golang support there are forks that now exist with at least some support and work is ongoing in the upstream tree. In order to be able to use the goarch class add support for RISC-V. For more details see here: golang/go#27532 (From OE-Core rev: 91e3b2a762124bf5cf923654ef3a7c871b84c82f) Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Change https://golang.org/cl/217301 mentions this issue: |
…syscalls While the linux/riscv64 port is not yet upstream, most of the syscalls package already has linux/riscv64 support and this will make testing and development easier. Updates golang/go#27532 Change-Id: I6e505be55fdbb2942fb6e4f34c040e7b82809630 Reviewed-on: https://go-review.googlesource.com/c/sys/+/177799 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 4c3a928) Reviewed-on: https://go-review.googlesource.com/c/sys/+/217300 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Updates golang/go#27532 Change-Id: I7250f272ff46f2765d498a97644fb570ae745a6c Reviewed-on: https://go-review.googlesource.com/c/sys/+/206860 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 2f3576d) Reviewed-on: https://go-review.googlesource.com/c/sys/+/217339 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
…iscv64 Updates golang/go#27532 Change-Id: I9598b610c0b6710644988e5cea7661b2681a0314 Reviewed-on: https://go-review.googlesource.com/c/tools/+/216337 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 628e9aa) Reviewed-on: https://go-review.googlesource.com/c/tools/+/217301 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change https://golang.org/cl/217359 mentions this issue: |
Change https://golang.org/cl/211917 mentions this issue: |
Would it be possible to upload rc1 binaries to the download page? |
@davidlt, RISC-V is still considered an experimental port in Go 1.14 so we won't be providing downloads. |
@davidlt It is quite easy to bootstrap golang from another architecture (e.g. amd64), see for example: |
I've also built Go 1.14rc1 for riscv64 and made the tarball available on https://github.com/carlosedp/riscv-bringup/releases. |
Rework instruction generation so that multiple instructions are generated from a single obj.Prog, rather than the current approach where obj.Progs are rewritten. This allows the original obj.Prog to remain intact, before being converted into an architecture specific instruction form. This simplifies the code and removes a level of indirection that results from trying to manipulate obj.Prog.To/obj.Prog.From into forms that match the instruction encoding. Furthermore, the errors reported make more sense since it matches up with the actual assembly that was parsed. Note that the CALL/JMP/JALR type sequences have not yet been migrated to this framework and will likely be converted at a later time. Updates #27532 Change-Id: I9fd12562ed1db0a08cfdc32793897d2a1920ebaa Reviewed-on: https://go-review.googlesource.com/c/go/+/211917 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Done using: go get golang.org/x/sys/unix@latest go mod tidy Updates golang/go#27532 Change-Id: Ibb984f35d969b4f93a492f24560bc957f9dafb65 Reviewed-on: https://go-review.googlesource.com/c/net/+/217359 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@dmitshur - is there anything preventing this issue from being closed? |
cgo support :) |
cgo support for riscv is tracked in #36641 |
Change https://golang.org/cl/240377 mentions this issue: |
Mention support for the 64-bit RISC-V instruction set (GOARCH=riscv64) in the "Installing Go from source" document. Also sort the list of supported instruction sets alphabetically. Updates #27532 Change-Id: I07a443044a41a803853978dd7f7446de89ecceb5 Reviewed-on: https://go-review.googlesource.com/c/go/+/240377 Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Anyone having a a desire to support RISC-V for https://go.googlesource.com/gollvm/ ? |
Mention valid combination GOOS=linux and GOARCH=riscv64 in the "Installing Go from source" document. Updates golang#27532
Change https://golang.org/cl/250997 mentions this issue: |
Mention valid combination GOOS=linux and GOARCH=riscv64 in the "Installing Go from source" document. Updates #27532 Change-Id: I8c1406087132f5c82a2eee5dbcda95d53c64d263 GitHub-Last-Rev: ee74ff9 GitHub-Pull-Request: #41063 Reviewed-on: https://go-review.googlesource.com/c/go/+/250997 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Experimental support was added in Go 1.14 and Go 1.15 improved stability and performance. Support for cgo on linux/riscv64 is tracked in #36641. Thus, I'm considering basic support for RISC-V to be done and am closing this issue. Let's open separate, specific issues for any further development (e.g. gollvm support) and improvements. Thanks everybody for contributing! |
Change https://golang.org/cl/257917 mentions this issue: |
Also use this as the riscv64 slowbot, since linux-riscv64-unleashed has been MIA for quite some time. For golang/go#27532 Change-Id: I01309a66b96d4c35dbc9d1e08f55f5357b0acba0 Reviewed-on: https://go-review.googlesource.com/c/build/+/257917 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This issue serves to track the port to the RISC-V architecture. There is an out-of-tree port at https://github.com/riscv/riscv-go based on Go 1.8 which - according to riscvarchive/riscv-go#19 - is no longer maintained and would need quite some work to be updated to the current Go tip.
Also see https://golang.org/cl/106256#message-2d9a5c5b89ad55b8b7999f794983f993649232c8 and https://groups.google.com/forum/#!searchin/golang-dev/RISC%7Csort:date/golang-dev/VpsyGdi-sQQ/FMu6IB_2CwAJ where @josharian summarized the current state of the existing port.
The
GOARCH
valuesriscv
andriscv64
were reserved in https://golang.org/cl/106256. These values are already used by gccgo. Additional changes were made todebug/elf
(https://golang.org/cl/107339),cmd/cgo
(https://golang.org/cl/110066),cmd/dist
andcmd/types
(https://golang.org/cl/118618) in order be able to generate type definition files in thex/sys/unix
package (https://golang.org/cl/133735)./cc @bradfitz @ianlancetaylor @josharian
The text was updated successfully, but these errors were encountered: