chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

809
vendor/aws-lc-sys/builder/cc_builder.rs vendored Normal file
View File

@@ -0,0 +1,809 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// NOTE: This module is intended to produce an equivalent "libcrypto" static library to the one
// produced by the CMake. Changes to CMake relating to compiler checks and/or special build flags
// may require modifications to the logic in this module.
mod apple_aarch64;
mod apple_x86_64;
mod linux_aarch64;
mod linux_arm;
mod linux_ppc64le;
mod linux_x86;
mod linux_x86_64;
mod universal;
mod win_aarch64;
mod win_x86;
mod win_x86_64;
use crate::nasm_builder::NasmBuilder;
use crate::{
cargo_env, disable_jitter_entropy, emit_warning, env_name_for_target, env_var_to_bool,
execute_command, get_crate_cc, get_crate_cflags, get_crate_cxx, is_no_asm, out_dir,
requested_c_std, set_env_for_target, target, target_arch, target_env, target_os, target_vendor,
test_clang_cl_command, CStdRequested, EnvGuard, OutputLibType,
};
use std::cell::Cell;
use std::collections::HashMap;
use std::path::PathBuf;
#[non_exhaustive]
#[derive(PartialEq, Eq)]
pub(crate) enum CompilerFeature {
NeonSha3,
}
pub(crate) struct CcBuilder {
manifest_dir: PathBuf,
out_dir: PathBuf,
build_prefix: Option<String>,
output_lib_type: OutputLibType,
compiler_features: Cell<Vec<CompilerFeature>>,
}
use std::fs;
fn identify_sources() -> Vec<&'static str> {
let mut source_files: Vec<&'static str> = vec![];
source_files.append(&mut Vec::from(universal::CRYPTO_LIBRARY));
let mut target_specific_source_found = true;
if target_os() == "windows" {
if target_arch() == "x86_64" {
source_files.append(&mut Vec::from(win_x86_64::CRYPTO_LIBRARY));
} else if target_arch() == "aarch64" {
source_files.append(&mut Vec::from(win_aarch64::CRYPTO_LIBRARY));
} else if target_arch() == "x86" {
source_files.append(&mut Vec::from(win_x86::CRYPTO_LIBRARY));
} else {
target_specific_source_found = false;
}
} else if target_vendor() == "apple" {
if target_arch() == "x86_64" {
source_files.append(&mut Vec::from(apple_x86_64::CRYPTO_LIBRARY));
} else if target_arch() == "aarch64" {
source_files.append(&mut Vec::from(apple_aarch64::CRYPTO_LIBRARY));
} else {
target_specific_source_found = false;
}
} else if target_arch() == "x86_64" {
source_files.append(&mut Vec::from(linux_x86_64::CRYPTO_LIBRARY));
} else if target_arch() == "aarch64" {
source_files.append(&mut Vec::from(linux_aarch64::CRYPTO_LIBRARY));
} else if target_arch() == "arm" {
source_files.append(&mut Vec::from(linux_arm::CRYPTO_LIBRARY));
} else if target_arch() == "x86" {
source_files.append(&mut Vec::from(linux_x86::CRYPTO_LIBRARY));
} else if target_arch() == "powerpc64" {
source_files.append(&mut Vec::from(linux_ppc64le::CRYPTO_LIBRARY));
} else {
target_specific_source_found = false;
}
if !target_specific_source_found {
emit_warning(format!(
"No target-specific source found: {}-{}",
target_os(),
target_arch()
));
}
source_files
}
#[allow(clippy::upper_case_acronyms)]
pub(crate) enum BuildOption {
STD(String),
FLAG(String),
DEFINE(String, String),
INCLUDE(PathBuf),
}
impl BuildOption {
fn std<T: ToString + ?Sized>(val: &T) -> Self {
Self::STD(val.to_string())
}
fn flag<T: ToString + ?Sized>(val: &T) -> Self {
Self::FLAG(val.to_string())
}
fn flag_if_supported<T: ToString + ?Sized>(cc_build: &cc::Build, flag: &T) -> Option<Self> {
if let Ok(true) = cc_build.is_flag_supported(flag.to_string()) {
Some(Self::FLAG(flag.to_string()))
} else {
None
}
}
fn define<K: ToString + ?Sized, V: ToString + ?Sized>(key: &K, val: &V) -> Self {
Self::DEFINE(key.to_string(), val.to_string())
}
fn include<P: Into<PathBuf>>(path: P) -> Self {
Self::INCLUDE(path.into())
}
fn apply_cc<'a>(&self, cc_build: &'a mut cc::Build) -> &'a mut cc::Build {
match self {
BuildOption::STD(val) => cc_build.std(val),
BuildOption::FLAG(val) => cc_build.flag(val),
BuildOption::DEFINE(key, val) => cc_build.define(key, Some(val.as_str())),
BuildOption::INCLUDE(path) => cc_build.include(path.as_path()),
}
}
pub(crate) fn apply_cmake<'a>(
&self,
cmake_cfg: &'a mut cmake::Config,
is_like_msvc: bool,
) -> &'a mut cmake::Config {
if is_like_msvc {
match self {
BuildOption::STD(val) => cmake_cfg.define(
"CMAKE_C_STANDARD",
val.to_ascii_lowercase().strip_prefix('c').unwrap_or("11"),
),
BuildOption::FLAG(val) => cmake_cfg.cflag(val),
BuildOption::DEFINE(key, val) => cmake_cfg.cflag(format!("/D{key}={val}")),
BuildOption::INCLUDE(path) => cmake_cfg.cflag(format!("/I{}", path.display())),
}
} else {
match self {
BuildOption::STD(val) => cmake_cfg.define(
"CMAKE_C_STANDARD",
val.to_ascii_lowercase().strip_prefix('c').unwrap_or("11"),
),
BuildOption::FLAG(val) => cmake_cfg.cflag(val),
BuildOption::DEFINE(key, val) => cmake_cfg.cflag(format!("-D{key}={val}")),
BuildOption::INCLUDE(path) => cmake_cfg.cflag(format!("-I{}", path.display())),
}
}
}
pub(crate) fn apply_nasm<'a>(&self, nasm_builder: &'a mut NasmBuilder) -> &'a mut NasmBuilder {
match self {
BuildOption::FLAG(val) => nasm_builder.flag(val),
BuildOption::DEFINE(key, val) => nasm_builder.define(key, Some(val.as_str())),
BuildOption::INCLUDE(path) => nasm_builder.include(path.as_path()),
BuildOption::STD(_) => nasm_builder, // STD ignored for NASM
}
}
}
impl CcBuilder {
pub(crate) fn new(
manifest_dir: PathBuf,
out_dir: PathBuf,
build_prefix: Option<String>,
output_lib_type: OutputLibType,
) -> Self {
Self {
manifest_dir,
out_dir,
build_prefix,
output_lib_type,
compiler_features: Cell::new(vec![]),
}
}
pub(crate) fn collect_universal_build_options(
&self,
cc_build: &cc::Build,
do_quote_paths: bool,
) -> (bool, Vec<BuildOption>) {
let mut build_options: Vec<BuildOption> = Vec::new();
let compiler_is_msvc = {
let compiler = cc_build.get_compiler();
!compiler.is_like_gnu() && !compiler.is_like_clang()
};
match requested_c_std() {
CStdRequested::C99 => {
build_options.push(BuildOption::std("c99"));
}
CStdRequested::C11 => {
build_options.push(BuildOption::std("c11"));
}
CStdRequested::None => {
if !compiler_is_msvc {
if self.compiler_check("c11", Vec::<String>::new()) {
build_options.push(BuildOption::std("c11"));
} else {
build_options.push(BuildOption::std("c99"));
}
}
}
}
if let Some(cc) = get_crate_cc() {
set_env_for_target("CC", &cc);
}
if let Some(cxx) = get_crate_cxx() {
set_env_for_target("CXX", &cxx);
}
if target_arch() == "x86" && !compiler_is_msvc {
if let Some(option) = BuildOption::flag_if_supported(cc_build, "-msse2") {
build_options.push(option);
}
}
if target_os() == "macos" || target_os() == "darwin" {
// Certain MacOS system headers are guarded by _POSIX_C_SOURCE and _DARWIN_C_SOURCE
build_options.push(BuildOption::define("_DARWIN_C_SOURCE", "1"));
}
let opt_level = cargo_env("OPT_LEVEL");
match opt_level.as_str() {
"0" | "1" | "2" => {
if is_no_asm() {
emit_warning("AWS_LC_SYS_NO_ASM found. Disabling assembly code usage.");
build_options.push(BuildOption::define("OPENSSL_NO_ASM", "1"));
}
}
_ => {
assert!(
!is_no_asm(),
"AWS_LC_SYS_NO_ASM only allowed for debug builds!"
);
if !compiler_is_msvc {
let path_str = if do_quote_paths {
format!("\"{}\"", self.manifest_dir.display())
} else {
format!("{}", self.manifest_dir.display())
};
let flag = format!("-ffile-prefix-map={path_str}=");
if let Ok(true) = cc_build.is_flag_supported(&flag) {
emit_warning(format!("Using flag: {}", &flag));
build_options.push(BuildOption::flag(&flag));
} else {
emit_warning("NOTICE: Build environment source paths might be visible in release binary.");
let flag = format!("-fdebug-prefix-map={path_str}=");
if let Ok(true) = cc_build.is_flag_supported(&flag) {
emit_warning(format!("Using flag: {}", &flag));
build_options.push(BuildOption::flag(&flag));
}
}
}
}
}
if target_os() == "macos" {
// This compiler error has only been seen on MacOS x86_64:
// ```
// clang: error: overriding '-mmacosx-version-min=13.7' option with '--target=x86_64-apple-macosx14.2' [-Werror,-Woverriding-t-option]
// ```
if let Some(option) =
BuildOption::flag_if_supported(cc_build, "-Wno-overriding-t-option")
{
build_options.push(option);
}
if let Some(option) = BuildOption::flag_if_supported(cc_build, "-Wno-overriding-option")
{
build_options.push(option);
}
}
(compiler_is_msvc, build_options)
}
pub fn collect_cc_only_build_options(&self, cc_build: &cc::Build) -> Vec<BuildOption> {
let mut build_options: Vec<BuildOption> = Vec::new();
let is_like_msvc = {
let compiler = cc_build.get_compiler();
!compiler.is_like_gnu() && !compiler.is_like_clang()
};
if !is_like_msvc {
build_options.push(BuildOption::flag("-Wno-unused-parameter"));
build_options.push(BuildOption::flag("-pthread"));
if target_os() == "linux" {
build_options.push(BuildOption::define("_XOPEN_SOURCE", "700"));
} else if target_vendor() != "apple" {
// Needed by illumos
build_options.push(BuildOption::define("__EXTENSIONS__", "1"));
}
}
if Some(true) == disable_jitter_entropy() {
build_options.push(BuildOption::define("DISABLE_CPU_JITTER_ENTROPY", "1"));
}
self.add_includes(&mut build_options);
self.add_defines(&mut build_options, is_like_msvc);
build_options
}
fn add_includes(&self, build_options: &mut Vec<BuildOption>) {
// The order of includes matters
if let Some(prefix) = &self.build_prefix {
build_options.push(BuildOption::define("BORINGSSL_IMPLEMENTATION", "1"));
build_options.push(BuildOption::define("BORINGSSL_PREFIX", prefix.as_str()));
build_options.push(BuildOption::include(
self.manifest_dir.join("generated-include"),
));
}
build_options.push(BuildOption::include(self.manifest_dir.join("include")));
build_options.push(BuildOption::include(
self.manifest_dir.join("aws-lc").join("include"),
));
build_options.push(BuildOption::include(
self.manifest_dir
.join("aws-lc")
.join("third_party")
.join("s2n-bignum")
.join("include"),
));
build_options.push(BuildOption::include(
self.manifest_dir
.join("aws-lc")
.join("third_party")
.join("s2n-bignum")
.join("s2n-bignum-imported")
.join("include"),
));
if Some(true) != disable_jitter_entropy() {
build_options.push(BuildOption::include(
self.manifest_dir
.join("aws-lc")
.join("third_party")
.join("jitterentropy")
.join("jitterentropy-library"),
));
}
}
pub fn create_builder(&self) -> cc::Build {
let mut cc_build = cc::Build::new();
let build_options = self.collect_cc_only_build_options(&cc_build);
for option in build_options {
option.apply_cc(&mut cc_build);
}
cc_build
}
pub fn prepare_builder(&self) -> cc::Build {
if let Some(cflags) = get_crate_cflags() {
set_env_for_target("CFLAGS", cflags);
}
let mut cc_build = self.create_builder();
let (_, build_options) = self.collect_universal_build_options(&cc_build, false);
for option in build_options {
option.apply_cc(&mut cc_build);
}
// Add --noexecstack flag for assembly files to prevent executable stacks
// This matches the behavior of AWS-LC's CMake build which uses -Wa,--noexecstack
// See: https://github.com/aws/aws-lc/blob/main/crypto/CMakeLists.txt#L77
if target_os() == "linux" || target_os().ends_with("bsd") {
cc_build.asm_flag("-Wa,--noexecstack");
}
cc_build
}
#[allow(clippy::zero_sized_map_values)]
fn build_s2n_bignum_source_feature_map() -> HashMap<String, CompilerFeature> {
let mut source_feature_map: HashMap<String, CompilerFeature> = HashMap::new();
source_feature_map.insert("sha3_keccak_f1600_alt.S".into(), CompilerFeature::NeonSha3);
source_feature_map.insert("sha3_keccak2_f1600.S".into(), CompilerFeature::NeonSha3);
source_feature_map.insert(
"sha3_keccak4_f1600_alt2.S".into(),
CompilerFeature::NeonSha3,
);
source_feature_map
}
#[allow(clippy::unused_self)]
fn add_defines(&self, build_options: &mut Vec<BuildOption>, is_like_msvc: bool) {
// WIN32_LEAN_AND_MEAN and NOMINMAX are needed for all Windows targets to avoid
// header type definition errors, no matter the compiler. This matches the behavior
// in aws-lc/CMakeLists.txt, which defines these for all WIN32 targets
if target_os() == "windows" {
build_options.push(BuildOption::define("WIN32_LEAN_AND_MEAN", ""));
build_options.push(BuildOption::define("NOMINMAX", ""));
}
if is_like_msvc {
build_options.push(BuildOption::define("_HAS_EXCEPTIONS", "0"));
build_options.push(BuildOption::define("_CRT_SECURE_NO_WARNINGS", "0"));
build_options.push(BuildOption::define(
"_STL_EXTRA_DISABLED_WARNINGS",
"4774 4987",
));
if target().ends_with("-win7-windows-msvc") {
// 0x0601 is the value of `_WIN32_WINNT_WIN7`
build_options.push(BuildOption::define("_WIN32_WINNT", "0x0601"));
emit_warning(format!(
"Setting _WIN32_WINNT to _WIN32_WINNT_WIN7 for {} target",
target()
));
}
}
}
fn prepare_jitter_entropy_builder(&self, is_like_msvc: bool) -> cc::Build {
// See: https://github.com/aws/aws-lc/blob/2294510cd0ecb2d5946461e3dbb038363b7b94cb/third_party/jitterentropy/CMakeLists.txt#L19-L35
let mut build_options: Vec<BuildOption> = Vec::new();
self.add_includes(&mut build_options);
self.add_defines(&mut build_options, is_like_msvc);
let mut je_builder = cc::Build::new();
for option in build_options {
option.apply_cc(&mut je_builder);
}
je_builder.define("AWSLC", "1");
if target_os() == "macos" || target_os() == "darwin" {
// Certain MacOS system headers are guarded by _POSIX_C_SOURCE and _DARWIN_C_SOURCE
je_builder.define("_DARWIN_C_SOURCE", "1");
}
// Only enable PIC on non-Windows targets. Windows doesn't support -fPIC.
if target_os() != "windows" {
je_builder.pic(true);
}
if is_like_msvc {
je_builder.flag("-Od").flag("-W4").flag("-DYNAMICBASE");
} else {
je_builder
.flag("-fwrapv")
.flag("--param")
.flag("ssp-buffer-size=4")
.flag("-fvisibility=hidden")
.flag("-Wcast-align")
.flag("-Wmissing-field-initializers")
.flag("-Wshadow")
.flag("-Wswitch-enum")
.flag("-Wextra")
.flag("-Wall")
.flag("-pedantic")
// Compilation will fail if optimizations are enabled.
.flag("-O0")
.flag("-fwrapv")
.flag("-Wconversion");
}
je_builder
}
/// The cc crate appends CFLAGS at the end of the compiler command line,
/// which means CFLAGS optimization flags override build script flags.
/// Jitterentropy MUST be compiled with -O0, so we temporarily override
/// CFLAGS to replace any optimization flags with -O0.
fn jitter_entropy_cflags_guard(is_like_msvc: bool) -> Option<EnvGuard> {
let cflags = get_crate_cflags()?;
let filtered: String = cflags
.split_whitespace()
.filter(|flag| !flag.starts_with("-O") && !flag.starts_with("/O"))
.collect::<Vec<_>>()
.join(" ");
let new_cflags = if is_like_msvc {
format!("{filtered} -Od").trim().to_string()
} else {
format!("{filtered} -O0 -Wp,-U_FORTIFY_SOURCE")
.trim()
.to_string()
};
Some(EnvGuard::new(&env_name_for_target("CFLAGS"), &new_cflags))
}
fn add_all_files(&self, sources: &[&'static str], cc_build: &mut cc::Build) {
let compiler = cc_build.get_compiler();
let force_include_option = if compiler.is_like_msvc() {
"/FI"
} else {
"--include="
};
// s2n-bignum is compiled separately due to needing extra flags
let mut s2n_bignum_builder = cc_build.clone();
s2n_bignum_builder.flag(format!(
"{}{}",
force_include_option,
self.manifest_dir
.join("generated-include")
.join("openssl")
.join("boringssl_prefix_symbols_asm.h")
.display()
));
s2n_bignum_builder.define("S2N_BN_HIDE_SYMBOLS", "1");
// CPU Jitter Entropy is compiled separately due to needing specific flags
let mut jitter_entropy_builder =
self.prepare_jitter_entropy_builder(compiler.is_like_msvc());
jitter_entropy_builder.flag(format!(
"{}{}",
force_include_option,
self.manifest_dir
.join("generated-include")
.join("openssl")
.join("boringssl_prefix_symbols.h")
.display()
));
let mut build_options = vec![];
self.add_includes(&mut build_options);
let mut nasm_builder = NasmBuilder::new(self.manifest_dir.clone(), self.out_dir.clone());
for option in &build_options {
option.apply_nasm(&mut nasm_builder);
}
let s2n_bignum_source_feature_map = Self::build_s2n_bignum_source_feature_map();
let compiler_features = self.compiler_features.take();
for source in sources {
let source_path = self.manifest_dir.join("aws-lc").join(source);
let is_s2n_bignum = std::path::Path::new(source).starts_with("third_party/s2n-bignum");
let is_jitter_entropy =
std::path::Path::new(source).starts_with("third_party/jitterentropy");
if !source_path.is_file() {
emit_warning(format!("Not a file: {:?}", source_path.as_os_str()));
continue;
}
if is_s2n_bignum {
let filename: String = source_path
.file_name()
.unwrap()
.to_str()
.unwrap()
.to_string();
if let Some(compiler_feature) = s2n_bignum_source_feature_map.get(&filename) {
if compiler_features.contains(compiler_feature) {
s2n_bignum_builder.file(source_path);
} else {
emit_warning(format!(
"Skipping due to missing compiler features: {:?}",
source_path.as_os_str()
));
}
} else {
s2n_bignum_builder.file(source_path);
}
} else if is_jitter_entropy {
// Only compile if not disabled.
if Some(true) != disable_jitter_entropy() {
jitter_entropy_builder.file(source_path);
}
} else if source_path.extension() == Some("asm".as_ref()) {
nasm_builder.file(source_path);
} else {
cc_build.file(source_path);
}
}
self.compiler_features.set(compiler_features);
let s2n_bignum_object_files = s2n_bignum_builder.compile_intermediates();
for object in s2n_bignum_object_files {
cc_build.object(object);
}
if Some(true) != disable_jitter_entropy() {
let _je_cflags_guard = Self::jitter_entropy_cflags_guard(compiler.is_like_msvc());
let jitter_entropy_object_files = jitter_entropy_builder.compile_intermediates();
for object in jitter_entropy_object_files {
cc_build.object(object);
}
}
let nasm_object_files = nasm_builder.compile_intermediates();
for object in nasm_object_files {
cc_build.object(object);
}
}
fn build_library(&self, sources: &[&'static str]) {
let mut cc_build = self.prepare_builder();
self.run_compiler_checks(&mut cc_build);
self.add_all_files(sources, &mut cc_build);
if let Some(prefix) = &self.build_prefix {
cc_build.compile(format!("{}_crypto", prefix.as_str()).as_str());
} else {
cc_build.compile("crypto");
}
}
// This performs basic checks of compiler capabilities and sets an appropriate flag on success.
// This should be kept in alignment with the checks performed by AWS-LC's CMake build.
// See: https://github.com/search?q=repo%3Aaws%2Faws-lc%20check_compiler&type=code
fn compiler_check<T, S>(&self, basename: &str, extra_flags: T) -> bool
where
T: IntoIterator<Item = S>,
S: AsRef<str>,
{
let mut ret_val = false;
let output_dir = self.out_dir.join(format!("out-{basename}"));
let source_file = self
.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c"));
if !source_file.exists() {
emit_warning("######");
emit_warning("###### WARNING: MISSING GIT SUBMODULE ######");
emit_warning(format!(
" -- Did you initialize the repo's git submodules? Unable to find source file: {}.",
source_file.display()
));
emit_warning(" -- run 'git submodule update --init --recursive' to initialize.");
emit_warning("######");
emit_warning("######");
}
let mut cc_build = cc::Build::default();
cc_build
.file(source_file)
.warnings_into_errors(true)
.out_dir(&output_dir);
for flag in extra_flags {
let flag = flag.as_ref();
cc_build.flag(flag);
}
let compiler = cc_build.get_compiler();
if compiler.is_like_gnu() || compiler.is_like_clang() {
cc_build.flag("-Wno-unused-parameter");
}
let result = cc_build.try_compile_intermediates();
if result.is_ok() {
ret_val = true;
}
if fs::remove_dir_all(&output_dir).is_err() {
emit_warning(format!("Failed to remove {}", output_dir.display()));
}
emit_warning(format!(
"Compilation of '{basename}.c' {} - {:?}.",
if ret_val { "succeeded" } else { "failed" },
&result
));
ret_val
}
// This checks whether the compiler contains a critical bug that causes `memcmp` to erroneously
// consider two regions of memory to be equal when they're not.
// See GCC bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
// This should be kept in alignment with the same check performed by the CMake build.
// See: https://github.com/search?q=repo%3Aaws%2Faws-lc%20check_run&type=code
fn memcmp_check(&self) {
// This check compiles, links, and executes a test program. When cross-compiling
// (HOST != TARGET), we cannot execute the resulting binary, so we skip this check.
// This also avoids linker configuration issues with cross-compilation toolchains
// (e.g., cross-rs Darwin toolchains that set invalid -fuse-ld= flags in CFLAGS).
if cargo_env("HOST") != target() {
return;
}
let basename = "memcmp_invalid_stripped_check";
let exec_path = out_dir().join(basename);
let memcmp_build = cc::Build::default();
let memcmp_compiler = memcmp_build.get_compiler();
if !memcmp_compiler.is_like_clang() && !memcmp_compiler.is_like_gnu() {
// The logic below assumes a Clang or GCC compiler is in use
return;
}
let mut memcmp_compile_args = Vec::from(memcmp_compiler.args());
// This check invokes the compiled executable and hence needs to link
// it. CMake handles this via LDFLAGS but `cc` doesn't. In setups with
// custom linker setups this could lead to a mismatch between the
// expected and the actually used linker. Explicitly respecting LDFLAGS
// here brings us back to parity with CMake.
if let Ok(ldflags) = std::env::var("LDFLAGS") {
for flag in ldflags.split_whitespace() {
memcmp_compile_args.push(flag.into());
}
}
memcmp_compile_args.push(
self.manifest_dir
.join("aws-lc")
.join("tests")
.join("compiler_features_tests")
.join(format!("{basename}.c"))
.into_os_string(),
);
memcmp_compile_args.push("-Wno-unused-parameter".into());
memcmp_compile_args.push("-o".into());
memcmp_compile_args.push(exec_path.clone().into_os_string());
let memcmp_args: Vec<_> = memcmp_compile_args
.iter()
.map(std::ffi::OsString::as_os_str)
.collect();
let memcmp_compile_result =
execute_command(memcmp_compiler.path().as_os_str(), memcmp_args.as_slice());
assert!(
memcmp_compile_result.status,
"COMPILER: {}\
ARGS: {:?}\
EXECUTED: {}\
ERROR: {}\
OUTPUT: {}\
Failed to compile {basename}
",
memcmp_compiler.path().display(),
memcmp_args.as_slice(),
memcmp_compile_result.executed,
memcmp_compile_result.stderr,
memcmp_compile_result.stdout
);
let result = execute_command(exec_path.as_os_str(), &[]);
assert!(
result.status,
"### COMPILER BUG DETECTED ###\nYour compiler ({}) is not supported due to a memcmp related bug reported in \
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189. \
We strongly recommend against using this compiler. \n\
EXECUTED: {}\n\
ERROR: {}\n\
OUTPUT: {}\n\
",
memcmp_compiler.path().display(),
memcmp_compile_result.executed,
memcmp_compile_result.stderr,
memcmp_compile_result.stdout
);
let _ = fs::remove_file(exec_path);
}
fn run_compiler_checks(&self, cc_build: &mut cc::Build) {
if self.compiler_check("stdalign_check", Vec::<&'static str>::new()) {
cc_build.define("AWS_LC_STDALIGN_AVAILABLE", Some("1"));
}
if self.compiler_check("builtin_swap_check", Vec::<&'static str>::new()) {
cc_build.define("AWS_LC_BUILTIN_SWAP_SUPPORTED", Some("1"));
}
if target_arch() == "aarch64"
&& self.compiler_check("neon_sha3_check", vec!["-march=armv8.4-a+sha3"])
{
let mut compiler_features = self.compiler_features.take();
compiler_features.push(CompilerFeature::NeonSha3);
self.compiler_features.set(compiler_features);
cc_build.define("MY_ASSEMBLER_SUPPORTS_NEON_SHA3_EXTENSION", Some("1"));
}
if target_os() == "linux" || target_os() == "android" {
if self.compiler_check("linux_random_h", Vec::<&'static str>::new()) {
cc_build.define("HAVE_LINUX_RANDOM_H", Some("1"));
} else if self.compiler_check("linux_random_h", vec!["-DDEFINE_U32"]) {
cc_build.define("HAVE_LINUX_RANDOM_H", Some("1"));
cc_build.define("AWS_LC_URANDOM_NEEDS_U32", Some("1"));
}
}
self.memcmp_check();
}
}
impl crate::Builder for CcBuilder {
fn check_dependencies(&self) -> Result<(), String> {
if OutputLibType::Dynamic == self.output_lib_type {
// https://github.com/rust-lang/cc-rs/issues/594
return Err("CcBuilder only supports static builds".to_string());
}
if target_env() == "ohos" {
return Err("OpenHarmony targets must be built with CMake.".to_string());
}
if Some(true) == env_var_to_bool("CARGO_FEATURE_SSL") {
return Err("cc_builder for libssl not supported".to_string());
}
Ok(())
}
fn build(&self) -> Result<(), String> {
if target_os() == "windows"
&& target_arch() == "aarch64"
&& target_env() == "msvc"
&& get_crate_cc().is_none()
&& test_clang_cl_command()
{
set_env_for_target("CC", "clang-cl");
}
println!("cargo:root={}", self.out_dir.display());
let sources = crate::cc_builder::identify_sources();
self.build_library(sources.as_slice());
Ok(())
}
fn name(&self) -> &'static str {
"CC"
}
}

View File

@@ -0,0 +1,103 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/intt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/ntt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_mulcache_compute_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_reduce_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_tobytes_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_tomont_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/rej_uniform_asm.S",
"generated-src/ios-aarch64/crypto/chacha/chacha-armv8.S",
"generated-src/ios-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/aesv8-armx.S",
"generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/armv8-mont.S",
"generated-src/ios-aarch64/crypto/fipsmodule/bn-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/ghash-neon-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/ghashv8-armx.S",
"generated-src/ios-aarch64/crypto/fipsmodule/keccak1600-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/md5-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/p256-armv8-asm.S",
"generated-src/ios-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S",
"generated-src/ios-aarch64/crypto/fipsmodule/rndr-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/sha1-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/sha256-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/sha512-armv8.S",
"generated-src/ios-aarch64/crypto/fipsmodule/vpaes-armv8.S",
"generated-src/ios-aarch64/crypto/test/trampoline-armv8.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_madd_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_madd_n25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_mod_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_neg_p25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519base_byte.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519base_byte_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519_byte.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519_byte_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_decode.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_decode_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_encode.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmulbase.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmulbase_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmuldouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmuldouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_emontredc_8n.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_kmul_16_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_kmul_32_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_ksqr_16_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_ksqr_32_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_16.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_8n.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_ge.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_mul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_optsub.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_sqr.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/bignum_montinv_p256.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/p256_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/p256_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_add_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_deamont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_littleendian_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montinv_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montmul_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montmul_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montsqr_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montsqr_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_neg_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_nonzero_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_sub_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_tomont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_add_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_fromlebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_inv_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_mul_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_mul_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_neg_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sqr_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sqr_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sub_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_tolebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak2_f1600.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak4_f1600_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak4_f1600_alt2.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak_f1600.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak_f1600_alt.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-dec.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-enc.S",
];

View File

@@ -0,0 +1,95 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/intt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/mulcache_compute.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/ntt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/nttfrombytes.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/ntttobytes.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/nttunpack.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/reduce.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/rej_uniform_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/tomont.S",
"generated-src/mac-x86_64/crypto/chacha/chacha-x86_64.S",
"generated-src/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S",
"generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S",
"generated-src/mac-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S",
"generated-src/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S",
"generated-src/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/aesni-xts-avx512.S",
"generated-src/mac-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/ghash-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/md5-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
"generated-src/mac-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
"generated-src/mac-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/rsaz-2k-avx512.S",
"generated-src/mac-x86_64/crypto/fipsmodule/rsaz-3k-avx512.S",
"generated-src/mac-x86_64/crypto/fipsmodule/rsaz-4k-avx512.S",
"generated-src/mac-x86_64/crypto/fipsmodule/rsaz-avx2.S",
"generated-src/mac-x86_64/crypto/fipsmodule/sha1-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/sha256-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/sha512-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S",
"generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont.S",
"generated-src/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S",
"generated-src/mac-x86_64/crypto/test/trampoline-x86_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_madd_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_madd_n25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_mod_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_neg_p25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519base.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519base_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_decode.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_decode_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_encode.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmulbase.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmulbase_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmuldouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmuldouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/bignum_montinv_p256.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/p256_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/p256_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_add_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_deamont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_deamont_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_littleendian_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montinv_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montmul_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montmul_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montsqr_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montsqr_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_neg_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_nonzero_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_sub_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_tomont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_tomont_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_add_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_fromlebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_inv_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_mul_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_mul_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_neg_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sqr_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sqr_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sub_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_tolebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/sha3/sha3_keccak_f1600.S",
];

View File

@@ -0,0 +1,103 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/intt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/ntt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_mulcache_compute_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_reduce_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_tobytes_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/poly_tomont_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/aarch64/src/rej_uniform_asm.S",
"generated-src/linux-aarch64/crypto/chacha/chacha-armv8.S",
"generated-src/linux-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/aesv8-armx.S",
"generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/armv8-mont.S",
"generated-src/linux-aarch64/crypto/fipsmodule/bn-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/ghashv8-armx.S",
"generated-src/linux-aarch64/crypto/fipsmodule/keccak1600-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/md5-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/p256-armv8-asm.S",
"generated-src/linux-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S",
"generated-src/linux-aarch64/crypto/fipsmodule/rndr-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/sha1-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/sha256-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/sha512-armv8.S",
"generated-src/linux-aarch64/crypto/fipsmodule/vpaes-armv8.S",
"generated-src/linux-aarch64/crypto/test/trampoline-armv8.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_madd_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_madd_n25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_mod_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/bignum_neg_p25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519base_byte.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519base_byte_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519_byte.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/curve25519_x25519_byte_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_decode.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_decode_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_encode.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmulbase.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmulbase_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmuldouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/curve25519/edwards25519_scalarmuldouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_emontredc_8n.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_kmul_16_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_kmul_32_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_ksqr_16_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/fastmul/bignum_ksqr_32_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_16.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_32.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_copy_row_from_table_8n.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_ge.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_mul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_optsub.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/generic/bignum_sqr.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/bignum_montinv_p256.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/p256_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p256/p256_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_add_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_deamont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_littleendian_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montinv_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montmul_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montmul_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montsqr_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_montsqr_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_neg_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_nonzero_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_sub_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/bignum_tomont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p384/p384_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_add_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_fromlebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_inv_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_mul_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_mul_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_neg_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sqr_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sqr_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_sub_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/bignum_tolebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/p521/p521_jscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak2_f1600.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak4_f1600_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak4_f1600_alt2.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak_f1600.S",
"third_party/s2n-bignum/s2n-bignum-imported/arm/sha3/sha3_keccak_f1600_alt.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-dec.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-enc.S",
];

View File

@@ -0,0 +1,18 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/poly1305/poly1305_arm_asm.S",
"generated-src/linux-arm/crypto/chacha/chacha-armv4.S",
"generated-src/linux-arm/crypto/fipsmodule/aesv8-armx.S",
"generated-src/linux-arm/crypto/fipsmodule/armv4-mont.S",
"generated-src/linux-arm/crypto/fipsmodule/bsaes-armv7.S",
"generated-src/linux-arm/crypto/fipsmodule/ghash-armv4.S",
"generated-src/linux-arm/crypto/fipsmodule/ghashv8-armx.S",
"generated-src/linux-arm/crypto/fipsmodule/sha1-armv4-large.S",
"generated-src/linux-arm/crypto/fipsmodule/sha256-armv4.S",
"generated-src/linux-arm/crypto/fipsmodule/sha512-armv4.S",
"generated-src/linux-arm/crypto/fipsmodule/vpaes-armv7.S",
"generated-src/linux-arm/crypto/test/trampoline-armv4.S",
];

View File

@@ -0,0 +1,9 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"generated-src/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S",
"generated-src/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S",
"generated-src/linux-ppc64le/crypto/test/trampoline-ppc.S",
];

View File

@@ -0,0 +1,19 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:50 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"generated-src/linux-x86/crypto/chacha/chacha-x86.S",
"generated-src/linux-x86/crypto/fipsmodule/aesni-x86.S",
"generated-src/linux-x86/crypto/fipsmodule/bn-586.S",
"generated-src/linux-x86/crypto/fipsmodule/co-586.S",
"generated-src/linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S",
"generated-src/linux-x86/crypto/fipsmodule/ghash-x86.S",
"generated-src/linux-x86/crypto/fipsmodule/md5-586.S",
"generated-src/linux-x86/crypto/fipsmodule/sha1-586.S",
"generated-src/linux-x86/crypto/fipsmodule/sha256-586.S",
"generated-src/linux-x86/crypto/fipsmodule/sha512-586.S",
"generated-src/linux-x86/crypto/fipsmodule/vpaes-x86.S",
"generated-src/linux-x86/crypto/fipsmodule/x86-mont.S",
"generated-src/linux-x86/crypto/test/trampoline-x86.S",
];

View File

@@ -0,0 +1,95 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:51 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/intt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/mulcache_compute.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/ntt.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/nttfrombytes.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/ntttobytes.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/nttunpack.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/reduce.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/rej_uniform_asm.S",
"crypto/fipsmodule/ml_kem/mlkem/native/x86_64/src/tomont.S",
"generated-src/linux-x86_64/crypto/chacha/chacha-x86_64.S",
"generated-src/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S",
"generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.S",
"generated-src/linux-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.S",
"generated-src/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S",
"generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/aesni-xts-avx512.S",
"generated-src/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/md5-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
"generated-src/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
"generated-src/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/rsaz-2k-avx512.S",
"generated-src/linux-x86_64/crypto/fipsmodule/rsaz-3k-avx512.S",
"generated-src/linux-x86_64/crypto/fipsmodule/rsaz-4k-avx512.S",
"generated-src/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S",
"generated-src/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S",
"generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont.S",
"generated-src/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S",
"generated-src/linux-x86_64/crypto/test/trampoline-x86_64.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_madd_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_madd_n25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_mod_n25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/bignum_neg_p25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519base.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519base_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/curve25519_x25519_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_decode.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_decode_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_encode.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmulbase.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmulbase_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmuldouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/curve25519/edwards25519_scalarmuldouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/bignum_montinv_p256.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/p256_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p256/p256_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_add_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_deamont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_deamont_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_littleendian_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montinv_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montmul_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montmul_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montsqr_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_montsqr_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_neg_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_nonzero_6.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_sub_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_tomont_p384.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/bignum_tomont_p384_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p384/p384_montjscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_add_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_fromlebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_inv_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_mul_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_mul_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_neg_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sqr_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sqr_p521_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_sub_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/bignum_tolebytes_p521.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jdouble.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jdouble_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jscalarmul.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/p521/p521_jscalarmul_alt.S",
"third_party/s2n-bignum/s2n-bignum-imported/x86_att/sha3/sha3_keccak_f1600.S",
];

View File

@@ -0,0 +1,259 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:51 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"crypto/asn1/asn1_lib.c",
"crypto/asn1/asn1_par.c",
"crypto/asn1/asn_pack.c",
"crypto/asn1/a_bitstr.c",
"crypto/asn1/a_bool.c",
"crypto/asn1/a_d2i_fp.c",
"crypto/asn1/a_dup.c",
"crypto/asn1/a_gentm.c",
"crypto/asn1/a_i2d_fp.c",
"crypto/asn1/a_int.c",
"crypto/asn1/a_mbstr.c",
"crypto/asn1/a_object.c",
"crypto/asn1/a_octet.c",
"crypto/asn1/a_strex.c",
"crypto/asn1/a_strnid.c",
"crypto/asn1/a_time.c",
"crypto/asn1/a_type.c",
"crypto/asn1/a_utctm.c",
"crypto/asn1/a_utf8.c",
"crypto/asn1/f_int.c",
"crypto/asn1/f_string.c",
"crypto/asn1/posix_time.c",
"crypto/asn1/tasn_dec.c",
"crypto/asn1/tasn_enc.c",
"crypto/asn1/tasn_fre.c",
"crypto/asn1/tasn_new.c",
"crypto/asn1/tasn_typ.c",
"crypto/asn1/tasn_utl.c",
"crypto/base64/base64.c",
"crypto/bio/bio.c",
"crypto/bio/bio_addr.c",
"crypto/bio/bio_mem.c",
"crypto/bio/connect.c",
"crypto/bio/dgram.c",
"crypto/bio/errno.c",
"crypto/bio/fd.c",
"crypto/bio/file.c",
"crypto/bio/hexdump.c",
"crypto/bio/md.c",
"crypto/bio/pair.c",
"crypto/bio/printf.c",
"crypto/bio/socket.c",
"crypto/bio/socket_helper.c",
"crypto/blake2/blake2.c",
"crypto/bn_extra/bn_asn1.c",
"crypto/bn_extra/convert.c",
"crypto/buf/buf.c",
"crypto/bytestring/asn1_compat.c",
"crypto/bytestring/ber.c",
"crypto/bytestring/cbb.c",
"crypto/bytestring/cbs.c",
"crypto/bytestring/unicode.c",
"crypto/chacha/chacha.c",
"crypto/cipher_extra/cipher_extra.c",
"crypto/cipher_extra/derive_key.c",
"crypto/cipher_extra/e_aesctrhmac.c",
"crypto/cipher_extra/e_aesgcmsiv.c",
"crypto/cipher_extra/e_aes_cbc_hmac_sha1.c",
"crypto/cipher_extra/e_aes_cbc_hmac_sha256.c",
"crypto/cipher_extra/e_chacha20poly1305.c",
"crypto/cipher_extra/e_des.c",
"crypto/cipher_extra/e_null.c",
"crypto/cipher_extra/e_rc2.c",
"crypto/cipher_extra/e_rc4.c",
"crypto/cipher_extra/e_tls.c",
"crypto/cipher_extra/tls_cbc.c",
"crypto/conf/conf.c",
"crypto/console/console.c",
"crypto/crypto.c",
"crypto/decrepit/bio/base64_bio.c",
"crypto/decrepit/blowfish/blowfish.c",
"crypto/decrepit/cast/cast.c",
"crypto/decrepit/cast/cast_tables.c",
"crypto/decrepit/cfb/cfb.c",
"crypto/decrepit/dh/dh_decrepit.c",
"crypto/decrepit/evp/evp_do_all.c",
"crypto/decrepit/obj/obj_decrepit.c",
"crypto/decrepit/ripemd/ripemd.c",
"crypto/decrepit/rsa/rsa_decrepit.c",
"crypto/decrepit/x509/x509_decrepit.c",
"crypto/des/des.c",
"crypto/dh_extra/dh_asn1.c",
"crypto/dh_extra/params.c",
"crypto/digest_extra/digest_extra.c",
"crypto/dsa/dsa.c",
"crypto/dsa/dsa_asn1.c",
"crypto/ecdh_extra/ecdh_extra.c",
"crypto/ecdsa_extra/ecdsa_asn1.c",
"crypto/ec_extra/ec_asn1.c",
"crypto/ec_extra/ec_derive.c",
"crypto/ec_extra/hash_to_curve.c",
"crypto/engine/engine.c",
"crypto/err/err.c",
"crypto/evp_extra/evp_asn1.c",
"crypto/evp_extra/print.c",
"crypto/evp_extra/p_dh.c",
"crypto/evp_extra/p_dh_asn1.c",
"crypto/evp_extra/p_dsa.c",
"crypto/evp_extra/p_dsa_asn1.c",
"crypto/evp_extra/p_ec_asn1.c",
"crypto/evp_extra/p_ed25519_asn1.c",
"crypto/evp_extra/p_hmac_asn1.c",
"crypto/evp_extra/p_kem_asn1.c",
"crypto/evp_extra/p_methods.c",
"crypto/evp_extra/p_pqdsa_asn1.c",
"crypto/evp_extra/p_rsa_asn1.c",
"crypto/evp_extra/p_x25519.c",
"crypto/evp_extra/p_x25519_asn1.c",
"crypto/evp_extra/scrypt.c",
"crypto/evp_extra/sign.c",
"crypto/ex_data.c",
"crypto/fipsmodule/bcm.c",
"crypto/fipsmodule/cpucap/cpucap.c",
"crypto/hpke/hpke.c",
"crypto/hrss/hrss.c",
"crypto/lhash/lhash.c",
"crypto/md4/md4.c",
"crypto/mem.c",
"crypto/obj/obj.c",
"crypto/obj/obj_xref.c",
"crypto/ocsp/ocsp_asn.c",
"crypto/ocsp/ocsp_client.c",
"crypto/ocsp/ocsp_extension.c",
"crypto/ocsp/ocsp_http.c",
"crypto/ocsp/ocsp_lib.c",
"crypto/ocsp/ocsp_print.c",
"crypto/ocsp/ocsp_server.c",
"crypto/ocsp/ocsp_verify.c",
"crypto/pem/pem_all.c",
"crypto/pem/pem_info.c",
"crypto/pem/pem_lib.c",
"crypto/pem/pem_oth.c",
"crypto/pem/pem_pk8.c",
"crypto/pem/pem_pkey.c",
"crypto/pem/pem_x509.c",
"crypto/pem/pem_xaux.c",
"crypto/pkcs7/bio/cipher.c",
"crypto/pkcs7/pkcs7.c",
"crypto/pkcs7/pkcs7_asn1.c",
"crypto/pkcs7/pkcs7_x509.c",
"crypto/pkcs8/p5_pbev2.c",
"crypto/pkcs8/pkcs8.c",
"crypto/pkcs8/pkcs8_x509.c",
"crypto/poly1305/poly1305.c",
"crypto/poly1305/poly1305_arm.c",
"crypto/poly1305/poly1305_vec.c",
"crypto/pool/pool.c",
"crypto/rand_extra/ccrandomgeneratebytes.c",
"crypto/rand_extra/deterministic.c",
"crypto/rand_extra/getentropy.c",
"crypto/rand_extra/rand_extra.c",
"crypto/rand_extra/urandom.c",
"crypto/rand_extra/vm_ube_fallback.c",
"crypto/rand_extra/windows.c",
"crypto/rc4/rc4.c",
"crypto/refcount_c11.c",
"crypto/refcount_lock.c",
"crypto/refcount_win.c",
"crypto/rsa_extra/rsassa_pss_asn1.c",
"crypto/rsa_extra/rsa_asn1.c",
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
"crypto/siphash/siphash.c",
"crypto/spake25519/spake25519.c",
"crypto/stack/stack.c",
"crypto/thread.c",
"crypto/thread_none.c",
"crypto/thread_pthread.c",
"crypto/thread_win.c",
"crypto/trust_token/pmbtoken.c",
"crypto/trust_token/trust_token.c",
"crypto/trust_token/voprf.c",
"crypto/ube/fork_ube_detect.c",
"crypto/ube/ube.c",
"crypto/ube/vm_ube_detect.c",
"crypto/ui/ui.c",
"crypto/x509/algorithm.c",
"crypto/x509/asn1_gen.c",
"crypto/x509/a_digest.c",
"crypto/x509/a_sign.c",
"crypto/x509/a_verify.c",
"crypto/x509/by_dir.c",
"crypto/x509/by_file.c",
"crypto/x509/i2d_pr.c",
"crypto/x509/name_print.c",
"crypto/x509/policy.c",
"crypto/x509/rsa_pss.c",
"crypto/x509/t_crl.c",
"crypto/x509/t_req.c",
"crypto/x509/t_x509.c",
"crypto/x509/t_x509a.c",
"crypto/x509/v3_akey.c",
"crypto/x509/v3_akeya.c",
"crypto/x509/v3_alt.c",
"crypto/x509/v3_bcons.c",
"crypto/x509/v3_bitst.c",
"crypto/x509/v3_conf.c",
"crypto/x509/v3_cpols.c",
"crypto/x509/v3_crld.c",
"crypto/x509/v3_enum.c",
"crypto/x509/v3_extku.c",
"crypto/x509/v3_genn.c",
"crypto/x509/v3_ia5.c",
"crypto/x509/v3_info.c",
"crypto/x509/v3_int.c",
"crypto/x509/v3_lib.c",
"crypto/x509/v3_ncons.c",
"crypto/x509/v3_ocsp.c",
"crypto/x509/v3_pcons.c",
"crypto/x509/v3_pmaps.c",
"crypto/x509/v3_prn.c",
"crypto/x509/v3_purp.c",
"crypto/x509/v3_skey.c",
"crypto/x509/v3_utl.c",
"crypto/x509/x509.c",
"crypto/x509/x509cset.c",
"crypto/x509/x509name.c",
"crypto/x509/x509rset.c",
"crypto/x509/x509spki.c",
"crypto/x509/x509_att.c",
"crypto/x509/x509_cmp.c",
"crypto/x509/x509_d2.c",
"crypto/x509/x509_def.c",
"crypto/x509/x509_ext.c",
"crypto/x509/x509_lu.c",
"crypto/x509/x509_obj.c",
"crypto/x509/x509_req.c",
"crypto/x509/x509_set.c",
"crypto/x509/x509_trs.c",
"crypto/x509/x509_txt.c",
"crypto/x509/x509_v3.c",
"crypto/x509/x509_vfy.c",
"crypto/x509/x509_vpm.c",
"crypto/x509/x_algor.c",
"crypto/x509/x_all.c",
"crypto/x509/x_attrib.c",
"crypto/x509/x_crl.c",
"crypto/x509/x_exten.c",
"crypto/x509/x_name.c",
"crypto/x509/x_pubkey.c",
"crypto/x509/x_req.c",
"crypto/x509/x_sig.c",
"crypto/x509/x_spki.c",
"crypto/x509/x_val.c",
"crypto/x509/x_x509.c",
"crypto/x509/x_x509a.c",
"generated-src/err_data.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-base.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-gcd.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-health.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-noise.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-sha3.c",
"third_party/jitterentropy/jitterentropy-library/src/jitterentropy-timer.c",
];

View File

@@ -0,0 +1,27 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:51 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"generated-src/win-aarch64/crypto/chacha/chacha-armv8.S",
"generated-src/win-aarch64/crypto/cipher_extra/chacha20_poly1305_armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/aesv8-armx.S",
"generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8-unroll8.S",
"generated-src/win-aarch64/crypto/fipsmodule/aesv8-gcm-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/armv8-mont.S",
"generated-src/win-aarch64/crypto/fipsmodule/bn-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/ghash-neon-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/ghashv8-armx.S",
"generated-src/win-aarch64/crypto/fipsmodule/keccak1600-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/md5-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/p256-armv8-asm.S",
"generated-src/win-aarch64/crypto/fipsmodule/p256_beeu-armv8-asm.S",
"generated-src/win-aarch64/crypto/fipsmodule/rndr-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/sha1-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/sha256-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/sha512-armv8.S",
"generated-src/win-aarch64/crypto/fipsmodule/vpaes-armv8.S",
"generated-src/win-aarch64/crypto/test/trampoline-armv8.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-dec.S",
"third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-enc.S",
];

View File

@@ -0,0 +1,19 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:51 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"generated-src/win-x86/crypto/chacha/chacha-x86.asm",
"generated-src/win-x86/crypto/fipsmodule/aesni-x86.asm",
"generated-src/win-x86/crypto/fipsmodule/bn-586.asm",
"generated-src/win-x86/crypto/fipsmodule/co-586.asm",
"generated-src/win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm",
"generated-src/win-x86/crypto/fipsmodule/ghash-x86.asm",
"generated-src/win-x86/crypto/fipsmodule/md5-586.asm",
"generated-src/win-x86/crypto/fipsmodule/sha1-586.asm",
"generated-src/win-x86/crypto/fipsmodule/sha256-586.asm",
"generated-src/win-x86/crypto/fipsmodule/sha512-586.asm",
"generated-src/win-x86/crypto/fipsmodule/vpaes-x86.asm",
"generated-src/win-x86/crypto/fipsmodule/x86-mont.asm",
"generated-src/win-x86/crypto/test/trampoline-x86.asm",
];

View File

@@ -0,0 +1,32 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Thu Mar 19 18:54:51 UTC 2026
pub(super) const CRYPTO_LIBRARY: &[&str] = &[
"generated-src/win-x86_64/crypto/chacha/chacha-x86_64.asm",
"generated-src/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm",
"generated-src/win-x86_64/crypto/cipher_extra/aesni-sha1-x86_64.asm",
"generated-src/win-x86_64/crypto/cipher_extra/aesni-sha256-x86_64.asm",
"generated-src/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/aesni-gcm-avx512.asm",
"generated-src/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/aesni-xts-avx512.asm",
"generated-src/win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/ghash-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/md5-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm",
"generated-src/win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm",
"generated-src/win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/rsaz-2k-avx512.asm",
"generated-src/win-x86_64/crypto/fipsmodule/rsaz-3k-avx512.asm",
"generated-src/win-x86_64/crypto/fipsmodule/rsaz-4k-avx512.asm",
"generated-src/win-x86_64/crypto/fipsmodule/rsaz-avx2.asm",
"generated-src/win-x86_64/crypto/fipsmodule/sha1-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/sha256-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/sha512-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm",
"generated-src/win-x86_64/crypto/fipsmodule/x86_64-mont.asm",
"generated-src/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm",
"generated-src/win-x86_64/crypto/test/trampoline-x86_64.asm",
];

View File

@@ -0,0 +1,570 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
use crate::cc_builder::CcBuilder;
use crate::OutputLib::{Crypto, Ssl};
use crate::{
allow_prebuilt_nasm, cargo_env, disable_jitter_entropy, effective_target, emit_warning,
execute_command, get_crate_cflags, is_crt_static, is_fips_build, is_no_asm,
is_no_pregenerated_src, optional_env, optional_env_optional_crate_target, set_env,
set_env_for_target, target_arch, target_env, target_os, test_clang_cl_command,
test_nasm_command, use_prebuilt_nasm, OutputLibType,
};
use std::collections::HashMap;
use std::env;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::str::FromStr;
pub(crate) struct CmakeBuilder {
manifest_dir: PathBuf,
out_dir: PathBuf,
build_prefix: Option<String>,
output_lib_type: OutputLibType,
}
fn test_prebuilt_nasm_script(script_path: &Path) -> bool {
// Call with no args - both scripts will exit with error, but we only care if they can execute
execute_command(script_path.as_os_str(), &[]).executed
}
fn find_cmake_command() -> Option<OsString> {
if let Some(cmake) = optional_env_optional_crate_target("CMAKE") {
emit_warning(format!("CMAKE environment variable set: {}", cmake.clone()));
if execute_command(cmake.as_ref(), &["--version".as_ref()]).status {
Some(cmake.into())
} else {
None
}
} else if execute_command("cmake3".as_ref(), &["--version".as_ref()]).status {
Some("cmake3".into())
} else if execute_command("cmake".as_ref(), &["--version".as_ref()]).status {
Some("cmake".into())
} else {
None
}
}
impl CmakeBuilder {
pub(crate) fn new(
manifest_dir: PathBuf,
out_dir: PathBuf,
build_prefix: Option<String>,
output_lib_type: OutputLibType,
) -> Self {
Self {
manifest_dir,
out_dir,
build_prefix,
output_lib_type,
}
}
fn artifact_output_dir(&self) -> PathBuf {
self.out_dir.join("build").join("artifacts")
}
fn get_cmake_config(&self) -> cmake::Config {
cmake::Config::new(&self.manifest_dir)
}
fn apply_universal_build_options<'a>(
&self,
cmake_cfg: &'a mut cmake::Config,
) -> &'a cmake::Config {
// Use the compiler options identified by CcBuilder
let cc_builder = CcBuilder::new(
self.manifest_dir.clone(),
self.out_dir.clone(),
self.build_prefix.clone(),
self.output_lib_type,
);
let cc_build = cc::Build::new();
let (is_like_msvc, build_options) =
cc_builder.collect_universal_build_options(&cc_build, true);
for option in &build_options {
option.apply_cmake(cmake_cfg, is_like_msvc);
}
cmake_cfg
}
const GOCACHE_DIR_NAME: &'static str = "go-cache";
#[allow(clippy::too_many_lines)]
fn prepare_cmake_build(&self) -> cmake::Config {
if is_fips_build() {
unsafe {
env::set_var("GOFLAGS", "-buildvcs=false");
}
if env::var("GOCACHE").is_err() {
unsafe {
env::set_var(
"GOCACHE",
self.out_dir.join(Self::GOCACHE_DIR_NAME).as_os_str(),
);
}
}
}
let mut cmake_cfg = self.get_cmake_config();
if let Some(generator) = optional_env_optional_crate_target("CMAKE_GENERATOR") {
set_env("CMAKE_GENERATOR", generator);
}
if OutputLibType::default() == OutputLibType::Dynamic {
cmake_cfg.define("BUILD_SHARED_LIBS", "1");
if is_fips_build() {
// The default flags include `-ffunction-sections` that can result in
// dead code elimination dropping functions.
cmake_cfg.no_default_flags(true);
}
} else {
cmake_cfg.define("BUILD_SHARED_LIBS", "0");
}
if let Some(prefix) = &self.build_prefix {
cmake_cfg.define("BORINGSSL_PREFIX", format!("{prefix}_"));
let include_path = self.manifest_dir.join("generated-include");
cmake_cfg.define(
"BORINGSSL_PREFIX_HEADERS",
include_path.display().to_string(),
);
}
// Build flags that minimize our crate size.
cmake_cfg.define("BUILD_TESTING", "OFF");
cmake_cfg.define("BUILD_TOOL", "OFF");
cmake_cfg.define("ENABLE_SOURCE_MODIFICATION", "OFF");
if cfg!(feature = "ssl") {
cmake_cfg.define("BUILD_LIBSSL", "ON");
} else {
cmake_cfg.define("BUILD_LIBSSL", "OFF");
}
if is_fips_build() {
cmake_cfg.define("FIPS", "1");
} else {
if is_no_pregenerated_src() {
// Go and Perl will be required.
cmake_cfg.define("DISABLE_PERL", "OFF");
cmake_cfg.define("DISABLE_GO", "OFF");
} else {
// Build flags that minimize our dependencies.
cmake_cfg.define("DISABLE_PERL", "ON");
cmake_cfg.define("DISABLE_GO", "ON");
}
if Some(true) == disable_jitter_entropy() {
cmake_cfg.define("DISABLE_CPU_JITTER_ENTROPY", "ON");
}
if target_env() == "ohos" {
Self::configure_open_harmony(&mut cmake_cfg);
}
}
if is_no_asm() {
let opt_level = cargo_env("OPT_LEVEL");
if opt_level == "0" {
cmake_cfg.define("OPENSSL_NO_ASM", "1");
} else {
panic!("AWS_LC_SYS_NO_ASM only allowed for debug builds!")
}
}
if cfg!(feature = "asan") {
set_env_for_target("CC", "clang");
set_env_for_target("CXX", "clang++");
cmake_cfg.define("ASAN", "1");
}
if let Some(cflags) = get_crate_cflags() {
set_env_for_target("CFLAGS", cflags);
}
// cmake-rs has logic that strips Optimization/Debug options that are passed via CFLAGS:
// https://github.com/rust-lang/cmake-rs/issues/240
// This breaks build configurations that generate warnings when optimizations
// are disabled.
Self::preserve_cflag_optimization_flags(&mut cmake_cfg);
if target_os() == "windows" {
if is_fips_build() {
let opt_level = cargo_env("OPT_LEVEL");
let build_type = if opt_level.eq("0") || opt_level.eq("1") || opt_level.eq("2") {
"RELWITHDEBINFO"
} else {
"RELEASE"
};
cmake_cfg.define("CMAKE_BUILD_TYPE", build_type);
} else if use_prebuilt_nasm() {
self.configure_prebuilt_nasm(&mut cmake_cfg);
}
if target_env().as_str() == "msvc" {
let mut msvcrt = String::from_str("MultiThreaded").unwrap();
if is_crt_static() {
cmake_cfg.static_crt(true);
// When using static CRT on Windows MSVC, ignore missing PDB file warnings
// The static CRT libraries reference PDB files from Microsoft's build servers
// which are not available.
println!("cargo:rustc-link-arg=/ignore:4099");
} else {
msvcrt.push_str("DLL");
}
cmake_cfg.define("CMAKE_MSVC_RUNTIME_LIBRARY", msvcrt.as_str());
}
}
// Allow environment to specify CMake toolchain.
if let Some(toolchain) = optional_env_optional_crate_target("CMAKE_TOOLCHAIN_FILE") {
set_env_for_target("CMAKE_TOOLCHAIN_FILE", toolchain);
return cmake_cfg;
}
// We only consider compiler CFLAGS when no cmake toolchain is set
self.apply_universal_build_options(&mut cmake_cfg);
// See issue: https://github.com/aws/aws-lc-rs/issues/453
if target_os() == "windows" {
self.configure_windows(&mut cmake_cfg);
}
// If the build environment vendor is Apple
#[cfg(target_vendor = "apple")]
{
if target_arch() == "aarch64" {
cmake_cfg.define("CMAKE_OSX_ARCHITECTURES", "arm64");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "arm64");
}
if target_arch() == "x86_64" {
cmake_cfg.define("CMAKE_OSX_ARCHITECTURES", "x86_64");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "x86_64");
}
if target_os().trim() == "ios" {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "iOS");
if effective_target().ends_with("-ios-sim") || target_arch() == "x86_64" {
cmake_cfg.define("CMAKE_OSX_SYSROOT", "iphonesimulator");
} else {
cmake_cfg.define("CMAKE_OSX_SYSROOT", "iphoneos");
}
cmake_cfg.define("CMAKE_THREAD_LIBS_INIT", "-lpthread");
}
if target_os().trim() == "macos" {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
cmake_cfg.define("CMAKE_OSX_SYSROOT", "macosx");
}
if target_os().trim() == "tvos" {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "tvOS");
if effective_target().ends_with("-tvos-sim") || target_arch() == "x86_64" {
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvsimulator");
} else {
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvos");
}
}
}
if target_os() == "android" {
self.configure_android(&mut cmake_cfg);
}
cmake_cfg
}
fn preserve_cflag_optimization_flags(cmake_cfg: &mut cmake::Config) {
if let Some(cflags) = get_crate_cflags() {
let split = cflags.split_whitespace();
for arg in split {
if arg.starts_with("-O") || arg.starts_with("/O") {
emit_warning(format!("Preserving optimization flag: {arg}"));
cmake_cfg.cflag(arg);
}
}
}
}
#[allow(clippy::unused_self)]
fn select_prebuilt_nasm_script(&self) -> PathBuf {
let sh_script = self.manifest_dir.join("builder").join("prebuilt-nasm.sh");
let bat_script = self.manifest_dir.join("builder").join("prebuilt-nasm.bat");
// Test .sh first (more universal - works in MSYS2, WSL, native Unix)
if test_prebuilt_nasm_script(&sh_script) {
emit_warning("Selected prebuilt-nasm.sh (shell script can execute)");
sh_script
} else if test_prebuilt_nasm_script(&bat_script) {
emit_warning(
"Selected prebuilt-nasm.bat (batch script can execute, shell script cannot)",
);
bat_script
} else {
// Neither script could be verified as executable. This can happen in sandboxed or
// restricted build environments where trial execution is blocked. We fall back to
// selecting a script based on the host OS, which matches the behavior prior to
// execution-based detection. If this fallback is incorrect, the build will fail
// when CMake attempts to invoke the selected script.
let fallback_script = if cfg!(target_os = "windows") {
bat_script
} else {
sh_script
};
emit_warning(format!(
"WARNING: Neither prebuilt-nasm.sh nor prebuilt-nasm.bat could be verified as \
executable. Falling back to target-based selection: {}. If the build fails \
during assembly, verify that the selected script is appropriate for your \
build environment.",
fallback_script.file_name().unwrap().to_str().unwrap()
));
fallback_script
}
}
#[allow(clippy::unused_self)]
fn configure_android(&self, _cmake_cfg: &mut cmake::Config) {
// If we leave CMAKE_SYSTEM_PROCESSOR unset, then cmake-rs should handle properly setting
// CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR:
// https://github.com/rust-lang/cmake-rs/blob/b689783b5448966e810d515c798465f2e0ab56fd/src/lib.rs#L450-L499
// Log relevant environment variables.
if let Some(value) = optional_env_optional_crate_target("ANDROID_NDK_ROOT") {
set_env("ANDROID_NDK_ROOT", value);
} else {
emit_warning("ANDROID_NDK_ROOT not set.");
}
if let Some(value) = optional_env_optional_crate_target("ANDROID_NDK") {
set_env("ANDROID_NDK", value);
} else {
emit_warning("ANDROID_NDK not set.");
}
if let Some(value) = optional_env_optional_crate_target("ANDROID_STANDALONE_TOOLCHAIN") {
set_env("ANDROID_STANDALONE_TOOLCHAIN", value);
} else {
emit_warning("ANDROID_STANDALONE_TOOLCHAIN not set.");
}
}
#[allow(clippy::unused_self)]
fn configure_windows(&self, cmake_cfg: &mut cmake::Config) {
if is_fips_build() {
cmake_cfg.generator("Ninja");
let env_map = self
.collect_vcvarsall_bat()
.map_err(|x| panic!("{}", x))
.unwrap();
for (key, value) in env_map {
cmake_cfg.env(key, value);
}
}
match (target_env().as_str(), target_arch().as_str()) {
("msvc", "aarch64") => {
// If CMAKE_GENERATOR is either not set or not set to "Ninja"
let cmake_generator = optional_env("CMAKE_GENERATOR");
if cmake_generator.is_none() || cmake_generator.unwrap().to_lowercase() != "ninja" {
// The following is not supported by the Ninja generator
cmake_cfg.generator_toolset(format!(
"ClangCL{}",
if cfg!(target_arch = "x86_64") {
",host=x64"
} else {
""
}
));
cmake_cfg.define("CMAKE_GENERATOR_PLATFORM", "ARM64");
}
cmake_cfg.define("CMAKE_SYSTEM_NAME", "Windows");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "ARM64");
}
("msvc", _) => {
// No-op
}
(_, arch) => {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "Windows");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", arch);
}
}
}
fn collect_vcvarsall_bat(&self) -> Result<HashMap<String, String>, String> {
let mut map: HashMap<String, String> = HashMap::new();
let script_path = self.manifest_dir.join("builder").join("printenv.bat");
let result = execute_command(script_path.as_os_str(), &[]);
if !result.status {
eprintln!("{}", result.stdout);
return Err("Failed to run vcvarsall.bat.".to_owned());
}
eprintln!("{}", result.stdout);
let lines = result.stdout.lines();
for line in lines {
if let Some((var, val)) = line.split_once('=') {
map.insert(var.to_string(), val.to_string());
}
}
Ok(map)
}
fn configure_prebuilt_nasm(&self, cmake_cfg: &mut cmake::Config) {
emit_warning("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
emit_warning("!!! Using pre-built NASM binaries !!!");
emit_warning("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
let script_path = self.select_prebuilt_nasm_script();
let script_path = script_path.display().to_string();
let script_path = script_path.replace('\\', "/");
cmake_cfg.define("CMAKE_ASM_NASM_COMPILER", script_path.as_str());
// Without the following definition, the build fails with a message similar to the one
// reported here: https://gitlab.kitware.com/cmake/cmake/-/issues/19453
// The variables below were found in the associated fix:
// https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4257/diffs
cmake_cfg.define(
"CMAKE_ASM_NASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded",
"",
);
cmake_cfg.define(
"CMAKE_ASM_NASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL",
"",
);
cmake_cfg.define(
"CMAKE_ASM_NASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug",
"",
);
cmake_cfg.define(
"CMAKE_ASM_NASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL",
"",
);
cmake_cfg.define(
"CMAKE_ASM_NASM_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase",
"",
);
}
fn configure_open_harmony(cmake_cfg: &mut cmake::Config) {
let mut cflags = vec!["-Wno-unused-command-line-argument"];
let mut asmflags = vec![];
// If a toolchain is not specified by the environment
if optional_env_optional_crate_target("CMAKE_TOOLCHAIN_FILE").is_none() {
if let Ok(ndk) = env::var("OHOS_NDK_HOME") {
set_env_for_target(
"CMAKE_TOOLCHAIN_FILE",
format!("{ndk}/native/build/cmake/ohos.toolchain.cmake"),
);
} else if let Ok(sdk) = env::var("OHOS_SDK_NATIVE") {
set_env_for_target(
"CMAKE_TOOLCHAIN_FILE",
format!("{sdk}/build/cmake/ohos.toolchain.cmake"),
);
} else {
emit_warning(
"Neither OHOS_NDK_HOME nor OHOS_SDK_NATIVE are set! No toolchain found.",
);
}
}
match effective_target().as_str() {
"aarch64-unknown-linux-ohos" => {
cmake_cfg.define("OHOS_ARCH", "arm64-v8a");
}
"armv7-unknown-linux-ohos" => {
const ARM7_FLAGS: [&str; 6] = [
"-march=armv7-a",
"-mfloat-abi=softfp",
"-mtune=generic-armv7-a",
"-mthumb",
"-mfpu=neon",
"-DHAVE_NEON",
];
cflags.extend(ARM7_FLAGS);
asmflags.extend(ARM7_FLAGS);
cmake_cfg.define("OHOS_ARCH", "armeabi-v7a");
}
"x86_64-unknown-linux-ohos" => {
const X86_64_FLAGS: [&str; 3] = ["-msse4.1", "-DHAVE_NEON_X86", "-DHAVE_NEON"];
cflags.extend(X86_64_FLAGS);
asmflags.extend(X86_64_FLAGS);
cmake_cfg.define("OHOS_ARCH", "x86_64");
}
ohos_target => {
emit_warning(format!("Target: {ohos_target} is not support yet!").as_str());
}
}
cmake_cfg
.cflag(cflags.join(" ").as_str())
.cxxflag(cflags.join(" ").as_str())
.asmflag(asmflags.join(" ").as_str());
}
fn build_library(&self) -> PathBuf {
self.prepare_cmake_build()
.configure_arg("--no-warn-unused-cli")
.build()
}
}
impl crate::Builder for CmakeBuilder {
fn check_dependencies(&self) -> Result<(), String> {
let mut missing_dependency = false;
if target_os() == "windows" && target_arch() == "x86_64" {
if is_no_asm() && Some(true) == allow_prebuilt_nasm() {
eprintln!(
"Build environment has both `AWS_LC_SYS_PREBUILT_NASM` and `AWS_LC_SYS_NO_ASM` set.\
Please remove one of these environment variables.
See User Guide: https://aws.github.io/aws-lc-rs/index.html"
);
}
if !is_no_asm() && !test_nasm_command() && !use_prebuilt_nasm() {
eprintln!(
"Consider installing NASM or setting `AWS_LC_SYS_PREBUILT_NASM` in the build environment.\
See User Guide: https://aws.github.io/aws-lc-rs/index.html"
);
eprintln!("Missing dependency: nasm");
missing_dependency = true;
}
if target_arch() == "aarch64" && target_env() == "msvc" && !test_clang_cl_command() {
eprintln!("Missing dependency: clang-cl");
missing_dependency = true;
}
}
if let Some(cmake_cmd) = find_cmake_command() {
unsafe {
env::set_var("CMAKE", cmake_cmd);
}
} else {
eprintln!("Missing dependency: cmake");
missing_dependency = true;
}
if missing_dependency {
return Err("Required build dependency is missing. Halting build.".to_owned());
}
Ok(())
}
fn build(&self) -> Result<(), String> {
self.build_library();
println!(
"cargo:rustc-link-search=native={}",
self.artifact_output_dir().display()
);
println!(
"cargo:rustc-link-lib={}={}",
self.output_lib_type.rust_lib_type(),
Crypto.libname(&self.build_prefix)
);
if cfg!(feature = "ssl") {
println!(
"cargo:rustc-link-lib={}={}",
self.output_lib_type.rust_lib_type(),
Ssl.libname(&self.build_prefix)
);
}
Ok(())
}
fn name(&self) -> &'static str {
"CMake"
}
}

1306
vendor/aws-lc-sys/builder/main.rs vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,143 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
use std::ffi::OsString;
use std::fs;
use std::path::{Path, PathBuf};
use crate::{execute_command, target_arch, test_nasm_command, use_prebuilt_nasm};
#[derive(Debug)]
pub(crate) struct NasmBuilder {
files: Vec<PathBuf>,
includes: Vec<PathBuf>,
defines: Vec<(String, Option<String>)>,
flags: Vec<String>,
out_dir: PathBuf,
manifest_dir: PathBuf,
}
impl NasmBuilder {
pub(crate) fn new(manifest_dir: PathBuf, out_dir: PathBuf) -> Self {
Self {
files: Vec::new(),
includes: Vec::new(),
defines: Vec::new(),
flags: Vec::new(),
out_dir,
manifest_dir,
}
}
pub(crate) fn file<P: AsRef<Path>>(&mut self, p: P) -> &mut Self {
self.files.push(p.as_ref().to_path_buf());
self
}
pub(crate) fn include<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self {
self.includes.push(dir.as_ref().to_path_buf());
self
}
pub(crate) fn define(&mut self, key: &str, val: Option<&str>) -> &mut Self {
self.defines
.push((key.to_string(), val.map(std::string::ToString::to_string)));
self
}
pub(crate) fn flag(&mut self, flag: &str) -> &mut Self {
self.flags.push(flag.to_string());
self
}
pub(crate) fn compile_intermediates(&self) -> Vec<PathBuf> {
let mut objects = Vec::new();
if self.files.is_empty() {
return vec![];
}
if test_nasm_command() {
for src in &self.files {
let obj_name = src
.file_name()
.unwrap()
.to_str()
.unwrap()
.replace(".asm", ".obj");
let obj_path = self.out_dir.join(obj_name);
let format = match target_arch().as_str() {
"x86_64" => "win64",
_ => "win32",
};
let mut args: Vec<OsString> = vec![
"-f".into(),
format.into(),
"-o".into(),
obj_path.as_os_str().into(),
];
for inc in &self.includes {
args.push("-I".into());
args.push(inc.as_os_str().into());
}
for (key, val) in &self.defines {
let def = if let Some(v) = val {
format!("-D{key}={v}")
} else {
format!("-D{key}")
};
args.push(def.into());
}
args.extend(self.flags.iter().map(std::convert::Into::into));
args.push(src.as_os_str().into());
let result = execute_command(
"nasm".as_ref(),
&args
.iter()
.map(std::ffi::OsString::as_os_str)
.collect::<Vec<_>>(),
);
assert!(
result.status,
"NASM failed for {}:\n-----\n{}\n-----\n{}\n-----\n",
src.display(),
result.stdout,
result.stderr
);
objects.push(obj_path);
}
} else if use_prebuilt_nasm() {
let prebuilt_dir = self.manifest_dir.join("builder").join("prebuilt-nasm");
for src in &self.files {
let obj_name = src
.file_name()
.unwrap()
.to_str()
.unwrap()
.replace(".asm", ".obj");
let obj_path = self.out_dir.join(&obj_name);
let base_name = obj_name.strip_suffix(".obj").unwrap_or(&obj_name);
let prebuilt_src = prebuilt_dir.join(format!("{base_name}.obj"));
if prebuilt_src.exists() {
fs::copy(&prebuilt_src, &obj_path)
.expect("Failed to copy prebuilt NASM object");
} else {
panic!("Prebuilt NASM object not found: {}", prebuilt_src.display());
}
objects.push(obj_path);
}
} else {
panic!("NASM command not found! Build cannot continue.");
}
objects
}
}

View File

@@ -0,0 +1,25 @@
REM -- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
REM -- SPDX-License-Identifier: Apache-2.0 OR ISC
@echo off
set "ScriptDir=%~dp0"
set "ScriptDir=%ScriptDir:~0,-1%"
:loop
set "arg1=%~1"
if "%arg1%"=="-o" goto end
if "%arg1%"=="" goto failure
shift
goto loop
:end
shift
set "path=%~1"
for %%f in ("%path%") do set "filename=%%~nxf"
REM Extract the base filename before the first dot, similar to the shell script
for /f "tokens=1 delims=." %%a in ("%filename%") do set "basename=%%a"
copy "%ScriptDir%\prebuilt-nasm\%basename%.obj" "%path%"
exit 0
:failure
echo PATH: %path% 1>&2
echo FILENAME: %filename% 1>&2
echo ScriptDir: %ScriptDir% 1>&2
exit 1

27
vendor/aws-lc-sys/builder/prebuilt-nasm.sh vendored Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
while [[ $# -gt 0 ]]; do
case "$1" in
-o)
shift
path="$1"
filename="$(basename "$path")"
filename="$(echo "$filename" | cut -f 1 -d '.')"
cp "$SCRIPT_DIR/prebuilt-nasm/${filename}".obj "$path"
exit 0
;;
*)
shift
;;
esac
done
# If we reach here, it means we didn't find the -o option
echo "PATH: $path" >&2
echo "FILENAME: $filename" >&2
echo "SCRIPT_DIR: $SCRIPT_DIR" >&2
exit 1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

44
vendor/aws-lc-sys/builder/printenv.bat vendored Normal file
View File

@@ -0,0 +1,44 @@
@echo off
setlocal EnableDelayedExpansion
set "TOP_DIR=%ProgramFiles(x86)%\Microsoft Visual Studio"
for /f "usebackq tokens=* delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do (
set "TOP_DIR=%%i"
echo VS Installation: "!TOP_DIR!"
if exist "!TOP_DIR!\VC\Auxiliary\Build\vcvarsall.bat" (
set "VS_PATH=!TOP_DIR!\VC\Auxiliary\Build\"
echo FOUND in Installation: "!VS_PATH!"
goto FoundVS
)
goto SearchVS
)
echo Visual Studio installation not found using vswhere. Searching in default directories...
:SearchVS
for /R "%TOP_DIR%" %%a in (vcvarsall.bat) do (
if exist "%%~fa" (
set "VS_PATH=%%~dpa"
echo FOUND: "!VS_PATH!"
goto FoundVS
)
)
echo vcvarsall.bat not found.
goto End
:FoundVS
call "!VS_PATH!vcvarsall.bat" x64
if !ERRORLEVEL! neq 0 (
echo Failed to set Visual Studio environment variables.
echo PATH: "!VS_PATH!vcvarsall.bat"
goto End
)
echo Visual Studio environment variables set for x64.
set
endlocal
exit /b 0
:End
endlocal
exit /b 1

149
vendor/aws-lc-sys/builder/sys_bindgen.rs vendored Normal file
View File

@@ -0,0 +1,149 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
use crate::{
effective_target, emit_warning, get_rust_include_path, is_all_bindings, BindingOptions,
EnvGuard, COPYRIGHT, PRELUDE,
};
use bindgen::callbacks::{ItemInfo, ParseCallbacks};
use std::fmt::Debug;
use std::path::Path;
#[derive(Debug)]
struct StripPrefixCallback {
remove_prefix: Option<String>,
}
impl StripPrefixCallback {
fn new(prefix: &str) -> StripPrefixCallback {
StripPrefixCallback {
remove_prefix: Some(prefix.to_string()),
}
}
}
impl ParseCallbacks for StripPrefixCallback {
fn generated_name_override(&self, item_info: ItemInfo<'_>) -> Option<String> {
self.remove_prefix.as_ref().and_then(|s| {
let prefix = format!("{s}_");
item_info
.name
.strip_prefix(prefix.as_str())
.map(String::from)
})
}
}
const ALLOWED_HEADERS: [&str; 30] = [
"aead.h",
"aes.h",
"base.h",
"bn.h",
"boringssl_prefix_symbols.h",
"boringssl_prefix_symbols_asm.h",
"boringssl_prefix_symbols_nasm.inc",
"bytestring.h",
"chacha.h",
"cipher.h",
"cmac.h",
"crypto.h",
"curve25519.h",
"digest.h",
"ec.h",
"ec_key.h",
"ecdh.h",
"ecdsa.h",
"err.h",
"evp.h",
"hkdf.h",
"hmac.h",
"is_awslc.h",
"kdf.h",
"mem.h",
"nid.h",
"poly1305.h",
"rand.h",
"rsa.h",
"sha.h",
];
// These functions have parameters using a blocked type
const BLOCKED_FUNCTIONS: [&str; 5] = [
"BN_print_fp",
"CBS_parse_generalized_time",
"CBS_parse_utc_time",
"ERR_print_errors_fp",
"RSA_print_fp",
];
// These types might vary by platform. Ensure that they do not appear in the universal bindings.
const BLOCKED_TYPES: [&str; 4] = ["FILE", "fpos_t", "tm", "__sFILE"];
fn prepare_bindings_builder(manifest_dir: &Path, options: &BindingOptions) -> bindgen::Builder {
let clang_args = crate::prepare_clang_args(manifest_dir, options);
let mut builder = bindgen::Builder::default()
.derive_copy(true)
.derive_debug(true)
.derive_default(true)
.derive_eq(true)
.allowlist_file(r".*(/|\\)rust_wrapper\.h")
.rustified_enum(r"point_conversion_form_t")
.rust_target(bindgen::RustTarget::stable(70, 0).unwrap())
.default_macro_constant_type(bindgen::MacroTypeVariation::Signed)
.generate_comments(true)
.fit_macro_constants(false)
.size_t_is_usize(true)
.layout_tests(true)
.prepend_enum_name(true)
.formatter(bindgen::Formatter::Rustfmt)
.clang_args(clang_args)
.raw_line(COPYRIGHT)
.header(
get_rust_include_path(manifest_dir)
.join("rust_wrapper.h")
.display()
.to_string(),
);
if is_all_bindings() {
builder = builder.allowlist_file(r".*(/|\\)openssl((/|\\)[^/\\]+)+\.h");
} else {
for header in ALLOWED_HEADERS {
emit_warning(format!("Allowed header: {header}").as_str());
builder = builder.allowlist_file(format!("{}{}", r".*(/|\\)openssl(/|\\)", header));
}
for function in BLOCKED_FUNCTIONS {
emit_warning(format!("Blocked function: {function}").as_str());
builder = builder.blocklist_function(function);
}
for tipe in BLOCKED_TYPES {
emit_warning(format!("Opaque type: {tipe}").as_str());
builder = builder.blocklist_type(tipe);
}
}
if !options.disable_prelude {
builder = builder.raw_line(PRELUDE);
}
if options.include_ssl {
builder = builder.clang_arg("-DAWS_LC_RUST_INCLUDE_SSL");
}
if let Some(prefix) = &options.build_prefix {
let callbacks = StripPrefixCallback::new(prefix.as_str());
builder = builder.parse_callbacks(Box::new(callbacks));
}
builder
}
pub(crate) fn generate_bindings(
manifest_dir: &Path,
options: &BindingOptions,
) -> bindgen::Bindings {
let _guard_target = EnvGuard::new("TARGET", effective_target());
prepare_bindings_builder(manifest_dir, options)
.generate()
.expect("Unable to generate bindings.")
}