#Cross compiling linux to intel based mac

18 messages · Page 1 of 1 (latest)

hallow jetty
#

I am on Linux(x86_64-unknown-linux-gnu), and trying to cross compile for Intel based Mac (x86_64-apple-darwin). My code is the default hello world script, when I run the command cargo build --target=x86_64-apple-darwin on my terminal I get the following error:

error: linking with `cc` failed: exit status: 1
note: <imagine a long path here>
note: cc: error: unrecognized command-line option '-arch'
error: could not compile `hello_world` (bin "hello_world") due to previous error

Here is my Cargo.toml:

[package]
name = "hello_world"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

Here are the respective versions of the rust tool chain:

rustup 1.26.0
cargo 1.70.0
rustc 1.70.0

I have searched my various errors and have found that these two articles have the most in common with my errors:
Article one: https://github.com/rust-lang/rust/issues/112501
Article two: https://stackoverflow.com/questions/75485076
Unfortunately both of them are unsolved or don't have a clear solution.
Here is some info on my operating system if needed:

OS: Debian GNU/Linux 12 (bookworm) x86_64
Kernel: 6.1.0-9-amd64
DE: Plasma 5.27.5

If anyone knows as to why I can't cross compile and has a solution, thanks in advance.

tepid sphinx
#

Cross compiling to Mac is a very hard task

#

Because apple doesn't make it easy

hallow jetty
#

i think i am just missing some packages or tools

tepid sphinx
#

Don't forget you have to sign the executable with a apple developer key after

hallow jetty
#

how do you get the key?

#

do I need to make a dev account on the website?

tepid sphinx
#

Yeah

hallow jetty
#

sad

tepid sphinx
#

And I believe the signing must be done on a Mac computer

hallow jetty
#

all that just for testing the hello world script lol

#

so what I am getting is there is no "native" way to cross compile for mac

tepid sphinx
#

Correct, for a long time it was actually against Apple's terms of service

hallow jetty
#

i didn't think they would ever loosen up for everyone, now they have a way to get more customers and developers

#

alright it seems developing for mac is just a pain and most likely not all that useful for me. I am just gonna close this thread, hopefully people reading this thread in the future don't have to do this the same way.

#

is there like a close command?

tepid sphinx