tweag / clodl

Turn dynamically linked ELF binaries and libraries into self-contained closures.
BSD 3-Clause "New" or "Revised" License
164 stars 6 forks source link

Build closures in OSX #38

Closed facundominguez closed 3 years ago

facundominguez commented 3 years ago

This PR adds support for building closures in OSX.

deps.sh has been replaced by a script copy-closure.sh that copies the dependencies to a folder. In the OSX case, this script will also patch the libraries with install_name_tool so they load libraries from the closure.

The interface was changed a bit. Now the top-level libraries given to library_closure are renamed to clod-top0, clodl-top1, and so on. This accommodates the linux case, where a wrapper library clod-top0 is produced, and the OSX case, where no wrapper is produced and the user must arrange to load the top libraries that she provided. This also simplifies by providing the same names for the top level binaries, regardless of the platform or whether they are executables or libraries.

facundominguez commented 3 years ago

I'm created an issue for adding more tests: https://github.com/tweag/clodl/issues/39