Argyle-Software / kyber

A rust implementation of the Kyber post-quantum KEM
https://docs.rs/pqc_kyber/
Apache License 2.0
164 stars 37 forks source link

Fails to build on M1 macOS (latest stable Rust) due to no_std #37

Closed adamierymenko closed 1 year ago

adamierymenko commented 1 year ago

You get this, which after a dive into a rabbit hole seems caused by no_std. Commenting out the no_std directive in lib.rs gets rid of this. Note that I am using reference so no AVX2 errors are involved.

no_std should maybe be a feature flag?

   Compiling pqc_kyber v0.2.1
error: `#[panic_handler]` function required, but not found

error: language item required, but not found: `eh_personality`
  |
  = note: this can occur when a binary crate with `#![no_std]` is compiled for a target where `eh_personality` is defined in the standard library
  = help: you may be able to compile for a target that doesn't need `eh_personality`, specify a target with `--target` or in `.cargo/config`

error: could not compile `pqc_kyber` due to 2 previous errors
mberry commented 1 year ago

I believe this might might be caused by build script conflicts?

Anyway can put this in to get stack unwinding for you, but would go the other way: enabling std rather than no_std.

mberry commented 1 year ago

Automatically closed by the PR but let me know if there is still any problems using the std feature from the master branch and I will reopen it.

Looking to roll this up into a version 0.4 release by the end of the week. Thanks :)