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

cmd/cgo: cgo with external linking for linux/mips64 #14126

Closed
eswierk opened this issue Jan 27, 2016 · 4 comments

Comments

@eswierk
Copy link

commented Jan 27, 2016

Implement cgo with external linking for linux/mips64 and linux/mips64le (MIPS N64 ELF ABI, big- and little-endian). Work includes:

  • complete external linking support (#12560)
  • fill in the portions of src/runtime/asm_mips64x.s marked "no cgo yet", plus whatever else cgo requires
  • enable cgo external link tests, and get (cd misc/cgo/test && go test -linkmode=external) to pass on Linux on mips64 and mips64le hardware

Initial testing can be done using qemu-user for mips64 and mips64le targets running on any host. Skyport Systems (my employer) can also provide access to mips64le hardware for testing.

See #8912 for a description of similar work for ppc64 (though internal linking support is optional/extra credit). For a working example, browse the current arm64 code, which supports exactly the functionality sought for mips64 (cgo with external linking, not internal linking).

@eswierk

This comment has been minimized.

Copy link
Author

commented Jan 28, 2016

Background info, for the benefit of a potential bounty hunter...

How cgo works, from the horse’s mouth. Plus an explanation of golang's odd x86-ish assembly language. Some of the links to Plan9 docs are broken; use this archive instead.

The Altoros blog series on golang internals has lots of useful info about code generation, linking, relocations, assembly.

Explanation of golang’s clever conditional compilation features (build tags and magic filenames).

For brushing up on MIPS trivia: N32/N64 ABI and other ABIs, ELF relocation types.

There is probably some overlap with the voodoo that needs to be added to libffi to support closures with gccgo on mips64.

@minux

This comment has been minimized.

Copy link
Member

commented Jan 28, 2016

@eswierk

This comment has been minimized.

Copy link
Author

commented Jan 28, 2016

@minux We only have little endian mips64 currently. Would that be useful to you?

@gopherbot

This comment has been minimized.

Copy link

commented Feb 21, 2016

CL https://golang.org/cl/19809 mentions this issue.

eswierk added a commit to skyportsystems/go that referenced this issue Feb 23, 2016
go/build, cmd/dist: enable cgo and external linking on linux/mips64x
Fixes golang#14126

Change-Id: I21c8e06c01d3ef02ee09dc185d4443e2da8fd52b
eswierk added a commit to skyportsystems/go that referenced this issue Feb 27, 2016
cmd/dist: enable cgo and external linking on linux/mips64x
Fixes golang#14126

Change-Id: I21c8e06c01d3ef02ee09dc185d4443e2da8fd52b

@bradfitz bradfitz added this to the Unplanned milestone Apr 8, 2016

@karalabe karalabe referenced this issue May 3, 2016

@gopherbot gopherbot closed this in 1cec0fe May 4, 2016

@golang golang locked and limited conversation to collaborators May 4, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.