[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 03:30:42 UTC 2016

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


  cp libssl.dylib $(DESTDIR)$(OPENSSLDIR)/lib/libssl.dylib
  install_name_tool -id $(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