3 ms·
I know this works on Macs with Intel chips. But the ones with ARM chips just won't execute fully static binaries, and I'm wondering if there's a workaround.
by oguz-ismail 2y ago
I know this works on Macs with Intel chips. But the ones with ARM chips just won't execute fully static binaries, and I'm wondering if there's a workaround.
- saagarjha 2y agoNope.
- oguz-ismail 2y agoThanks. That sucks
- saagarjha 2y agoIf you can convince Apple to change this code let me know: https://github.com/apple-oss-distributions/xnu/blob/94d3b452840153a99b38a3a9659680b2a006908e/bsd/kern/mach_loader.c#L877 https://github.com/apple-oss-distributions/xnu/blob/94d3b452...
- deleted 2y ago[deleted]
- telotortium 2y agoI’m guessing not. According to man ld on macOS, the -static flag, to produce a fully static executable, is only used to build the kernel. I don’t believe fully-static executables were ever officially supported on macOS, although they would work.
- jcelerier 2y agoIt only works if you don't ever upgrade macOS. Even a patch update sometimes can break it.
- zamadatix 2y agoFor clarity it's not the chip/ARM that causes the limitation, you can recompile the kernel (it's open source) to remove the block and it'll work fine - it's just a ton of work. Alternatively, Linux :).