briansmith/ring

Ring compile error when trying to cross compile from windows 10 to x86_64-unknown-linux-gnu

PierreV23 opened this issue · 2 comments

PS C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api> cargo clean
     Removed 0 files
PS C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api> cargo build --target x86_64-unknown-linux-gnu
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling libc v0.2.153
   Compiling cfg-if v1.0.0
   Compiling memchr v2.7.2
   Compiling scopeguard v1.2.0
   Compiling itoa v1.0.11
   Compiling bytes v1.6.0
   Compiling pin-project-lite v0.2.14
   Compiling once_cell v1.19.0
   Compiling log v0.4.21
   Compiling futures-core v0.3.30
   Compiling fnv v1.0.7
   Compiling cc v1.0.90
   Compiling smallvec v1.13.2
   Compiling futures-sink v0.3.30
   Compiling parking_lot_core v0.9.9
   Compiling version_check v0.9.4
   Compiling futures-channel v0.3.30
   Compiling pin-utils v0.1.0
   Compiling futures-task v0.3.30
   Compiling futures-io v0.3.30
   Compiling crossbeam-utils v0.8.19
   Compiling serde v1.0.197
   Compiling httparse v1.8.0
   Compiling tracing-core v0.1.32
   Compiling lock_api v0.4.11
   Compiling slab v0.4.9
   Compiling num-traits v0.2.18
   Compiling simd-adler32 v0.3.7
   Compiling untrusted v0.9.0
   Compiling rayon-core v1.12.1
   Compiling percent-encoding v2.3.1
   Compiling quote v1.0.35
   Compiling signal-hook-registry v1.4.1
   Compiling syn v2.0.57
   Compiling spin v0.9.8
   Compiling parking_lot v0.12.1
   Compiling num_cpus v1.16.0
   Compiling socket2 v0.5.6
   Compiling mio v0.8.11
   Compiling getrandom v0.2.12
   Compiling crossbeam-epoch v0.9.18
   Compiling rustversion v1.0.14
   Compiling crossbeam-deque v0.8.5
   Compiling tracing v0.1.40
   Compiling num-bigint v0.4.4
   Compiling httpdate v1.0.3
   Compiling thiserror v1.0.58
   Compiling tinyvec_macros v0.1.1
   Compiling tower-service v0.3.2
   Compiling tinyvec v1.6.0
   Compiling form_urlencoded v1.2.1
   Compiling num-rational v0.4.1
   Compiling http v1.1.0
   Compiling http v0.2.12
   Compiling num-integer v0.1.46
   Compiling serde_json v1.0.115
   Compiling anyhow v1.0.81
   Compiling spin v0.5.2
   Compiling hashbrown v0.14.3
   Compiling adler v1.0.2
   Compiling rustls v0.20.9
   Compiling time-core v0.1.2
   Compiling ring v0.17.8
   Compiling ring v0.16.20
   Compiling ryu v1.0.17
   Compiling crc32fast v1.4.0
   Compiling powerfmt v0.2.0
   Compiling untrusted v0.7.1
   Compiling num-conv v0.1.0
   Compiling either v1.10.0
   Compiling equivalent v1.0.1
   Compiling time-macros v0.2.17
   Compiling indexmap v2.2.6
   Compiling deranged v0.3.11
   Compiling http-body v1.0.0
   Compiling unicode-normalization v0.1.23
   Compiling miniz_oxide v0.7.2
   Compiling proc-macro-error-attr v1.0.4
   Compiling cookie v0.16.2
   Compiling built v0.7.1
The following warnings were emitted during compilation:

warning: ring@0.16.20: Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api\target\debug\build\ring-519a9560217d3da8\build-script-build` (exit code: 101)
  --- stdout
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some("x86_64-unknown-linux-gnu-gcc")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr
  running "x86_64-unknown-linux-gnu-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-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" "-oC:\\Users\\Pierre <redacted lastname>\\Documents\\GitHub\\priv\\pv23-api\\target\\x86_64-unknown-linux-gnu\\debug\\build\\ring-9c4164b4b4c5dcbc\\out\\aesni-x86_64-elf.o" "C:\\Users\\Pierre <redacted lastname>\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.16.20\\pregenerated\\aesni-x86_64-elf.S"
  thread 'main' panicked at C:\Users\Pierre <redacted lastname>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ring-0.16.20\build.rs:653:9:
  failed to execute ["x86_64-unknown-linux-gnu-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-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" "-oC:\\Users\\Pierre <redacted lastname>\\Documents\\GitHub\\priv\\pv23-api\\target\\x86_64-unknown-linux-gnu\\debug\\build\\ring-9c4164b4b4c5dcbc\\out\\aesni-x86_64-elf.o" "C:\\Users\\Pierre <redacted lastname>\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.16.20\\pregenerated\\aesni-x86_64-elf.S"]: program not found
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: ring@0.17.8: Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"

error: failed to run custom build command for `ring v0.17.8`

Caused by:
  process didn't exit successfully: `C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api\target\debug\build\ring-e88f358f975b9c04\build-script-build` (exit code: 1)
  --- 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("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some("x86_64-unknown-linux-gnu-gcc")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr


  error occurred: Failed to find tool. Is `x86_64-unknown-linux-gnu-gcc` installed? (see https://github.com/rust-lang/cc-rs#compile-time-requirements for help)

i have llvm installed and i also tried this:

PS C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api> cargo clean
     Removed 841 files, 274.0MiB total
PS C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api> $env:CC = "clang"; cargo build --target x86_64-unknown-linux-gnu
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling autocfg v1.1.0
   Compiling libc v0.2.153
   Compiling cfg-if v1.0.0
   Compiling memchr v2.7.2
   Compiling scopeguard v1.2.0
   Compiling itoa v1.0.11
   Compiling bytes v1.6.0
   Compiling pin-project-lite v0.2.14
   Compiling once_cell v1.19.0
   Compiling log v0.4.21
   Compiling futures-core v0.3.30
   Compiling smallvec v1.13.2
   Compiling cc v1.0.90
   Compiling fnv v1.0.7
   Compiling version_check v0.9.4
   Compiling parking_lot_core v0.9.9
   Compiling futures-sink v0.3.30
   Compiling futures-io v0.3.30
   Compiling pin-utils v0.1.0
   Compiling futures-task v0.3.30
   Compiling futures-channel v0.3.30
   Compiling crossbeam-utils v0.8.19
   Compiling serde v1.0.197
   Compiling httparse v1.8.0
   Compiling tracing-core v0.1.32
   Compiling lock_api v0.4.11
   Compiling slab v0.4.9
   Compiling num-traits v0.2.18
   Compiling untrusted v0.9.0
   Compiling rayon-core v1.12.1
   Compiling simd-adler32 v0.3.7
   Compiling percent-encoding v2.3.1
   Compiling rustversion v1.0.14
   Compiling quote v1.0.35
   Compiling tracing v0.1.40
   Compiling spin v0.9.8
   Compiling num-bigint v0.4.4
   Compiling syn v2.0.57
   Compiling num_cpus v1.16.0
   Compiling mio v0.8.11
   Compiling signal-hook-registry v1.4.1
   Compiling socket2 v0.5.6
   Compiling parking_lot v0.12.1
   Compiling crossbeam-epoch v0.9.18
   Compiling getrandom v0.2.12
   Compiling crossbeam-deque v0.8.5
   Compiling tower-service v0.3.2
   Compiling tinyvec_macros v0.1.1
   Compiling httpdate v1.0.3
   Compiling thiserror v1.0.58
   Compiling tinyvec v1.6.0
   Compiling num-integer v0.1.46
   Compiling form_urlencoded v1.2.1
   Compiling num-rational v0.4.1
   Compiling http v1.1.0
   Compiling http v0.2.12
   Compiling ring v0.17.8
   Compiling ring v0.16.20
   Compiling equivalent v1.0.1
   Compiling either v1.10.0
   Compiling num-conv v0.1.0
   Compiling serde_json v1.0.115
   Compiling time-core v0.1.2
   Compiling anyhow v1.0.81
   Compiling hashbrown v0.14.3
   Compiling crc32fast v1.4.0
   Compiling rustls v0.20.9
   Compiling powerfmt v0.2.0
The following warnings were emitted during compilation:

warning: ring@0.17.8: Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"

error: failed to run custom build command for `ring v0.17.8`

Caused by:
  process didn't exit successfully: `C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api\target\debug\build\ring-e88f358f975b9c04\build-script-build` (exit code: 1)
  --- 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("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some("x86_64-unknown-linux-gnu-gcc")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr


  error occurred: Failed to find tool. Is `x86_64-unknown-linux-gnu-gcc` installed? (see https://github.com/rust-lang/cc-rs#compile-time-requirements for help)


warning: build failed, waiting for other jobs to finish...
The following warnings were emitted during compilation:

warning: ring@0.16.20: Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"

error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `C:\Users\Pierre <redacted lastname>\Documents\GitHub\priv\pv23-api\target\debug\build\ring-519a9560217d3da8\build-script-build` (exit code: 101)
  --- stdout
  OPT_LEVEL = Some("0")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some("x86_64-unknown-linux-gnu-gcc")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Failed to run: "x86_64-unknown-linux-gnu-gcc" "--version"
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr
  running "x86_64-unknown-linux-gnu-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-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" "-oC:\\Users\\Pierre <redacted lastname>\\Documents\\GitHub\\priv\\pv23-api\\target\\x86_64-unknown-linux-gnu\\debug\\build\\ring-9c4164b4b4c5dcbc\\out\\aesni-x86_64-elf.o" "C:\\Users\\Pierre <redacted lastname>\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.16.20\\pregenerated\\aesni-x86_64-elf.S"
  thread 'main' panicked at C:\Users\Pierre <redacted lastname>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ring-0.16.20\build.rs:653:9:
  failed to execute ["x86_64-unknown-linux-gnu-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-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" "-oC:\\Users\\Pierre <redacted lastname>\\Documents\\GitHub\\priv\\pv23-api\\target\\x86_64-unknown-linux-gnu\\debug\\build\\ring-9c4164b4b4c5dcbc\\out\\aesni-x86_64-elf.o" "C:\\Users\\Pierre <redacted lastname>\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\ring-0.16.20\\pregenerated\\aesni-x86_64-elf.S"]: program not found
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Do you have x86_64-unknown-linux-gnu-gcc installed in Windows? Probably not. That's the problem.

I added it as a target with rustup and i also installed clang which did not work. Maybe a bit hasty with tagging this as completed?