Compiling a port statically
noloader at gmail.com
Mon Dec 7 07:01:45 UTC 2020
On Sun, Dec 6, 2020 at 10:31 AM Riccardo Mottola via macports-users
<macports-users at lists.macports.org> wrote:
> On 12/5/20 8:07 AM, Ryan Schmidt wrote:
> Obviously the block would need some tweaking for a given port, it gives the idea.
> I can't think of a reason why we would want to offer such a thing.
> I can think of two scenarios:
> - building "always safe" binaries which can be used at system level, e.g. login shells, tools, things put in launchd. That is things you want to always work, even if you are during a MacPorts upgrade. NetBSD offers two packages for the same thing, e.g. bash and bash-static, IIRC. perhaps in MacPorts it could be a "variant"?
> - a special case of the above is an issue coming up on legacy MacOS more often where this happens with buildtools, e.g. a "static" version of certain tools which are more needed than on modern systems where the system ones are "good enough". When these build tools break MacPorts itself becomes much more a hassle itself to update
Static linking also allows you to move binaries around the filesystem
with dicking around with otool and install_name_tool. Stack Overflow
has several questions related to OS X programs that are linked to
OpenSSL. The programs had a lot of trouble once bundled because of the
antique version of OpenSSL supplied by Apple.
More information about the macports-users