SECP256K1_API are defined as __attribute__(visibility("default")), which might make sense compiling secp256k1 original as a dynamic library, but it makes less sense when it is wrapped in a nim library as it results in linker exporting all symbols marked with SECP256K1_API and SECP256K1_API_VAR, which in its turn prevents dead code elimination and grows the resulting binary size significantly (in case of wasm compilation it's ~ 1.5Mb). This PR introduces a better default, with an escape hatch (-d:secp256k1DefaultSymbolsExport).
SECP256K1_API
are defined as__attribute__(visibility("default"))
, which might make sense compiling secp256k1 original as a dynamic library, but it makes less sense when it is wrapped in a nim library as it results in linker exporting all symbols marked withSECP256K1_API
andSECP256K1_API_VAR
, which in its turn prevents dead code elimination and grows the resulting binary size significantly (in case of wasm compilation it's ~ 1.5Mb). This PR introduces a better default, with an escape hatch (-d:secp256k1DefaultSymbolsExport
).