libwebp-sys icon indicating copy to clipboard operation
libwebp-sys copied to clipboard

Issues building on Apple M1 chips

Open chrux opened this issue 3 years ago • 1 comments

Hello,

I tried building this in an Apple Silicon chip and got this error

Compiling tokio-native-tls v0.3.0
The following warnings were emitted during compilation:

warning: clang: error: the clang compiler does not support '-march=native'
warning: clang: error: the clang compiler does not support '-march=native'

error: failed to run custom build command for `libwebp-sys v0.6.0`

Caused by:
  process didn't exit successfully: `/Users/christian/Developer/cmnh/imageflow/target/release/build/libwebp-sys-647a8e6d13b44bda/build-script-build` (exit status: 1)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = Some(" -march=native -O3")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = Some(" -march=native -O3")
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-march=native" "-O3" "-I" "/Users/christian/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.6.0/vendor" "-fvisibility=hidden" "-DNDEBUG=1" "-D_THREAD_SAFE=1" "-DWEBP_HAVE_NEON=1" "-o" "/Users/christian/Developer/cmnh/imageflow/target/release/build/libwebp-sys-0c4a95c8caa884c9/out/alpha_dec.o" "-c" "/Users/christian/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.6.0/vendor/src/dec/alpha_dec.c"
  cargo:warning=clang: error: the clang compiler does not support '-march=native'
  exit status: 1
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-arch" "arm64" "-march=native" "-O3" "-I" "/Users/christian/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.6.0/vendor" "-fvisibility=hidden" "-DNDEBUG=1" "-D_THREAD_SAFE=1" "-DWEBP_HAVE_NEON=1" "-o" "/Users/christian/Developer/cmnh/imageflow/target/release/build/libwebp-sys-0c4a95c8caa884c9/out/buffer_dec.o" "-c" "/Users/christian/.cargo/registry/src/github.com-1ecc6299db9ec823/libwebp-sys-0.6.0/vendor/src/dec/buffer_dec.c"
  cargo:warning=clang: error: the clang compiler does not support '-march=native'
  exit status: 1

  --- stderr

Any workaround or indication about how to build/run this on this arch. Thanks

chrux avatar Jul 26 '22 03:07 chrux

Could you provide the version of CLANG used? it may be helpful to upgrade CLANG.

NoXF avatar Aug 01 '22 07:08 NoXF