#CC create and assembly with nostd

6 messages · Page 1 of 1 (latest)

real perch
#

Hi, I need to directly call assembly from my rust code which requires the use the cc create: https://crates.io/crates/cc
My project uses nostd since my build target is x86_64-unknown-uefi, I only have access to core. When I create my build.rs and try to compile, it fails due to the cc requiring std references. Is there any way to have this also work for nostd. For example, with lazy_static, I can simply specify that I don't want it to use std with features = ["spin_no_std"] in the dependencies, but this doesn't work with the cc crate. Thanks in advance.

crisp heath
#

what's the exact error?

#

and how do you specify the dependency to cc?

real perch
#

The error is can't find crate for std in the .cargo/registry for the cc crate.

in Cargo.toml

[dependencies]
cc = "1.0.83"

And then adding it to build dependencies in ./.cargo/config.toml

[build-dependencies]
cc = { version = "1.0" }
crisp heath
#

I don't think you need cc under dependencies at all

#

you only need it for the build script, which is build-dependencies