Skip to content
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: add freebsd/riscv64 port #53466

Closed
dmgk opened this issue Jun 20, 2022 · 58 comments
Closed

all: add freebsd/riscv64 port #53466

dmgk opened this issue Jun 20, 2022 · 58 comments

Comments

@dmgk
Copy link
Member

dmgk commented Jun 20, 2022

This issue is intended to serve both as a proposal and to track the progress of adding the freebsd/riscv64 port.

The majority of porting work is done, there's an out-of-tree port at https://github.com/MikaelUrankar/go/tree/freebsd_riscv64 which builds and passes all run.bash tests, including cgo (tested under QEMU and on Unmatched).

@mengzhuo has graciously agreed to setup and maintain the freebsd/riscv64 builder (on SiFive Unmatched) and @MikaelUrankar has agreed to be the port maintainer.

cc @golang/freebsd @golang/riscv64 @mengzhuo @MikaelUrankar

@dmgk dmgk added the Proposal label Jun 20, 2022
@mengzhuo mengzhuo added OS-FreeBSD arch-riscv Issues solely affecting the riscv64 architecture. labels Jun 21, 2022
@mengzhuo
Copy link
Contributor

mengzhuo commented Jun 22, 2022

CC @rsc

@ianlancetaylor ianlancetaylor changed the title all: add freebsd/riscv64 port proposal: all: add freebsd/riscv64 port Jun 22, 2022
@gopherbot gopherbot added this to the Proposal milestone Jun 22, 2022
@ianlancetaylor ianlancetaylor added this to Incoming in Proposals (old) Jun 22, 2022
@rsc
Copy link
Contributor

rsc commented Jun 22, 2022

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc rsc moved this from Incoming to Active in Proposals (old) Jun 22, 2022
@mengzhuo
Copy link
Contributor

mengzhuo commented Jun 27, 2022

I tried to install the prometheus node_exporter and got undefined errors from golang.org/x/sys

I think we should update golang.org/x/sys and other x/ moduels first and leave alone the Go main develope cycle.

@paulzhol
Copy link
Member

I'm already updating golang.org/x/sys as part of #53280. It is indeed horribly out of date. For example Time_t on freebsd/arm is still 32-bit. It was switched to 64-bit more than 16 years ago (I guess it originates directly from the syscall package).
There ptrace constants which are defined only on the x86 arches, not available on both ARMs (because these were probably not generated on actual hosts).
I shudder to think of what state the golang.org/x/net/route is in. std still carries a hand copied if_data8 and if_msghdr8 types.

@rsc
Copy link
Contributor

rsc commented Jun 29, 2022

