Open wafflespeanut opened 1 year ago
Can you confirm that you can cross-compile the simplest hello-world Rust snippet on Linux for MacOS? Not that I know it can't ever work, but if I simply add x86_64-apple-darwin target and try to compile "hello, world", I get error messages similar to yours. This suggests that you might have also attempted simply adding the target. And from what I do know, those error message are not unexpected. And even if I tweak my environment to bypass the -arch
error, I'll face even more serious problems later on.
As a general rule of thumb. In most common, all non-bare-metal really, cases it's user's responsibility to provide working cross-compiling environment that actually meets specific expectations. Even for compiling pure Rust code, let alone mixed one. This is because even pure Rust relies on C toolchain to link the final application.
When I attempted to cross-compile
cxx
from linux, I got the following emitted fromlink-cplus-plus
dependency, which usescc-rs
:Instead of
-arch x86-64
, the argument should be-march=x86-64
for darwin target (-march
instead of-arch
as key-value parameter and Apple target is dashedx86-64
instead ofx86_64
).If there's some way to override or work around this, then I'd happily go for that until this issue can be fixed.