Skip to content

Commit

Permalink
docs: cgo secp256k1 ldflags (#18357)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
  • Loading branch information
JulianToledano and tac0turtle authored Nov 3, 2023
1 parent f3c55dc commit 9c2f464
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crypto/keys/secp256k1/internal/secp256k1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,17 @@
This package is copied from https://github.com/ethereum/go-ethereum/tree/8fddf27a989e246659fd018ea9be37b2b4f55326/crypto/secp256k1

Unlike the rest of go-ethereum it is [3-clause BSD](https://opensource.org/licenses/BSD-3-Clause) licensed so compatible with our Apache2.0 license. We opt to copy in here rather than depend on go-ethereum to avoid issues with vendoring of the GPL parts of that repository by downstream.

## Duplicate Symbols

If a project is importing [go-ethereum](https://github.com/ethereum/go-ethereum) and the Cosmos SDK, cgo secp256k1 will only work on linux operating systems due to duplicated symbols. If you are testing on a mac, we recommend using a docker container or something similar.

To avoid duplicate symbol errors `ldflags` must be set to allow for multiple definitions.

#### Gcc

+ `go build -tags libsecp256k1_sdk -ldflags=all="-extldflags=-Wl,--allow-multiple-definition"`

#### Clang

+ `go build -tags libsecp256k1_sdk -ldflags=all="-extldflags=-zmuldefs"`

0 comments on commit 9c2f464

Please sign in to comment.