r8020 - a few libraries could benefit from -headerpad_max_install_names

Started by nibbles, June 17, 2012, 04:21:33 AM

Previous topic - Next topic

nibbles

I'm reporting a warning about RPATHs today, not an error.

OSX uses RPATHs, and as such we need -headerpad_max_install_names set to allow us to adjust the RPATHs during the final phase of install.   I see headerpad_max_install_names being set when these linking phases occur.

Linking CXX executable avidemux_jobs
Linking CXX executable avidemux
Linking CXX executable avidemux_cli


The following libraries give warnings that their install_names can't be adjusted because there isn't enough room:

libADM_vf_glBenchmark.dylib
libADM_hf_hflip.dylib
libADM_dm_mxf.dylib
libADM_dm_mp4.dylib

Here is one of those warning messages:


install_name_tool: changing install names or rpaths can't be redone for: /usr/local/Cellar/avidemux3/2.6/lib/ADM_plugins6/videoFilters/libADM_vf_glBenchmark.dylib (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)


This is not a runtime error for me, though, because ADM-2.6 knows where to look for it's libraries already.  I'm only reporting this because I get warnings from install_name_tool when Homebrew runs a script to fix any b0rked install names.

I can see from examining all the CMakeCache.txt files that RPATH is enabled.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO

but these variables do not exist (and maybe they are needed, I don't know):
CMAKE_BUILD_WITH_INSTALL_RPATH=ON
CMAKE_INSTALL_NAME_DIR=...

I can see from examining all the libraries that many dependencies have no RPATH set.  Here is an example of one library where you can see this:


$ otool -L ./libADM_UI_Cli6.dylib
./libADM_UI_Cli6.dylib:
libADM_UI_Cli6.dylib (compatibility version 0.0.0, current version 0.0.0)
libADM_core6.dylib (compatibility version 0.0.0, current version 0.0.0)
libADM_coreUI6.dylib (compatibility version 0.0.0, current version 0.0.0)
libADM_render6_cli.dylib (compatibility version 0.0.0, current version 0.0.0)
libADM_coreVideoFilter6.dylib (compatibility version 0.0.0, current version 0.0.0)
libADM_coreImage6.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)


I see that same group of libraries missing RPATHs in every dylib that uses them.
So I'm investigating this, but it's not a priority, because the software works.
I don't know CMake well enough to offer a patch at this time.
Ok, thanks for your help.