Closed tmpfs closed 1 year ago
Running into the same issues.
Alright, this was partially a matter of RTFM for me.
Documentations shows you need to set TARGET_CC
for cross compile, it also says it uses clang. So it should be worth noting you need clang-cl
as your TARGET_CC
to cross compile.
However...
There is a bug in the build.rs
for 16.20 that causes the compile to fail anyway. This is fixed in the 0.17.0-alpha.11
.
Of course, it's alpha... hopefully a full 0.17 will be released.
Thanks! I am going to close this since it seems to be resolved. I'm hoping to make the cross-compiling "just work" in the near future.
Trying to cross compile to aarch64-pc-windows-msvc
with clang-cl
fails the build.rs of ring with this error:
error: failed to run custom build command for `ring v0.17.8`
Caused by:
process didn't exit successfully: `/target/debug/build/ring-24946b25ae0d9fc1/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
OPT_LEVEL = Some("0")
TARGET = Some("aarch64-pc-windows-msvc")
HOST = Some("aarch64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc
CC_aarch64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc
CC_aarch64_pc_windows_msvc = Some("/usr/lib/llvm-18/bin/clang-cl")
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("neon")
DEBUG = Some("true")
cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc
CFLAGS_aarch64-pc-windows-msvc = None
cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc
CFLAGS_aarch64_pc_windows_msvc = Some("-fuse-ld=lld /winsysroot /home/docker/msvc")
--- stderr
running "clang" "-O0" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "--target=aarch64-pc-windows-msvc" "-fuse-ld=lld" "/winsysroot" "/home/docker/msvc" "-I" "include" "-I" "/target/aarch64-pc-windows-msvc/debug/build/ring-094b8bdf4cbf5b2b/out" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-o/target/aarch64-pc-windows-msvc/debug/build/ring-094b8bdf4cbf5b2b/out/aesv8-armx-win64.o" "/home/docker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/pregenerated/aesv8-armx-win64.S"
clang: error: no such file or directory: '/winsysroot'
clang: warning: /home/docker/msvc: 'linker' input unused [-Wunused-command-line-argument]
thread 'main' panicked at /home/docker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/build.rs:670:9:
execution failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Trying to cross compile to
aarch64-pc-windows-msvc
withclang-cl
fails the build.rs of ring with this error:error: failed to run custom build command for `ring v0.17.8` Caused by: process didn't exit successfully: `/target/debug/build/ring-24946b25ae0d9fc1/build-script-build` (exit status: 101) --- stdout cargo:rerun-if-env-changed=RING_PREGENERATE_ASM cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_ OPT_LEVEL = Some("0") TARGET = Some("aarch64-pc-windows-msvc") HOST = Some("aarch64-unknown-linux-gnu") cargo:rerun-if-env-changed=CC_aarch64-pc-windows-msvc CC_aarch64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_aarch64_pc_windows_msvc CC_aarch64_pc_windows_msvc = Some("/usr/lib/llvm-18/bin/clang-cl") cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("neon") DEBUG = Some("true") cargo:rerun-if-env-changed=CFLAGS_aarch64-pc-windows-msvc CFLAGS_aarch64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_aarch64_pc_windows_msvc CFLAGS_aarch64_pc_windows_msvc = Some("-fuse-ld=lld /winsysroot /home/docker/msvc") --- stderr running "clang" "-O0" "--target=aarch64-pc-windows-msvc" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "--target=aarch64-pc-windows-msvc" "-fuse-ld=lld" "/winsysroot" "/home/docker/msvc" "-I" "include" "-I" "/target/aarch64-pc-windows-msvc/debug/build/ring-094b8bdf4cbf5b2b/out" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-c" "-o/target/aarch64-pc-windows-msvc/debug/build/ring-094b8bdf4cbf5b2b/out/aesv8-armx-win64.o" "/home/docker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/pregenerated/aesv8-armx-win64.S" clang: error: no such file or directory: '/winsysroot' clang: warning: /home/docker/msvc: 'linker' input unused [-Wunused-command-line-argument] thread 'main' panicked at /home/docker/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/build.rs:670:9: execution failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish...
@elichai Have you solved this problem? I also encountered the same problem.
Instead of using clang-cl, just use clang.
Hi,
Thanks for the library, I am having trouble compiling
ring:0.16.20
on Windows (I don't usually use windows so this is all very new to me).I have followed the instructions in
BUILDING.md
and I think I have installed all the right libraries (VSCode 2022 with the C++ Development workflow andMSVC v142 - VS 2019 C++ ARM64 build tools
) but it is quite likely I am missing something.I am note sure why rust thinks the host is x86_64 (
HOST = Some("x86_64-pc-windows-msvc")
) when I check the architecture:I get:
FYI, I am running Windows 11 on an M1 via Parallels but I don't know if that is relevant.
Any pointers would be much appreciated 🙏