go-piv / piv-go

Keys and certificates for YubiKeys, written in Go
Apache License 2.0
368 stars 65 forks source link

Cross compiling for ARM #71

Closed bryfry closed 3 years ago

bryfry commented 4 years ago

I get the below error when trying to build the piv-go project to run on arm. Apologies if I am simply missing a dependency.

ubuntu@tmc:~/go/src/github.com/filosottile/yubikey-agent$ GOOS=linux GOARCH=arm GOARM=5 go build 
# github.com/go-piv/piv-go/piv
../../../../pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/piv.go:100:7: undefined: scContext
../../../../pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/piv.go:101:7: undefined: scHandle
../../../../pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/piv.go:102:7: undefined: scTx

ubuntu@tmc:~/go/pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv$ GOOS=linux GOARCH=arm GOARM=5 go build
# github.com/go-piv/piv-go/piv
./piv.go:100:7: undefined: scContext
./piv.go:101:7: undefined: scHandle
./piv.go:102:7: undefined: scTx
ericchiang commented 4 years ago

There are OS specific files that need to be added for this package to work for ARM. See the FreeBSD PR: https://github.com/go-piv/piv-go/pull/70

ghaithsabba commented 4 years ago

i had the same problem, so i try to compile it on arm alpine and i got the following error /go/pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/pcsc_linux.go:29:12: constant 2148532270 overflows _Ctype_long

philandstuff commented 4 years ago

@Ghaith0101 that sounds like the same error reported in #76

ghaithsabba commented 4 years ago

Actually it is exactly what you described in #76 i already forked the repo and currently I am testing it if it will work with windows and OS, then I will make a merge request

ostaebler commented 4 years ago

@Ghaith0101 Any news on the PR? I'm running in the same issue...

ghaithsabba commented 4 years ago

@ostaebler ishould be done with it this weekend, sorry for being late

ghaithsabba commented 4 years ago

81

flokli commented 4 years ago

This should be fixed by https://github.com/go-piv/piv-go/pull/81, shouldn't it?

ghaithsabba commented 4 years ago

Yes i tested it under

FROM i386/golang:1.15.2-buster
FROM arm32v7/golang:1.15.2-buster

and it built