Darling (software)

Darling is a free and open-source macOS compatibility layer for GNU/Linux. It duplicates functions of macOS by providing alternative implementations of the libraries and frameworks that macOS programs call.[2] This method of duplication differs from other methods that might also be considered emulation, where macOS programs run in a virtual machine. Darling has been called the counterpart to WINE for running OS X apps.[3]

Darling
A simple 'HelloWorld' Cocoa app demonstrated on macOS (left) and GNU/Linux (right)
Original author(s)Luboš Doležel
Repositoryhttps://github.com/darlinghq/darling
Operating systemGNU/Linux
TypeCompatibility layer
LicenseVarious, primarily GPLv3[1]
Websitedarlinghq.org

The project started in Summer 2012 and builds on a previous project, named maloader, which was discontinued due to a lack of time. The developer is testing applications, such as Midnight Commander or The Unarchiver on the layer. So far, the layer has been shown to work with many console apps, but does not currently support graphical applications.[4][5] Darling does have the ability to extract an Apple Disk Image.[6]

The project may also support iOS applications in the future.[7]

Architecture

At the entry of the Darling system is a loader for Mach-O binaries, the executable format for Apple's operating systems. Darling's predecessor, maloader, presented a maximalist approach to the problem by trying to replicate everything that Apple's dynamic library loader dyld does. This proved to be hard, and since a 2017 "Mach-O transition" Darling has been using a lightweight loader just enough to launch the open-source Apple dyld instead.[8]

To provide the macOS binaries with a kernel, Darling uses a modified XNU kernel wrapped into a Linux kernel module. This module handles the typical job of a Mach kernel, mainly Ports IPC handling.[9] Some licensing issues exist in the darling-mach module, as the team are adding GNU GPL modifications to the APSL kernel.[10]

Higher than the kernel is the root environment. Darling, like WINE, supports chroot prefixes, implemented using the Linux overlayfs (as opposed to path translation in WINE). PID, IPC, and UTS namespaces are used to create a container for the Darwin system inside.

The frameworks and system libraries in Darling are, to the best possible extent, based on source code released by Apple. The Mach-O transition allows these frameworks to be built more easily, because they are now built as the Mach-O format they were intended for.[8] To fill in the gaps for many higher-level frameworks like Cocoa, Darling uses code from Cocotron, ApportableFoundation, and GNUstep.[11]

References

  1. https://github.com/darlinghq/darling/blob/master/LICENSE
  2. Brodkin, Jon (6 August 2013). "OS X apps run on GNU/Linux with Wine-like emulator for Mac software". Ars Technica. Retrieved 23 January 2014.
  3. Lynch, Jim. "Will we ever be able to run OS X apps in Linux with Darling?". InfoWorld. Retrieved 2018-07-23.
  4. "Project Status". Darling project. Retrieved 23 January 2014.
  5. "Project Darling Is Still Trying To Run macOS/OSX Software On Linux - Phoronix". www.phoronix.com. Retrieved 2018-07-23.
  6. "A C++ Hello World And The Rose Gold Walled Garden Of Doom". Hacker Noon. 2018-01-29. Retrieved 2018-07-23.
  7. Heath, Nick (15 July 2013). "OS X apps on their way to Linux courtesy of Darling project". ZDNet. Retrieved 23 January 2014.
  8. Bugaev, Sergey. "Mach-O linking and loading tricks". Retrieved 12 January 2020.
  9. "Build Instructions". Darling. Darling uses a kernel module to provide certain OS X specific features, mainly Mach Ports IPC. No OS X application can be run without this module, since Libc requires Mach Ports for its initialization and even for very basic things such as sleep().
  10. "Issue: Code from Apple under the APSL is incompatible with the GPL". GitHub. Retrieved 12 January 2020.
  11. "Homepage FAQ". Darling project. Retrieved 12 January 2019.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.