Replies: 1 comment
-
Thanks for pointing this out! Was not aware of the best practices for Apple platforms. I use Linux for development and Windows for video games, have yet to own a Mac (but will strongly consider one the M1 products for my next laptop, the reviews are killer 👍). Looking around for more recent guidance, didn't find anything definitive but agree with your conclusion: static binaries don't seem to be supported for OS X - people run into static linking problems like with both Rust and Fortran (?!). The subsequent quote section in 2.10 titled "Are we making an operational tradeoff?" mentions lack of centralized patching as one downside of static linking. Would you like to PR a couple sentence additional downside there, mentioning that static linking is officially discouraged on Mac OS X due to kernel interface compatibility risk and cite the article? As an aside, the Linux syscall interface is extremely stable. I know of at least one company that ships a Linux CLI for their SaaS product by statically linking a Rust binary and managing its remote update. Now I'm wondering how/if they support OS X... |
Beta Was this translation helpful? Give feedback.
-
In 2.10 we compile the rcli tool statically to an x86 linux target but on MacOS that's not possible. Coding directly to the kernel is made difficult on purpose.
Apple strongly discourages it in fact.
All I can find is this 2011 old documentation for Mac OS by apple and i'm assuming this decision remained since then.
MacOs (maybe unix in general?) doesn't have something like
ldd
in linux. so couldn't see exactly what the linked objects were and it wouldn't matter anyway since MacOS doesn't like statically linked binaries plus with an ARM M1 I can imagine this got more complicated.You'd probably want to use docker to install linux, virtual environment with linux or dual booting your mac with linux if you want to try making a statically linked binary
Just thought I'd bring this up.
Beta Was this translation helpful? Give feedback.
All reactions