Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc: error: unrecognized command-line option: '-arch' #2956

Closed
simbleau opened this issue Aug 12, 2022 · 1 comment · Fixed by gfx-rs/metal-rs#303
Closed

cc: error: unrecognized command-line option: '-arch' #2956

simbleau opened this issue Aug 12, 2022 · 1 comment · Fixed by gfx-rs/metal-rs#303

Comments

@simbleau
Copy link
Contributor

For cross-compliation from Linux -> MacOS, I've tried compiling a simple crate only depending on wgpu and running cargo build --target x86_64-apple-darwin

I've also tried using cross for compilation and wgpu seems to be the only source of this issue. Apparently -arch is a CLI from Apple's version of GCC which is non standard and probably shouldn't be used if possible.

Here's what I always get,

   Compiling wgpu-core v0.13.2
The following warnings were emitted during compilation:

warning: cc: error: unrecognized command-line option ‘-arch’

error: failed to run custom build command for `objc_exception v0.1.2`

Caused by:
  process didn't exit successfully: `/home/simbleau/git/bevy-shell-template/target/debug/build/objc_exception-8d2f5636bf5ba727/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("0")
  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("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-arch" "x86_64" "-Wall" "-Wextra" "-o" "/home/simbleau/git/bevy-shell-template/target/x86_64-apple-darwin/debug/build/objc_exception-e36d8c149665e96b/out/extern/exception.o" "-c" "extern/exception.m"
  cargo:warning=cc: error: unrecognized command-line option ‘-arch’
  exit status: 1

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-arch" "x86_64" "-Wall" "-Wextra" "-o" "/home/simbleau/git/bevy-shell-template/target/x86_64-apple-darwin/debug/build/objc_exception-e36d8c149665e96b/out/extern/exception.o" "-c" "extern/exception.m" with args "cc" did not execute successfully (status code exit status: 1).
@teoxoy
Copy link
Member

teoxoy commented Feb 22, 2023

This doesn't seem to be an issue in wgpu, please open an issue over on the objc_exception repo (there seems to be one already opened that's related to cross compilation but I think it's different than this one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants