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

Linker errors with Go 1.12 #4

Closed
aclements opened this issue Jan 14, 2019 · 0 comments
Closed

Linker errors with Go 1.12 #4

aclements opened this issue Jan 14, 2019 · 0 comments

Comments

@aclements
Copy link
Contributor

The assembly-optimized implementations of several of the functions in this package refer to the unexported function runtime.panicindex, which is no longer available in Go 1.12. For example, building the tests fails with:

go get -d -t gorgonia.org/vecf64
go test -tags avx gorgonia.org/vecf64
# gorgonia.org/vecf64.test
gorgonia.org/vecf64.Add: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
gorgonia.org/vecf64.Div: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
gorgonia.org/vecf64.InvSqrt: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
gorgonia.org/vecf64.Mul: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
gorgonia.org/vecf64.Sqrt: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
gorgonia.org/vecf64.Sub: relocation target runtime.panicindex not defined for ABI0 (but is defined for ABIInternal)
FAIL	gorgonia.org/vecf64 [build failed]

The recommended fix for this is to wrap these functions with a Go function that checks their invariants and panics before calling the (unexported) assembly implementation. This Go function will be small enough that it gets inlined, so there's no additional overhead.

See the (still in-progress, but almost committed) design doc here: https://go-review.googlesource.com/c/proposal/+/150077/4/design/27539-internal-abi.md#342

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

No branches or pull requests

1 participant