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

Doesn't compile on 32bit #38

Closed
ohdearaugustin opened this issue Jul 6, 2022 · 1 comment · Fixed by #42
Closed

Doesn't compile on 32bit #38

ohdearaugustin opened this issue Jul 6, 2022 · 1 comment · Fixed by #42

Comments

@ohdearaugustin
Copy link

This function created a compile error when trying to build with arm32 (CGO_ENABLED=0 GOOS=linux GOARCH=arm go build test.go)

xsync/util.go

Lines 18 to 24 in d5f0f9d

// murmurhash3 64-bit finalizer
func hash64(x uintptr) uint64 {
x = ((x >> 33) ^ x) * 0xff51afd7ed558ccd
x = ((x >> 33) ^ x) * 0xc4ceb9fe1a85ec53
x = (x >> 33) ^ x
return uint64(x)
}

Following error is shown:

#0 7.331 /go/pkg/mod/github.com/puzpuzpuz/xsync@v1.2.1/util.go:20:24: 0xff51afd7ed558ccd (untyped int constant 18397679294719823053) overflows uintptr
#0 7.331 /go/pkg/mod/github.com/puzpuzpuz/xsync@v1.2.1/util.go:21:24: 0xc4ceb9fe1a85ec53 (untyped int constant 14181476777654086739) overflows uintptr

This can likely be fixed by casting the argument to uint64 before performing the operations.

@puzpuzpuz
Copy link
Owner

Yes, the readme mentions that only 64-bit builds are currently supported. I may address this when working on an upcoming Map update. In the meantime, if you'd like to contribute a patch, that would be nice.

ptrcnull added a commit to ptrcnull/xsync that referenced this issue Jul 30, 2022
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Aug 4, 2022
- Mark as broken on i386 platforms as one of the dependencies
  fails to compile on 64-bit platforms[0]

[0] puzpuzpuz/xsync#38

PR:		265432
Approved by:	Michael Muenz <m dot muenz at gmail dot com> (maintainer)
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

Successfully merging a pull request may close this issue.

2 participants