From 0ac767f82f12f4c5457f0ccb59e79dc2edad6807 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Tue, 5 Nov 2024 12:19:28 -0500 Subject: [PATCH] s2n-bignum symbols are now prefixed --- aws-lc-sys/builder/cc_builder.rs | 20 ++++++++++++++++---- scripts/build/collect_symbols.sh | 2 +- scripts/generate/_collect_symbols_build.sh | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/aws-lc-sys/builder/cc_builder.rs b/aws-lc-sys/builder/cc_builder.rs index e98b045c8be..ac7f90625d5 100644 --- a/aws-lc-sys/builder/cc_builder.rs +++ b/aws-lc-sys/builder/cc_builder.rs @@ -194,14 +194,26 @@ impl CcBuilder { fn add_includes(&self, cc_build: &mut cc::Build) { // The order of includes matters if let Some(prefix) = &self.build_prefix { - cc_build - .define("BORINGSSL_IMPLEMENTATION", "1") - .define("BORINGSSL_PREFIX", prefix.as_str()); - cc_build.include(self.manifest_dir.join("generated-include")); + cc_build.define("BORINGSSL_PREFIX", prefix.as_str()); + let prefix_include_dir = self.manifest_dir.join("generated-include").join("openssl"); + cc_build.flag(format!( + "--include={}", + prefix_include_dir + .join("boringssl_prefix_symbols.h") + .display() + )); + cc_build.flag(format!( + "--include={}", + prefix_include_dir + .join("boringssl_prefix_symbols_asm.h") + .display() + )); } cc_build + .define("BORINGSSL_IMPLEMENTATION", "1") .include(self.manifest_dir.join("include")) .include(self.manifest_dir.join("aws-lc").join("include")) + .define("S2N_BN_HIDE_SYMBOLS", "1") .include( self.manifest_dir .join("aws-lc") diff --git a/scripts/build/collect_symbols.sh b/scripts/build/collect_symbols.sh index 63de9c33a03..d91fe9620da 100755 --- a/scripts/build/collect_symbols.sh +++ b/scripts/build/collect_symbols.sh @@ -57,7 +57,7 @@ if [[ ! -d "${AWS_LC_DIR}" ]]; then fi function filter_symbols() { - grep -E '^\w*$' | grep -v -E "^bignum_" | grep -v "curve25519_x25519" | grep -v "edwards25519_" | grep -v "p256_montjscalarmul" + grep -E '^\w*$' } function filter_nm_symbols() { diff --git a/scripts/generate/_collect_symbols_build.sh b/scripts/generate/_collect_symbols_build.sh index fc4e13fab68..ebbe046f7be 100755 --- a/scripts/generate/_collect_symbols_build.sh +++ b/scripts/generate/_collect_symbols_build.sh @@ -20,7 +20,7 @@ function cmake_build_options() { } function filter_symbols() { - grep -v "^_\?bignum_" | grep -v "_\?curve25519_x25519" | grep -v "_\?edwards25519_" | grep -v "_\?p256_montjscalarmul" + cat - } REPO_ROOT=$(git rev-parse --show-toplevel)