diff --git a/build/build.rs b/build/build.rs index 3f5ca4b355..fa6cdacdea 100644 --- a/build/build.rs +++ b/build/build.rs @@ -187,7 +187,7 @@ const ASM_TARGETS: &[AsmTarget] = &[ perlasm_format: WIN32N, }, AsmTarget { - oss: &[WINDOWS], + oss: &[WINDOWS, CYGWIN], arch: X86_64, perlasm_format: NASM, }, @@ -253,6 +253,7 @@ const NASM: &str = "nasm"; const APPLE_ABI: &[&str] = &["ios", "macos", "tvos", "visionos", "watchos"]; const WINDOWS: &str = "windows"; +const CYGWIN: &str = "cygwin"; pub fn generate_sources_and_preassemble<'a>( tools: &Tools, @@ -344,7 +345,7 @@ pub fn build_c_code( // them. if extension == "S" && (target.arch == X86_64 || target.arch == X86) - && target.os == WINDOWS + && (target.os == WINDOWS || target.os == CYGWIN) { return false; } diff --git a/src/ec/curve25519/ops.rs b/src/ec/curve25519/ops.rs index 969550fb00..f6dc98fdec 100644 --- a/src/ec/curve25519/ops.rs +++ b/src/ec/curve25519/ops.rs @@ -71,7 +71,7 @@ pub struct P3 { impl P3 { // Returns the result of multiplying the base point by the scalar in constant time. pub(super) fn from_scalarmult_base(scalar: &Scalar, cpu: cpu::Features) -> Self { - #[cfg(all(target_arch = "x86_64", not(windows)))] + #[cfg(all(target_arch = "x86_64", not(windows), not(target_os = "cygwin")))] if let Some(cpu) = super::adx::get_features(cpu) { return super::adx::scalarmult_base(scalar, cpu); } diff --git a/src/ec/curve25519/x25519.rs b/src/ec/curve25519/x25519.rs index 96ac71f73c..ee82d86de6 100644 --- a/src/ec/curve25519/x25519.rs +++ b/src/ec/curve25519/x25519.rs @@ -119,7 +119,7 @@ fn x25519_ecdh( return x25519_neon(out, scalar, point, cpu); } - #[cfg(all(target_arch = "x86_64", not(windows)))] + #[cfg(all(target_arch = "x86_64", not(windows), not(target_os = "cygwin")))] if super::adx::get_features(cpu).is_some() { prefixed_extern! { unsafe fn x25519_scalar_mult_adx( diff --git a/src/rand.rs b/src/rand.rs index d9c54cabd6..07b02e2cd9 100644 --- a/src/rand.rs +++ b/src/rand.rs @@ -128,6 +128,7 @@ impl SystemRandom { all(feature = "less-safe-getrandom-espidf", target_os = "espidf"), target_os = "aix", target_os = "android", + target_os = "cygwin", target_os = "dragonfly", target_os = "freebsd", target_os = "fuchsia",