From ee1103a1f339367df36fe1c2cde8c454202d8a61 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 18 Mar 2021 15:23:28 -0400 Subject: [PATCH] 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. --- secp256k1-sys/build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/secp256k1-sys/build.rs b/secp256k1-sys/build.rs index 26869d9..8a2d7a5 100644 --- a/secp256k1-sys/build.rs +++ b/secp256k1-sys/build.rs @@ -33,6 +33,7 @@ fn main() { .include("depend/secp256k1/src") .flag_if_supported("-Wno-unused-function") // some ecmult stuff is defined but not used upstream .define("SECP256K1_BUILD", Some("1")) + .define("SECP256K1_API", Some("")) .define("ENABLE_MODULE_ECDH", Some("1")) .define("ENABLE_MODULE_SCHNORRSIG", Some("1")) .define("ENABLE_MODULE_EXTRAKEYS", Some("1"))