Commit Graph

19 Commits

Author SHA1 Message Date
Elichai Turkel 7d3dc354d7
secp256k1-sys: Remove unused flags in build.rs 2022-11-24 13:38:40 +02:00
Matt Corallo 92b733386f Support non-WASM platforms that are missing `string.h`
Dunno why we haven't seen this elsewhere, but when trying to build
locally for an ARM embedded target `secp256k1-sys` failed to
compile as it was missing `string.h`, just like WASM.

This patch adds a trivial fallback - if we fail to compile
initially we unconditionally retry with the wasm-sysroot, giving us
a valid `string.h`.
2022-10-06 16:23:27 +00:00
Tobin Harding bfd88dbd6c Move WASM const definitions to a source file
Currently we are defining the WASM integer size and alignments in the
`stdio.h` header file, this is wrong because this file is included in
the build by way of `build.rs` as well as by upstream `libsecp256k1`.

Move WASM integer definitions to a `C` source file and build the file
into the binary if target is WASM.
2022-03-30 10:22:37 +11:00
Andrew Poelstra 8294ea3f50 secp256k1-sys: update upstream library
Two API changes needed to be reflected: schnorrsig_sign and schnorrsig_verify.

Also bump both Cargo.toml files
2022-03-08 19:45:41 +00:00
Riccardo Casatta 505b04df49
Reduce size of precomputed signing table (ECMULT_GEN_PREC_BITS) for lowmemory 2021-07-21 11:34:47 +02:00
Elichai Turkel 70847e6165
Remove SECP256K1_BUILD as its no longer needed 2021-06-30 16:56:12 +03:00
Matt Corallo ee1103a1f3 Reduce visibility on secp-sys symbols
cc-rs builds C dependencies with reduced visibility to avoid
exporting the C symbols all the way out to any rust-built shared
libraries however we override it with SECP256K1_API. We should
avoid doing this, allowing LTO/DCE to do its work.
2021-04-07 11:21:16 -04:00
Kirill Fomichev 0a91f2ba2b
Use CARGO_CFG_TARGET_ARCH instead TARGET in build.rs 2021-03-08 22:54:21 +03:00
Andrew Poelstra 58f946fcc8 secp-sys: remove now-unneeded endianness check from build.rs 2020-12-29 17:15:56 +00:00
Andrew Poelstra e687622a81 bump secp-sys version; drop endomorphism flag 2020-12-29 17:15:56 +00:00
Andrew Poelstra d77483f00e replace cargo `external-symbols` feature with a rustc --cfg flag
This feature was not useful for Cargo users, since Cargo does not give you
the kind of fine-grained control over C library linkage that you need. So
it was just unnecessarily confusing and would cause the build to break if
you enabled it accidentally, say, with --all-features.
2020-12-22 15:35:16 +00:00
Tibo-lg 45a4459baf Update secp256k1-sys to add schnorr/extra-keys 2020-11-09 16:00:28 +09:00
Matt Corallo 3a2dba0e7f Use wasm sysroot for wasm32-wasi target as well 2020-10-05 16:14:36 -04:00
Andrew Poelstra 1a9aece312 secp256k1-sys: update upstream to 670cdd3f8be25f81472b2d16dcd228b0d24a5c45 2020-08-26 18:07:41 +00:00
Tim Ruffing 489e3ff8d2
Define ECMULT_GEN_PREC_BITS
This is configurable in upstream now.

Fixes #214.

So far, this just sets it to `4`. It's tempting to set it to `2` when `lowmemory` is enabled
but `lowmemory` is about RAM and not about binary size. This is better addressed by
a resolution of #193.
2020-05-13 10:40:39 +02:00
Matt Corallo d9d398ccc9 Re-support WASM via simple stub headers
libsecp256k1 really only barely uses libc at all, and in practice,
things like memcpy/memcmp get optimized into something other than a
libc call. Thus, if we provide simple stub headers, things seem to
work with wasm-pack just fine.
2020-04-29 15:32:54 -04:00
Elichai Turkel 2f897d8a93
Removed no longer used dont_replace_c_symbols feature 2020-02-09 16:37:59 +02:00
Steven Roose bf3fba71cb
Add external-symbols feature to support external libsecp
This feature disables using the bundles sources and will link into
existing libsecp256k1 symbols.
2019-11-27 21:04:32 +00:00
Steven Roose 724c49fff9
Add secp256k1-sys 2019-11-27 21:02:42 +00:00
Renamed from build.rs (Browse further)