Skip to content

misc/cgo/test: internal linking now fails on openbsd/arm64 #31940

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

Closed
4a6f656c opened this issue May 9, 2019 · 4 comments
Closed

misc/cgo/test: internal linking now fails on openbsd/arm64 #31940

4a6f656c opened this issue May 9, 2019 · 4 comments

Comments

@4a6f656c
Copy link
Contributor

4a6f656c commented May 9, 2019

openbsd/arm64 passes all tests successfully prior to d2765de, however with that commit the misc/cgo/test now fails with:

##### ../misc/cgo/test                                                                                           
PASS               
ok      misc/cgo/test   184.359s
# misc/cgo/test.test                                                                                             
/tmp/go-build512157972/b053/_pkg_.a(_x002.o): unknown relocation type 299; compiled without -fpic?
FAIL    misc/cgo/test [build failed]                                                                             
2019/05/08 12:23:39 Failed: exit status 2

This occurs on the -linkmode=internal run of this test and is reproducible via:

$ cd src/misc/cgo/test
$ GOFLAGS=-ldflags=-linkmode=internal go test -c

I haven't yet tracked down the failure/fix, however it is worth noting that openbsd/arm64 uses clang and hence this may also result on other platforms when clang is in use.

@ianlancetaylor
Copy link
Contributor

Relocation 299 is R_AARCH64_LDST128_ABS_LO12_NC. That may need to be added to the switch in relSize in cmd/link/internal/loadelf/ldelf.go. Likely we'll also need some code for the reloc in cmd/link/internal/arm64/asm.go.

@erifan
Copy link

erifan commented May 10, 2019

@4a6f656c Do you want me to add this relocation ? It's easy to do, but I don't have a Openbsd test environment.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/176697 mentions this issue: cmd/link: add support for R_AARCH64_LDST128_ABS_LO12_NC relocations

@4a6f656c
Copy link
Contributor Author

@ianlancetaylor - thanks for the pointers.

@erifan - I've just mailed https://go-review.googlesource.com/c/go/+/176697 which allows openbsd/arm64 to pass all tests again.

@golang golang locked and limited conversation to collaborators May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants