Skip to content

Commit 34ba98f

Browse files
authored
Fix fips build for s390x (#656)
1 parent 121245c commit 34ba98f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/cross.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- [ powerpc64-unknown-linux-gnu, 1, 0 ]
4242
- [ powerpc64le-unknown-linux-gnu, 1, 0 ]
4343
- [ riscv64gc-unknown-linux-gnu, 0, 0 ]
44-
- [ s390x-unknown-linux-gnu, 0, 0 ]
44+
- [ s390x-unknown-linux-gnu, 0, 1 ]
4545
- [ x86_64-pc-windows-gnu, 0, 1 ]
4646
- [ x86_64-unknown-linux-musl, 0, 1 ]
4747
steps:

aws-lc-fips-sys/builder/cmake_builder.rs

+15
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ fn find_cmake_command() -> Option<OsString> {
6060
}
6161
}
6262

63+
fn has_target_cpu_optimization() -> bool {
64+
matches!(
65+
target_arch().as_str(),
66+
"x86_64" | "x86" | "aarch64" | "arm" | "powerpc64"
67+
)
68+
}
69+
6370
impl CmakeBuilder {
6471
pub(crate) fn new(
6572
manifest_dir: PathBuf,
@@ -166,6 +173,14 @@ impl CmakeBuilder {
166173
} else {
167174
panic!("AWS_LC_SYS_NO_ASM only allowed for debug builds!")
168175
}
176+
} else if !has_target_cpu_optimization() {
177+
emit_warning(&format!(
178+
"Assembly optimizations not available for target arch: {}.",
179+
target_arch()
180+
));
181+
// TODO: This should not be needed once resolved upstream
182+
// See: https://github.com/aws/aws-lc-rs/issues/655
183+
cmake_cfg.define("OPENSSL_NO_ASM", "1");
169184
}
170185

171186
if cfg!(feature = "asan") {

0 commit comments

Comments
 (0)