valyala / gozstd

go wrapper for zstd
MIT License
420 stars 60 forks source link

Add darwin/arm64 support #34

Closed panlilu closed 3 years ago

panlilu commented 3 years ago

MacBook with M1 chip

valyala commented 3 years ago

Could you check out gozstd source code and run GOOS=darwin GOARCH=arm64 make libzstd.a from the repository root on a MacBook with M1 chip? This should create libzstd_darwin_arm64.a file in the root folder of the repository. Then manually create libzstd_darwin_arm64.go file with the following contents:

package gozstd

/*
#cgo LDFLAGS: ${SRCDIR}/libzstd_darwin_arm64.a
*/
import "C"

Then verify whether everything works by running make test. If all tests pass, then make a pull request with the added files libzstd_darwin_arm64.a and libzstd_darwin_arm64.go

petersondmg commented 3 years ago
package gozstd

/*
#cgo LDFLAGS: ${SRCDIR}/libzstd_darwin_arm64.a
*/
import "C"

Hello, I have the some problema with my M1. I followed the steps you described and all tests worked.

valyala commented 3 years ago

The libzstd_darwin_arm64.a file has been included in v1.11.0. Closing the issue as done.