Skip to content

plan9: replace Exit assembly stub with os.Exit#270

Open
Jah-yee wants to merge 1 commit intogolang:masterfrom
Jah-yee:fix/plan9-exit-v3
Open

plan9: replace Exit assembly stub with os.Exit#270
Jah-yee wants to merge 1 commit intogolang:masterfrom
Jah-yee:fix/plan9-exit-v3

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 24, 2026

Fix: golang/go#78506 — plan9.Exit build failure

Problem: Cross-compiling to GOOS=plan9 GOARCH=amd64 fails with:

# golang.org/x/sys/plan9.exit: relocation target syscall.exit not defined

The Exit function uses assembly (asm_plan9_amd64.s) that references syscall.exit, which does not exist on Plan 9.

Solution: Replace the assembly stub with a direct Go call to os.Exit, which properly terminates the process. Also remove the now-orphaned asm_plan9_amd64.s file.

Changes:

  • plan9/syscall_plan9.go: Replace assembly-based exit stub with os.Exit(code)
  • plan9/asm_plan9_amd64.s: Removed (only existed for the Exit function)

Note: The 386 and arm assembly files still have the same exit stub issue. This PR only fixes amd64. Follow-up PRs can address the other architectures if needed.

Fixes golang/go#78506

The Exit function in plan9 package currently uses assembly that
references syscall.exit, which does not exist on Plan 9. This
causes build failures when cross-compiling to plan9/amd64:

  # golang.org/x/sys/plan9.exit: relocation target syscall.exit not defined

Fix by replacing the assembly stub with os.Exit, which properly
terminates the process on Plan 9. Also remove the now-orphaned
asm_plan9_amd64.s file which only existed for this function.

Fixes golang/go#78506
@gopherbot
Copy link
Copy Markdown
Contributor

This PR (HEAD: e0cfbdb) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/sys/+/770400.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/770400.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Cherry Mui:

Patch Set 1: Hold+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/770400.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/770400.
After addressing review feedback, remember to publish your drafts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x/sys/plan9: function Exit causes build failure

2 participants