briansmith / ring

Safe, fast, small crypto using Rust
Other
3.68k stars 693 forks source link

Issue while crosscompiling ring for aarch64 #1936

Closed chiru091096 closed 6 months ago

chiru091096 commented 6 months ago

Hello,

I'm was trying to cross compile ring v0.17.3 for aarch64. I got the below error

fatal error: stdint.h: No such file or directory
#include_next <stdint.h>

Upon adding path of stdint.h in build.rs (at line no. 537) I was able to fix the error. (Added c.flag("-I/path/to/include")) https://github.com/briansmith/ring/blob/ee5db436170388b28b8e8f548eee62de61f1268f/build.rs#L534-L544

However, same changes in ring v0.17.2 is not fixing the error. I specifically want to cross compile ring v0.16.20. What changes can I make to build.rs in older versions of ring to fix this error. I'm fairly new to rust. Any help on this will be appreciated.

briansmith commented 6 months ago

What are the exact commands you are using to build? TARGET_CC=? TARGET_AR=? cargo build --target=?

chiru091096 commented 6 months ago

@briansmith

cargo build --target=aarch64-unknown-linux-gnu

I can see below logs

TARGET = Some("aarch64-unknown-linux-gnu") HOST = Some("x86_64-unknown-linux-gnu") TARGET_CC= None

briansmith commented 6 months ago

OK, take a look at mk/{install-build-tools,cargo}.sh in this repo to understand how to configure the C toolchain to cross-compile ring.

chiru091096 commented 6 months ago

OK, take a look at mk/{install-build-tools,cargo}.sh in this repo to understand how to configure the C toolchain to cross-compile ring.

I will check that. Thanks @briansmith