-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustc on Mac OS X: "unknown option --as-needed" #34282
Comments
When you're cross-compiling, you have to point cargo at an appropriate C toolchain, to pick up necessary bits like the correct linker and C runtime. See also http://blog.rust-lang.org/2016/05/13/rustup.html , in particular the discussion of the "linker" option. |
Yeah currently this is expected, albeit unfortunate, behavior. As @eefriedman mentioned the key thing here is finding a linker for mipsel-unknown-linux-gnu which the native system linker doesn't support on OSX. As this is expected, though, I'm gonna close this, but feel free to ask questions! Unfortunately I've never heard of anyone successfully crossing from OSX to mips Linux, but in theory it's definitely possible! |
Following https://github.com/chinedufn/cross-compile-rust-from-mac-to-linux, the following worked for me:
|
It would be great if |
Thanks for your reply, I tried add these to
|
Thanks for sharing. It worked for me as well, although the linker path is a bit different for me:
|
From a newbie's perspective, |
It's a homebrew issue, don't know it's about homebrew version or macOS version and it confuses me when I write scripts for both my M1 laptop (macOS 13.4) and Intel desktop(macOS 12.6) |
|
When trying to cross-compile to a new target (installed by
rustup
) it looks like--as-needed
is spawned byrustc
, but this isn't available on Mac OS X (El Capitain)The text was updated successfully, but these errors were encountered: