Skip to content

unable to cross-compile with ring v0.16.20 on AMD64 Linux host machine #1488

@fscarmen

Description

@fscarmen

I cross compiled BoringTun on amd64 linux.
I have run rustup target add x86_64-apple-darwin before.
It was successful to compile x86_64-unknown-linux-gnu.
However. It was failed in x86_64-apple-darwin

image

root@srv17612:~/boringtun# $HOME/.cargo/bin/cargo build --bin boringtun-cli --release --target x86_64-apple-darwin
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling smallvec v1.8.0
   Compiling autocfg v1.1.0
   Compiling once_cell v1.9.0
   Compiling scopeguard v1.1.0
   Compiling bitflags v1.3.2
   Compiling ansi_term v0.12.1
   Compiling spin v0.5.2
   Compiling pin-project-lite v0.2.8
   Compiling unicode-width v0.1.9
   Compiling ip_network v0.4.1
   Compiling itoa v1.0.1
   Compiling untrusted v0.7.1
   Compiling ip_network_table-deps-treebitmap v0.5.0
   Compiling hex v0.4.3
   Compiling untrusted v0.9.0
   Compiling boxfnonce v0.1.1
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling base64 v0.13.0
   Compiling libc v0.2.117
   Compiling tracing-core v0.1.22
   Compiling sharded-slab v0.1.4
   Compiling memoffset v0.6.5
   Compiling log v0.4.14
   Compiling crossbeam-utils v0.8.7
   Compiling parking_lot_core v0.9.1
   Compiling thread_local v1.1.4
   Compiling lock_api v0.4.6
   Compiling textwrap v0.11.0
   Compiling ip_network_table v0.2.0
   Compiling ring v0.16.20
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/root/boringtun/target/release/build/ring-660027d888985dc6/build-script-build` (exit status: 101)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-apple-darwin")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-apple-darwin = None
  CC_x86_64_apple_darwin = None
  TARGET_CC = None
  CC = None
  CROSS_COMPILE = None
  CFLAGS_x86_64-apple-darwin = None
  CFLAGS_x86_64_apple_darwin = None
  TARGET_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")

  --- stderr
  running "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-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" "-gfull" "-DNDEBUG" "-c" "-o/root/boringtun/target/x86_64-apple-darwin/release/build/ring-1ed844cb9f4b9d8e/out/aesni-x86_64-macosx.o" "/root/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/pregenerated/aesni-x86_64-macosx.S"
  cc: error: x86_64: No such file or directory
  cc: error: unrecognized debug output level ‘full’
  cc: error: unrecognized command line option ‘-arch’
  thread 'main' panicked at 'execution failed', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:656:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions