I have a CLI that I wrote and am trying to have it built for these targets in a Docker image based from the rust:1.53-slim
image:
x86_64-unknown-linux-gnu
x86_64-apple-darwin
x86_64-pc-windows-gnu
The Linux and Windows targets are building properly, but when I try to do the cross compile for the Darwin target, the hyper
crate continues to fail to compile because of the following error:
$ cargo build --locked --release --target x86_64-apple-darwin
# ...
# OMITTED COMPILE OUTPUTS
# ...
= note: cc: error: x86_64: No such file or directory
cc: error: unrecognized command line option '-arch'; did you mean '-march='?
error: aborting due to previous error
error: could not compile `hyper`
I've scoured the internet looking for clues or solutions to this but can't find anything thats helpful. Has anyone experienced or solved this before? Any guidance would be great!
EDIT:
Is there a GCC linker that I need to have installed via apt-get
for it to properly compile for darwin?