Open AndreKR opened 3 years ago
You can (probably) cross-compile from Windows to Linux now if you install clang and its related tools. Or you can simply build within WSL. I build ring for Linux on Windows all day every day myself (in WSL).
I do want to make it easier to build ring. Especially I do want to make it possible to do so without needing to install a C toolchian. There is not much C code in ring so it's no longer a monumental effort to replace it with Rust code; I only know of one area where we might have an issue doing so. We'd need a solution for all the assembly code though. Probably we need to pre-assemble it and put the .o files in the crate like we do for Windows.
Or you can simply build within WSL.
Ah, right. Still being on Windows 7 myself, I often forget that normal people have WSL available.
We'd need a solution for all the assembly code though.
Rust's inline assembly isn't suitable? I have never used it myself, so I wouldn't know.
I am getting the same error on both WSL and Windows. I need to cross-compile for my pi.
--- stderr
running "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=armv7-a" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/mnt/c/Users/RISHI/OneDrive/Desktop/Programs/getrate/target/armv7-unknown-linux-gnueabihf/debug/build/ring-984af0d76ff4eeb7/out/aesv8-armx-linux32.o" "/home/blaine/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux32.S"
thread 'main' panicked at 'failed to execute ["arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=armv7-a" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-c" "-o/mnt/c/Users/RISHI/OneDrive/Desktop/Programs/getrate/target/armv7-unknown-linux-gnueabihf/debug/build/ring-984af0d76ff4eeb7/out/aesv8-armx-linux32.o" "/home/blaine/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesv8-armx-linux32.S"]: No such file or directory (os error 2)', /home/blaine/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:653:9
This crate is required by reqwest -> hyper-rustls -> rustls...
Look at mk/cargo.sh in this repo to get a sense of what you need to do to cross-compile a mixed C/Rust application, or use the cross
tool (if it is still maintained).
With a
rustup
-installed toolchain it is currently possible to cross compile Rust projects from Windows to Linux by specifying[target.x86_64-unknown-linux-musl] linker = "rust-lld"
in the Cargo config (≠ Cargo.toml). However, this is not possible if any of the dependencies use C code, which ring currently does.My direct dependency is rustls and I was about to open an issue there about swapping out ring for RustCrypto (which is pure Rust) when I came across this comment. It says that it is an ongoing goal of ring to build on/for more targets, so maybe long-term it's not necessary/advantageous to replace it with RustCrypto in rustls.
Is support for cross-compilation from Windows to Linux, possibly by replacing any C code with RustCrypto, part of that goal?