-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support for linux armv7 #114
Comments
You'd have to add a build tag to one of the pcsc_*.go files, and potentially fix some of the cgo declarations https://github.com/go-piv/piv-go/tree/master/piv I don't have an arm7 device to test, so I haven't added the tags. Feel free to send a PR! |
If anyone else comes across this issue, here is how I was able to build for linux arm in CI on debian 11. First need to install the required packages (this is on an x86 host): apt-get update && apt-get install -y gcc gcc-aarch64-linux-gnu pkg-config pcscd pcsc-tools libpcsclite-dev
# For linux arm64 builds, we need the arm64 libs for the aarch64 gcc compiler
dpkg --add-architecture arm64 && apt-get update && apt-get install -y --no-install-recommends libpcsclite-dev:arm64 Then my goreleaser file ( project_name: project
release:
disable: true
builds:
- binary: "{{.ProjectName}}"
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
- arm64
ldflags:
- -X main.Version={{.Version}}
flags:
- -a
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- CGO_ENABLED=1
archives:
- name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}_{{.Arch}}"
format: tar.gz
snapshot:
name_template: "{{ .Tag }}-next" |
Good, thanks |
I want to build this project to linux armv7 device
cmd: env GOOS=linux GOARCH=arm GOARM=7 go build
got errors:
.../github.com/go-piv/piv-go@v1.10.0/piv/piv.go:103:7: undefined: scContext
.../github.com/go-piv/piv-go@v1.10.0/piv/piv.go:104:7: undefined: scHandle
.../github.com/go-piv/piv-go@v1.10.0/piv/piv.go:105:7: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:521:19: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:614:29: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:668:24: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:773:59: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:929:22: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:1085:22: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:1130:24: undefined: scTx
.../github.com/go-piv/piv-go@v1.10.0/piv/key.go:1130:24: too many errors
The text was updated successfully, but these errors were encountered: