Skip to content

Commit 4dee200

Browse files
committed
Merge pull request bnb-chain#2037 from fjl/no-libgmp
crypto/secp256k1: remove dependency on libgmp
2 parents fece1fa + 02356b3 commit 4dee200

5 files changed

Lines changed: 15 additions & 52 deletions

File tree

‎.travis.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ env:
2020
global:
2121
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="
2222
sudo: false
23-
addons:
24-
apt:
25-
packages:
26-
- libgmp3-dev
2723
notifications:
2824
webhooks:
2925
urls:

‎Makefile‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
GOBIN = build/bin
1414

15-
CROSSDEPS = https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
1615
MODE ?= default
1716
GO ?= latest
1817

@@ -30,12 +29,12 @@ geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm
3029
@ls -l $(GOBIN)/geth-linux-*
3130

3231
geth-linux-386: xgo
33-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
32+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
3433
@echo "Linux 386 cross compilation done:"
3534
@ls -l $(GOBIN)/geth-linux-* | grep 386
3635

3736
geth-linux-amd64: xgo
38-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
37+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
3938
@echo "Linux amd64 cross compilation done:"
4039
@ls -l $(GOBIN)/geth-linux-* | grep amd64
4140

@@ -44,22 +43,22 @@ geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-ar
4443
@ls -l $(GOBIN)/geth-linux-* | grep arm
4544

4645
geth-linux-arm-5: xgo
47-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/geth
46+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/geth
4847
@echo "Linux ARMv5 cross compilation done:"
4948
@ls -l $(GOBIN)/geth-linux-* | grep arm-5
5049

5150
geth-linux-arm-6: xgo
52-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth
51+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth
5352
@echo "Linux ARMv6 cross compilation done:"
5453
@ls -l $(GOBIN)/geth-linux-* | grep arm-6
5554

5655
geth-linux-arm-7: xgo
57-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth
56+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth
5857
@echo "Linux ARMv7 cross compilation done:"
5958
@ls -l $(GOBIN)/geth-linux-* | grep arm-7
6059

6160
geth-linux-arm64: xgo
62-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth
61+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth
6362
@echo "Linux ARM64 cross compilation done:"
6463
@ls -l $(GOBIN)/geth-linux-* | grep arm64
6564

@@ -68,12 +67,12 @@ geth-darwin: geth-darwin-386 geth-darwin-amd64
6867
@ls -l $(GOBIN)/geth-darwin-*
6968

7069
geth-darwin-386: xgo
71-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
70+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
7271
@echo "Darwin 386 cross compilation done:"
7372
@ls -l $(GOBIN)/geth-darwin-* | grep 386
7473

7574
geth-darwin-amd64: xgo
76-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
75+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
7776
@echo "Darwin amd64 cross compilation done:"
7877
@ls -l $(GOBIN)/geth-darwin-* | grep amd64
7978

@@ -82,17 +81,17 @@ geth-windows: geth-windows-386 geth-windows-amd64
8281
@ls -l $(GOBIN)/geth-windows-*
8382

8483
geth-windows-386: xgo
85-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
84+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
8685
@echo "Windows 386 cross compilation done:"
8786
@ls -l $(GOBIN)/geth-windows-* | grep 386
8887

8988
geth-windows-amd64: xgo
90-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
89+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
9190
@echo "Windows amd64 cross compilation done:"
9291
@ls -l $(GOBIN)/geth-windows-* | grep amd64
9392

9493
geth-android: xgo
95-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=android/* -v $(shell build/flags.sh) ./cmd/geth
94+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=android/* -v $(shell build/flags.sh) ./cmd/geth
9695
@echo "Android cross compilation done:"
9796
@ls -l $(GOBIN)/geth-android-*
9897

@@ -101,12 +100,12 @@ geth-ios: geth-ios-arm-7 geth-ios-arm64
101100
@ls -l $(GOBIN)/geth-ios-*
102101

103102
geth-ios-arm-7: xgo
104-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --depsargs=--disable-assembly --targets=ios/arm-7 -v $(shell build/flags.sh) ./cmd/geth
103+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios/arm-7 -v $(shell build/flags.sh) ./cmd/geth
105104
@echo "iOS ARMv7 cross compilation done:"
106105
@ls -l $(GOBIN)/geth-ios-* | grep arm-7
107106

108107
geth-ios-arm64: xgo
109-
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --deps=$(CROSSDEPS) --depsargs=--disable-assembly --targets=ios-7.0/arm64 -v $(shell build/flags.sh) ./cmd/geth
108+
build/env.sh $(GOBIN)/xgo --go=$(GO) --buildmode=$(MODE) --dest=$(GOBIN) --targets=ios-7.0/arm64 -v $(shell build/flags.sh) ./cmd/geth
110109
@echo "iOS ARM64 cross compilation done:"
111110
@ls -l $(GOBIN)/geth-ios-* | grep arm64
112111

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For prerequisites and detailed build instructions please read the
3030
[Installation Instructions](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum)
3131
on the wiki.
3232

33-
Building geth requires two external dependencies, Go and GMP.
33+
Building geth requires both a Go and a C compiler.
3434
You can install them using your favourite package manager.
3535
Once the dependencies are installed, run
3636

‎crypto/secp256k1/README.md‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎crypto/secp256k1/secp256.go‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ package secp256k1
2121
/*
2222
#cgo CFLAGS: -I./libsecp256k1
2323
#cgo CFLAGS: -I./libsecp256k1/src/
24-
#cgo darwin CFLAGS: -I/usr/local/include
25-
#cgo freebsd CFLAGS: -I/usr/local/include
26-
#cgo linux,arm CFLAGS: -I/usr/local/arm/include
27-
#cgo LDFLAGS: -lgmp
28-
#cgo darwin LDFLAGS: -L/usr/local/lib
29-
#cgo freebsd LDFLAGS: -L/usr/local/lib
30-
#cgo linux,arm LDFLAGS: -L/usr/local/arm/lib
31-
#define USE_NUM_GMP
24+
#define USE_NUM_NONE
3225
#define USE_FIELD_10X26
3326
#define USE_FIELD_INV_BUILTIN
3427
#define USE_SCALAR_8X32

0 commit comments

Comments
 (0)