go-crypto icon indicating copy to clipboard operation
go-crypto copied to clipboard

attempting to compile keybase go-crypto on

Open omac777 opened this issue 8 years ago • 3 comments

Hi there, I am attempting to compile on a different cpu: Loongson-3B1500. Here is the last-core's cpuinfo:

processor : 5 cpu model : ICT Loongson-3 V0.7 FPU V0.1 model name : ICT Loongson-3B R2 (Loongson-3B1500) @ 1199MHz BogoMIPS : 956.04 wait instruction : no microsecond timers : yes tlb_entries : 64 extra interrupt vector : no hardware watchpoint : yes, count: 0, address/irw mask: [] isa : mips1 mips2 mips3 mips4 mips5 mips32r1 mips64r1 ASEs implemented : shadow register sets : 1 kscratch registers : 0 package : 0 core : 7 VCED exceptions : not available VCEI exceptions : not available

It's currently on a fedora 21 distro. I tried to compile golang 1.6 on it, but unsuccessful. I am using a fc21 gcc-go go version go version xgcc (GCC) 4.9.3 20150626 (Red Hat 4.9.3-3) linux/mipsn64

[root@sunhaiyong bcrypt]# uname -a Linux sunhaiyong 4.1.19-1.fc21.loongson.1.mips64el #1 SMP PREEMPT Tue Mar 8 07:47:34 UTC 2016 mips64 mips64 mips64 GNU/Linux

LANG=en_US.UTF-8 GOPATH=/root/Code GOROOT=/root/loongson-golang MACHTYPE=mips64el-redhat-linux-gnu PATH=/sbin:/bin:/usr/sbin:/usr/bin:/root/loongson-golang/bin:/root/Code/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/root/bin

[root@sunhaiyong ~]# cd Code/src/github.com/omac777/ [root@sunhaiyong omac777]# go build hello.go [root@sunhaiyong omac777]# ./hello Hello, 世界

mkdir -p /root/Code/src/golang.org/x

these are the go1.6 sources that I was unable to compile entirely. I am just copying the crypto component to see if I can get away with just that and compile it. The answer seems to be no.

cp -Rf /root/go/src/crypto/ . go get github.com/keybase/go-crypto cd ~/Code/src/golang.org/x/crypto# cp -rf ../../../github.com/keybase/go-crypto/* .

cd ~/Code/src/github.com/keybase/go-crypto/tea cd ~/Code/src/github.com/keybase/go-crypto/twofish cd ~/Code/src/github.com/keybase/go-crypto/xtea cd ~/Code/src/github.com/keybase/go-crypto/xts cd ~/Code/src/github.com/keybase/go-crypto/sha3 cd ~/Code/src/github.com/keybase/go-crypto/salsa20/salsa ~/Code/src/golang.org/x/crypto/salsa20# go build ~/Code/src/golang.org/x/crypto/salsa20# go install

root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/scrypt# cd ~/Code/src/golang.org/x/crypto/ root@sunhaiyong:~/Code/src/golang.org/x/crypto# cp -Rf ~/Code/src/github.com/keybase/go-crypto/pbkdf2/ . root@sunhaiyong:~/Code/src/golang.org/x/crypto# cd pbkdf2/ root@sunhaiyong:~/Code/src/golang.org/x/crypto/pbkdf2# go build root@sunhaiyong:~/Code/src/golang.org/x/crypto/pbkdf2# go install

root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/rsa# go build

github.com/keybase/go-crypto/rsa

./rsa.go:97:63: error: reference to undefined identifier ‘crypto.SignerOpts’ func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error) { ^ ./rsa.go:108:73: error: reference to undefined identifier ‘crypto.DecrypterOpts’ func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) {

root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/ssh# go build

github.com/keybase/go-crypto/ssh

./keys.go:556:7: error: reference to undefined identifier ‘crypto.Signer’ case crypto.Signer: ^ ./keys.go:566:9: error: reference to undefined identifier ‘crypto.Signer’ signer crypto.Signer ^ ./keys.go:573:33: error: reference to undefined identifier ‘crypto.Signer’ func NewSignerFromSigner(signer crypto.Signer) (Signer, error) { ^ ./keys.go:579:9: error: incompatible type for return value 1 (type has no methods) return &wrappedSigner{signer, pubKey}, nil ^

root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/pkcs12# go build

github.com/keybase/go-crypto/pkcs12

./crypto.go:75:72: error: reference to undefined field or method ‘String’ return nil, 0, NotImplementedError("algorithm " + algorithm.Algorithm.String() + " is not supported") ^ ./mac.go:32:92: error: reference to undefined field or method ‘String’ return NotImplementedError("unknown digest algorithm: " + macData.Mac.Algorithm.Algorithm.String()) ^ ./pkcs12.go:165:82: error: reference to undefined field or method ‘String’ return nil, errors.New("don't know how to convert a safe bag of type " + bag.Id.String()) ^ ./pkcs12.go:184:81: error: reference to undefined field or method ‘String’ return "", "", errors.New("pkcs12: unknown attribute with OID " + attribute.Id.String()) ^ root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/openpgp# go build

github.com/keybase/go-crypto/rsa

../rsa/rsa.go:97:63: error: reference to undefined identifier ‘crypto.SignerOpts’ func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error) { ^ ../rsa/rsa.go:108:73: error: reference to undefined identifier ‘crypto.DecrypterOpts’ func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) { ^ root@sunhaiyong:~/Code/src/github.com/keybase/go-crypto/ocsp# go build

github.com/keybase/go-crypto/ocsp

./ocsp.go:199:17: error: reference to undefined identifier ‘elliptic.P224’ case elliptic.P224(), elliptic.P256(): ^ ./ocsp.go:574:86: error: reference to undefined identifier ‘crypto.Signer’ func CreateResponse(issuer, responderCert *x509.Certificate, template Response, priv crypto.Signer) ([]byte, error) {

Judging by the compile errors, I believe I certainly don't have the right environment setup yet to build keybase/go-crypto. I also believe I am not going through the correct steps to compile it correctly.

The hints are I really do need go1.6 installed since crypto.Signer and elliptic.P224 are part of go1.6.

omac777 avatar Mar 13 '16 19:03 omac777

I don't think this fork depends on Go 1.6, but it does depend on the standard crypto library. If you're compiling the Go standard libs yourself and seeing errors, my guess is that the problem lies there. Some of the subdirectories also have dependencies of their own, so running go get github.com/keybase/go-crypto is not sufficient. You should make sure to run go get in every subdirectory where you're about to run go build.

oconnor663 avatar Mar 14 '16 18:03 oconnor663

I believe there is a dependency on Go 1.5 stdlib at least (though probably nothing specifically from Go 1.6).

I would recommend that you try compiling Go 1.6 (or 1.5) from source, using your installed version to bootstrap.

Follow the instructions here and set GOROOT_BOOTSTRAP appropriately to your existing Go 1.4 installation.

0xhaven avatar Mar 14 '16 20:03 0xhaven

Mr. Haven,

The go version was stated as being a redhat gcc-go version 4.9 something. I attempted to compile as you said before even trying your crypto code, go 1.6 with the gcc-go but it failed.

I'll try compiling go 1.5 with the gcc-go on fedora 21. I can't update anything fedora often because the great firewall of China doesn't allow me to get much data speed and I'm limited to mirrors in China for the loongson-3 cpu stuff. Mirrors for Loongson-3 cpu stuff outside of China for fedora would greatly alleviate the situation, but it's a touchy subject for loongson-3 stuff for some reasson.

On 03/14/2016 04:41 PM, Jacob H. Haven wrote:

I believe there is a dependency on Go 1.5 stdlib at least (though probably nothing specifically from Go 1.6).

I would recommend that you try compiling Go 1.6 (or 1.5) from source, using your installed version to bootstrap.

Follow the instructions here and set GOROOT_BOOTSTRAP appropriately to your existing Go 1.4 installation.


Reply to this email directly or view it on GitHub: https://github.com/keybase/go-crypto/issues/19#issuecomment-196513368

omac777 avatar Mar 14 '16 22:03 omac777