Skip to content

Commit

Permalink
s2n-bignum symbols are now prefixed
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Nov 5, 2024
1 parent 05f8a25 commit 0ac767f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/collect_symbols.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate/_collect_symbols_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ac767f

Please sign in to comment.