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: future of the openbsd/mips64 port #61546

Open
4a6f656c opened this issue Jul 24, 2023 · 5 comments
Open

all: future of the openbsd/mips64 port #61546

4a6f656c opened this issue Jul 24, 2023 · 5 comments
Assignees
Labels
arch-mips compiler/runtime Issues related to the Go compiler and/or runtime. OS-OpenBSD
Milestone

Comments

@4a6f656c
Copy link
Contributor

The openbsd/mips64 port is currently in limbo - this issue is an attempt to identify a path forward.

Background

OpenBSD 6.9 (May 2021) onward requires that system calls be made via libc stubs - direct system calls are no longer permitted (see #36435 for more details). The openbsd/amd64 and openbsd/arm64 ports were converted in Go 1.16, while openbsd/arm and openbsd/386 were converted early in Go 1.17.

The only port not converted is openbsd/mips64 - this was in part due to the lack of support for SDYNIMPORT with internal linking. An initial conversion was done which required external linking (https://go-review.googlesource.com/c/go/+/342510), however among other issues, this meant that the misc-compile-openbsd would not be able to compile test openbsd/mips64 - it was suggested that internal linking with SDYNIMPORT would be a better route.

The last OpenBSD release that Go tip works on for openbsd/mips64 is OpenBSD 6.8, which has been EOL since October 2021. To further complicate matters, a working version of the port has been maintained in the OpenBSD ports tree (https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/go/). For this port to be useful, other repositories like golang.org/x/sys/unix have needed to switch to indirect system calls, which has further broken openbsd/mips64 in Go tip (#58110).

Aside from the openbsd/mips64 port being broken, it also means that the indirect syscall migration cannot be completed and there is various technical debt lingering from this in the Go runtime/linker. The builder is also currently offline.

Current Status

Changes to implement SDYNIMPORT with both internal and external linking were mailed in July 2022 (https://go-review.googlesource.com/c/go/+/415815) - these two changes are ~320 lines of code combined. A year and two full Go release cycles later, the openbsd/mips64 port is still blocked on the second of these changes (the first landed during the previous release cycle).

Moving Forward

There are at least three potential resolutions:

  1. Land the above SDYNIMPORT changes and get the port operational again.
  2. Revisit switching to external linking
  3. Decommission the port

(1) would be preferable as it would allow the port to become functional again, however it is unclear when this may occur. The openbsd/mips64 port is a second class port and mips64 is not a first-class architecture - this seems to be part of the reason why it is difficult to get reviews, however the flip side of this is that it has not lowered the review bar and/or provided any way to progress.

(2) avoids changes to the Go linker, instead switching the port entirely to external linking - this means that builds take longer, the misc-openbsd-compile target is unable to test openbsd/mips64, but the port can become functional again.

(3) given that the port is broken and that it is preventing technical debt from being cleaned up, decommissioning is an option. This is a last resort, however it seems preferable to the current state.

If (2) or (3) are preferred I can send appropriate changes for review.

@seankhliao
Copy link
Member

cc @golang/compiler

@bcmills
Copy link
Contributor

bcmills commented Jul 24, 2023

(CC @golang/openbsd @golang/mips)

@bcmills bcmills added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 24, 2023
@rsc
Copy link
Contributor

rsc commented Jul 24, 2023

It sounds like the main request here is some reviews for the stack at https://go-review.googlesource.com/c/go/+/512475/1.

@mknyszek mknyszek added this to the Backlog milestone Jul 26, 2023
@gopherbot
Copy link

Change https://go.dev/cl/516016 mentions this issue: runtime,syscall: invert openbsd architecture tests

gopherbot pushed a commit that referenced this issue Aug 5, 2023
Rather than testing for architectures that use libc-based system calls,
test that it is not the single architecture that Go is still using direct
system calls. This reduces the number of changes needed for new openbsd
ports.

Updates #36435
Updates #61546

Change-Id: I79c4597c629b8b372e9efcda79e8f6ff778b9e8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/516016
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
@4a6f656c
Copy link
Contributor Author

@cherrymui @mknyszek @rsc has there been any further consideration here, given the imminent freeze?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-mips compiler/runtime Issues related to the Go compiler and/or runtime. OS-OpenBSD
Projects
Status: In Progress
Development

No branches or pull requests

7 participants