On Apr 13, 2017, at 9:48 AM, Ryan Dingman <[email protected]> wrote:

> While building statically linked binaries on macOS is possible, Apple doesn’t 
> officially support it.

Apple doesn't support 100% statically-linked binaries, and they are *not* 
guaranteed to work on all OSes.  macOS's ABI isn't based on system calls, just 
as, for example, the Solaris ABI isn't based on system calls; they're based on 
procedure calls to dynamically-linked libraries.  Apple, or Sun^WOracle, could 
change a system call binary interface, as long as they provide, with a version 
of the OS that changes the system call interface, a system shared library (libc 
in Solaris, libSystem in macOS) that has the same calling sequences to routines 
in the library as earlier versions, and that uses the new system call interface.

If you statically link with the system library, you are including code in your 
executable that uses a particular system call interface, and that executable 
may fail on a later OS version.

So what you should be doing here is not building a 100% statically-linked 
binary.  What you should be doing is building a static version of the OpenSSL 
libraries, and link your binary with those static libraries.  Those static 
libraries will not be linked with the system libraries at the time they're 
built; they will be linked with the system libraries at the time that a program 
*using* them is built, and they will end up using the same system libraries 
that the executable uses - i.e., the code in the libraries will be dynamically 
linked with the system libraries, just as the code for the executable itself 
will be dynamically linked with the system libraries.
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to