4 ms·
Is there anything the other way around? Running a Linux binary on MacOS? Sometimes the source isn't available so recompiling isn't an option.
by jhbadger 10y ago
Is there anything the other way around? Running a Linux binary on MacOS? Sometimes the source isn't available so recompiling isn't an option.
- oxguy3 10y agoI don't think such a thing exists, probably because there are few/no applications that target Linux and not OS X that aren't also open source. Can you give an example of an app that is only released as a compiled binary for Linux and not OS X?
- cozzyd 10y agoFPGA development tools from xilinx or altera are one example.
- monocasa 10y agoPretty much all HDL tools. I've heard on the grapevine that Apple's own internal chip teams have to use Linux or Windows because the HDL vendors won't port to OSX, even with Apple willing to fund the effort.
- jhbadger 10y agoIt's not so much "applications" as such, but it isn't uncommon for programs in bioinformatics to only be released as a binary (often only a Linux one) because they want to reserve the right to license their code. Or they will only release the source code to academic researchers because they don't like the idea of industry benefiting from their work. This is changing with a lot of people hosting projects on Github and the like, but is still there.
- kps 10y agoPragmatically, run a Linux VM and point $DISPLAY to the host XQuartz.
- Longhanks 10y agoThat's a lot of overhead compared to translated sys calls.
- perlgeek 10y agoCould you maybe reuse some of the Docker integration into the host system?
- sigjuice 10y agoDocker just uses a Linux VM under the covers, which can obviously run Linux binaries.
- jevinskie 10y agoGood question. Given the well documented and stable x86/x86_64 Linux ABIs, it should be at least as feasible as the Darling project. I've been watching projects like Darling and libhybris (run Android bionic libc binaries on glibc) but I haven't seen any project for running Linux ELFs on macOS specifically. Projects like usercorn are already emulating lots of Linux syscalls on non-Linux hosts. Things are even easier if you can ignore the binary emulation and just focus on melding the two different ABIs and APIs. I used usercorn to try and debug an Android shared lib on macOS. I got some of the SO to correctly execute (full dynamic linking wasn't working) but it did require light patching of usercorn. I would have had less issues if I was emulating a Android guest on Linux host (instead of macOS host) since you're syscall mappings are almost 1:1 then. https://github.com/lunixbochs/usercorn https://github.com/lunixbochs/usercorn
- loeg 10y agoIt shouldn't be too hard if Apple is interested. The Linux ABI is pretty stable. FreeBSD and Windows both do Linux binary emulation well enough to run most Linux binaries.