[openssl-dev] [openssl.org #4367]: FEATURE: Please add -headerpad_max_install_names to LDFLAGS for dynamic libraries on OS X builds

noloader@gmail.com via RT rt at openssl.org
Wed Mar 2 04:34:49 UTC 2016


Also worth mentioning: depending on how much magic will be sprinkled
from the PERL script... install_name is available on OS X 10.4 and
above, which covers the last 10 years or so. Also see "Configure-based
open source libraries: current_version and install_name"
(http://lists.apple.com/archives/unix-porting/2006/Dec/msg00009.html)
on the Apple mailing lists.

On Tue, Mar 1, 2016 at 10:30 PM, Jeffrey Walton <noloader at gmail.com> wrote:
> OS X side steps the problems with selecting the wrong runtime library
> and RPATHs by using something called an install name. Effectively, the
> install name should be placed in libcrypto.dylib and libssl.dylib, and
> it calls out the fully qualified path name. Programs linked to a
> library with an install name will record the library, and dyld(1) will
> link to the proper library at runtime. There's no need for tricks like
> LD_LIBRARY_PATH on Linux (its called DYLD_LIBRARY_PATH on OS X).
>
> To make room for an install name that may change (for example, from
> PWD to /usr/local/ssl/lib, you need to use the flag
> -headerpad_max_install_names on libcrypto.dylib and libssl.dylib.
>
> To add the icing to the cake, 'make install' should add the following
> to its recipe for OS X:
>
>   cp libcrypto.dylib $(DESTDIR)$(OPENSSLDIR)/lib/libcrypto.dylib
>   install_name_tool -id $(DESTDIR)$(OPENSSLDIR)/lib/libcrypto.dylib
> $(DESTDIR)$(OPENSSLDIR)/lib/libcrypto.dylib
>
> And:
>
>   cp libssl.dylib $(DESTDIR)$(OPENSSLDIR)/lib/libssl.dylib
>   install_name_tool -id $(DESTDIR)$(OPENSSLDIR)/lib/libssl.dylib
> $(DESTDIR)$(OPENSSLDIR)/lib/libssl.dylib


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4367
Please log in as guest with password guest if prompted



More information about the openssl-dev mailing list