-
Notifications
You must be signed in to change notification settings - Fork 37
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
the repo will cause compile error when using go vendor mode #73
Comments
err msg: undefined reference to `github.com/segmentio/asm/cpu.X86'; |
Hey @Boyce-Lee, thanks for reporting. We've seen this error as well when using older versions of Go; do you mind sharing details about your go version and environment? (maybe the output of |
|
go 1.3/1.4/1.5 do not work my test version: |
@Boyce-Lee Go 1.15.13 is an old release, are there any limitation to use newer Go 1.17 or even 1.18 release? |
FWIW, I see the same with Go 1.18.1 |
I just tried this and did not observe any issues: package main
import "github.com/segmentio/asm/mem"
func main() {
src := [1]byte{42}
dst := [1]byte{}
mem.Copy(dst[:], src[:])
}
Do you happen to have a reproducible test case that demonstrates the problem on Go 1.18? |
Regarding the original issue, the latest version of the project now requires Go 1.17+, there were changes to the build tool that add maintenance overhead to maintain backward compatibility with older Go versions. Version 1.1.5 is the last one supporting Go 1.16, older versions of Go were never supported. |
fwiw this causes a build failure on OpenBSD/amd64 using go 1.18.1 when building grafana 8.5 and a vendored source tree (which includes segmentio/asm 1.1.0 & 1.1.1 afaict).
|
This looks like a linker issue, likely the build pipeline behaves slightly differently on OpenBSD and it looks like the symbols from the I tried on a linux/amd64 and did not observe this behavior:
The test program I shared above vendors and builds fine. I also tried building Grafana on the same platform and it succeeded (running |
i got same error how to fix ? |
i got same error too github.com/segmentio/asm/bswap.swap64: relocation target github.com/segmentio/asm/cpu.X86 not defined go version
go env
|
if I enable go mod, problem fixed. |
https://github.com/segmentio/asm
This is mainly useful to compare the impact of using the assembly optimized versions instead of the simpler Go-only implementations. |
No description provided.
The text was updated successfully, but these errors were encountered: