Skip to content

gccgo: doesn't work on powerpc64 with kernel ucontext functions #30062

Closed
@awilfox

Description

@awilfox

What version of Go are you using (go version)?

$ go version
Aborted

goroutine 16 [running]:
panic during panic

goroutine 16 [running]

goroutine 17 [runnable]:
stack trace unavailable

(GCC 6.4.0 and 7.3.0 were attempted.)

Does this issue reproduce with the latest release?

Untestable as GCC 8 has code generation issues (that are being fixed right now). It's extremely likely that this issue still affects GCC 8 as I am unaware of any attempts to fix this bug, and unable to find any commits that would lead me to believe it is fixed.

What operating system and processor architecture are you using (go env)?

Adélie Linux on ppc64 (big endian) using musl (ELFv2 ABI)

What did you do?

$ go version
$ go help

etc.

What did you expect to see?

Actual output from Go.

What did you see instead?

An Abort trap and a panic during panic.

This is because GCC Go is hard-coded to generate ELFv1 ABI code on big-endian PPC64. This is inaccurate. musl libc uses ELFv2 ABI code on big-endian PPC64. GCC Go should probably use the option from ./configure, --with-abi, to determine which ABI to use on PPC64.

Golang Go isn't usable due to #19074, so our only hope is really GCC Go. I've been trying to figure out where, exactly, gccgo emits its code so that I could fix this issue myself. However, I have been unsuccessful. I've already ported many other large software projects to ELFv2, so a pointer to where the code is that needs to be fixed would, more than likely, allow me to complete this port myself. If upstream GCC Go isn't interested in taking this upstream, I would be willing to distribute it to the community myself for those of us who need this support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions