Error while running make command using Fabric 1.0.6

0 votes

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command like this:

Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2       org.hyperledger.fabric.base.version=0.3.2
 ---> Running in ed05a67810db
Removing intermediate container ed05a67810db
 ---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1


Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jun 26, 2018 in Blockchain by Johnathon
• 9,080 points
122 views

1 answer to this question.

0 votes

It's a known issue in go 1.9.4: https://github.com/golang/go/issues/23739

While go people are fixing it, you can manually do it by whitelisting the flags before starting make:

$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make

Alternatively you can just downgrade to go 1.9.3

Hope this helps.

answered Jun 26, 2018 by Perry
• 17,020 points

Related Questions In Blockchain

+1 vote
1 answer
0 votes
1 answer

Error while running curl command in Docker Quickstart Terminal

You can get the new version of ...READ MORE

answered Jul 12, 2018 in Blockchain by slayer
• 29,170 points
361 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
86 views
+1 vote
1 answer
0 votes
1 answer