Re: [Boost-bugs] [Boost C++ Libraries] #1927: MacOS (Darwin) should use the -headerpad_max_install_name option

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1927: MacOS (Darwin) should use the -headerpad_max_install_name option
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-03 16:58:38

#1927: MacOS (Darwin) should use the -headerpad_max_install_name option
  Reporter: andrew_at_[hidden] | Owner:
      Type: Bugs | Status: new
 Milestone: Boost 1.35.1 | Component: Building Boost
   Version: Boost 1.35.0 | Severity: Problem
Resolution: | Keywords: darwin macos library dylib
Comment (by andrew_at_[hidden]):

 Sure - sorry, you couldn't google it because I was missing an 's' (the
 patch-file is fine, my bug summary missed the letter).

 From the Apple 'ld' linker man page:

        -headerpad_max_install_names (32-bit only)
               Add to the header padding enough space to allow changing
               dynamic shared library paths recorded in the output file to
               changed to MAXPATHLEN in length.

 (The option is not needed for 64-bit objects, and is silently ignored.)

 Basically, when creating shared objects, the apple linker places a semi-
 absolute pathname of the library and all dependent dynamic objects into
 the object. Think of it as the apple 'solution' to Linux's conf
 file. To see the paths of embedded objects, use "otool -L". To
 '''change''' the embedded path name, use "install_name_tool".

 It is the changing-part that needs the header padding. Suppose I build
 boost and install it into /opt/local. Then all the libraries reference
 themselves (and any other required libs) as '/opt/local/lib/libboost-
 blah.dyld'. If I want to redistribute my software binaries plus libraries,
 I need to rename the internal name of the libraries.

 Without the headerpad option to the linker, the new path must be equal or
 shorter in length than the old path. Blech! With the headerpad option, I
 can use any valid filesystem path.

 Thus, building redistributable binaries in boost is only practical on
 darwin with this option.

 Yes, it is a kludge... and that's why apple fixed it for the 64-bit sub-


Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC