Skip to content

Commit

Permalink
Fix fips build for s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jan 13, 2025
1 parent 121245c commit d6cac03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- [ powerpc64-unknown-linux-gnu, 1, 0 ]
- [ powerpc64le-unknown-linux-gnu, 1, 0 ]
- [ riscv64gc-unknown-linux-gnu, 0, 0 ]
- [ s390x-unknown-linux-gnu, 0, 0 ]
- [ s390x-unknown-linux-gnu, 0, 1 ]
- [ x86_64-pc-windows-gnu, 0, 1 ]
- [ x86_64-unknown-linux-musl, 0, 1 ]
steps:
Expand Down
15 changes: 15 additions & 0 deletions aws-lc-fips-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ fn find_cmake_command() -> Option<OsString> {
}
}

fn has_target_cpu_optimization() -> bool {
matches!(
target_arch().as_str(),
"x86_64" | "x86" | "aarch64" | "arm" | "powerpc64"
)
}

impl CmakeBuilder {
pub(crate) fn new(
manifest_dir: PathBuf,
Expand Down Expand Up @@ -166,6 +173,14 @@ impl CmakeBuilder {
} else {
panic!("AWS_LC_SYS_NO_ASM only allowed for debug builds!")
}
} else if !has_target_cpu_optimization() {
emit_warning(&format!(
"Assembly optimizations not available for target arch: {}.",
target_arch()
));
// TODO: This should not be needed once resolved upstream
// See: https://github.com/aws/aws-lc-rs/issues/655
cmake_cfg.define("OPENSSL_NO_ASM", "1");
}

if cfg!(feature = "asan") {
Expand Down

0 comments on commit d6cac03

Please sign in to comment.