The new port policy (#53383) will require two maintainers for the port. Assuming that is accepted, is there anyone else who would be willing to be a second maintainer for freebsd/riscv64?

@dmgk
Copy link
Member Author

dmgk commented Jul 1, 2022

Assuming nobody else volunteers, I'll be willing to be a second maintainer for the freebsd/riscv64 (can we have more than two?). I think more people will be interested when this port is closer to be merged.

@mengzhuo
Copy link
Contributor

mengzhuo commented Jul 1, 2022

I want to be the third maintainer since the freebsd/riscv64 stage0 is up and ready.

@gopherbot
Copy link

Change https://go.dev/cl/416834 mentions this issue: unix: add freebsd/riscv64 support

gopherbot pushed a commit to golang/sys that referenced this issue Jul 12, 2022
For golang/go#53466

Change-Id: If5a4dc674cb1856ac580fb87d8030d50fa7c95dd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416834
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
@rsc
Copy link
Contributor

rsc commented Jul 13, 2022

Thanks to @MikaelUrankar, @dmgk, and @mengzhuo for volunteering to be maintainers.

@rsc
Copy link
Contributor

rsc commented Jul 13, 2022

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

@rsc rsc moved this from Active to Likely Accept in Proposals (old) Jul 13, 2022
@rsc rsc moved this from Likely Accept to Accepted in Proposals (old) Jul 20, 2022
@rsc
Copy link
Contributor

rsc commented Jul 20, 2022

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@rsc rsc changed the title proposal: all: add freebsd/riscv64 port all: add freebsd/riscv64 port Jul 20, 2022
@rsc rsc modified the milestones: Proposal, Backlog Jul 20, 2022
@gopherbot
Copy link

Change https://go.dev/cl/418814 mentions this issue: all: add FreeBSD riscv64 support

@dmitshur
Copy link
Contributor

dmitshur commented Aug 8, 2022

CC @golang/release.

gopherbot pushed a commit to golang/net that referenced this issue Aug 9, 2022
For golang/go#53466

Change-Id: Ibbeab43923bdd6b455a28c627832e676b401b4f4
Reviewed-on: https://go-review.googlesource.com/c/net/+/418814
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
@gopherbot
Copy link

Change https://go.dev/cl/425937 mentions this issue: build/dashboard: add freebsd-riscv64

@paulzhol
Copy link
Member

Thanks @dmgk! Makes sense.

@gopherbot
Copy link

Change https://go.dev/cl/443036 mentions this issue: runtime: Add vdso on freebsd/riscv64

gopherbot pushed a commit that referenced this issue Oct 14, 2022
If no external linker was passed with -extld, link currently assumes
that it is "gcc" which is not correct for platforms that use clang
toolchain. Return "clang" for platforms that use it, this fixes dir
tests on freebsd/riscv64.

For #53466

Change-Id: Ie3bce1b9581839d0b3b2129908355cd30ae9a713
Reviewed-on: https://go-review.googlesource.com/c/go/+/432756
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Mikaël Urankar <mikael.urankar@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/443496 mentions this issue: dashboard: drop known issue for freebsd-riscv64

@mengzhuo
Copy link
Contributor

I've droped CC env and it looks at Go repo after 15e2669, however there are some breaks in sub repos:

benchmarks, crypto, debug, website need to update sys
https://build.golang.org/log/53ce3f76b6022e63ff2125b926d7624dcddeec19

text:
https://build.golang.org/log/53ce3f76b6022e63ff2125b926d7624dcddeec19

@paulzhol
Copy link
Member

Could this be due to the LANG=C.UTF-8/MM_CHARSET=UTF-8 envs (but maybe with a missing /usr/share/locale/NNNN on the host)?
I do see them on freebsd/arm as well, but I explicitly had to add UTF-8 to the nanobsd build.

@paulzhol
Copy link
Member

Scratch that, it looks specific to risc-v? starting from http://golang.org/cl/442796:
linux-riscv64-unmatched
https://build.golang.org/log/20584668bb2c87ad76afd348278e21fbc0686ef0

@heschi
Copy link
Contributor

heschi commented Oct 18, 2022

re: sys updates, I happen to be working on that this week.

@dmgk
Copy link
Member Author

dmgk commented Oct 18, 2022

Something between 4fe1971 and ddc7d2a broke x/text on riscv64. af668c6 looks relevant, I'll do git bisect but it will take some time with QEMU.

@mengzhuo
Copy link
Contributor

NOTE: This builder will be unavailable due to kernel panic, I will try to reboot it everyday if it's down.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267225

@dmgk
Copy link
Member Author

dmgk commented Oct 20, 2022

@mengzhuo Thanks for reporting this. We may need to update the builder to 13.1-STABLE later when this panic is fixed.

gopherbot pushed a commit that referenced this issue Oct 20, 2022
Use rdtime to retrieve the timecounter, same as the FreeBSD libc.

Updates #53466

Change-Id: I48816e9100036f1ef483e4d3afcf10db0d3b85f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/443036
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
@gopherbot
Copy link

Change https://go.dev/cl/446515 mentions this issue: all: update sys to 0.1.0

@gopherbot
Copy link

Change https://go.dev/cl/446516 mentions this issue: all: update golang.org/x/sys to v0.1.0

gopherbot pushed a commit to golang/benchmarks that referenced this issue Nov 1, 2022
This CL update golang.org/x/sys to 0.1.0 for
FreeBSD/riscv64 porting

For golang/go#53466

Change-Id: I6cbfced0c9e1abef735ea3d8ea5ae1b9971c2e45
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/446516
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
gopherbot pushed a commit to golang/debug that referenced this issue Nov 2, 2022
This CL update golang.org/x/sys to 0.1.0 for
FreeBSD/riscv64 porting

For golang/go#53466

Change-Id: I56c920d17c0d6a08cf89c927fa840c55a59d6e83
Reviewed-on: https://go-review.googlesource.com/c/debug/+/446515
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
romaindoumenc pushed a commit to TroutSoftware/go that referenced this issue Nov 3, 2022
If no external linker was passed with -extld, link currently assumes
that it is "gcc" which is not correct for platforms that use clang
toolchain. Return "clang" for platforms that use it, this fixes dir
tests on freebsd/riscv64.

For golang#53466

Change-Id: Ie3bce1b9581839d0b3b2129908355cd30ae9a713
Reviewed-on: https://go-review.googlesource.com/c/go/+/432756
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Mikaël Urankar <mikael.urankar@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
romaindoumenc pushed a commit to TroutSoftware/go that referenced this issue Nov 3, 2022
Use rdtime to retrieve the timecounter, same as the FreeBSD libc.

Updates golang#53466

Change-Id: I48816e9100036f1ef483e4d3afcf10db0d3b85f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/443036
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
gopherbot pushed a commit to golang/build that referenced this issue Nov 14, 2022
The FreeBSD riscv64 builder passed all tests after CL432756 merged.
We can drop known issue now.

For golang/go#53466

Change-Id: Ia9f63b2eb780fbb39fbaf684045b7f8b46101a93
Reviewed-on: https://go-review.googlesource.com/c/build/+/443496
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
WeiminShang added a commit to WeiminShang/net that referenced this issue Nov 16, 2022
For golang/go#53466

Change-Id: Ibbeab43923bdd6b455a28c627832e676b401b4f4
Reviewed-on: https://go-review.googlesource.com/c/net/+/418814
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
@gopherbot
Copy link

Change https://go.dev/cl/452355 mentions this issue: all: update golang.org/x/net to v0.2.0

@gopherbot
Copy link

Change https://go.dev/cl/456575 mentions this issue: dashbord: restrict freebsd-riscv64-unmatched to the same repos as linux-riscv64-unmatched

gopherbot pushed a commit to golang/build that referenced this issue Dec 9, 2022
…ux-riscv64-unmatched

Fixes golang/go#56273.
Updates golang/go#53466.

Change-Id: I6e796006f8f7120ae05d5e62cdbc7cdd9d146f7e
Reviewed-on: https://go-review.googlesource.com/c/build/+/456575
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
@dmitshur
Copy link
Contributor

dmitshur commented Dec 9, 2022

The proposal is approved, the port is listed in go tool dist list, has a passing builder, and is mentioned in 1.20 release notes draft. Thanks and congrats on getting to this point!

Is there more that should be done here before closing this issue, or shall we do that now? (New issues can be opened to track specific known work to improve the port.)

@dmgk
Copy link
Member Author

dmgk commented Dec 12, 2022

I think this issue can be closed. Thanks everyone for working on it.

@dmgk dmgk closed this as completed Dec 12, 2022
@golang golang locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

No branches or pull requests

9 participants