After updating to binutils 2.29 builds fail with
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot-native/usr/bin/i586-oe-linux/../../libexec/i586-oe-linux/gcc/i586-oe-linux/7.2.0/ld: warning: libclass_loader.so, needed by /home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so, not found (try using -rpath or -rpath-link)
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot-native/usr/bin/i586-oe-linux/../../libexec/i586-oe-linux/gcc/i586-oe-linux/7.2.0/ld: warning: libroslib.so, needed by /home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so, not found (try using -rpath or -rpath-link)
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::isLibraryLoaded()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::loadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::MultiLibraryClassLoader(bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `ros:📦:getPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::systemLibrarySuffix[abi:cxx11]()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::AbstractMetaObjectBase::isOwnedBy(class_loader::ClassLoader const*)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::getFactoryMapForBaseClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::getAllAvailableClassLoaders()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::hasUnmanagedInstanceBeenCreated()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::unloadLibraryInternal(bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::unloadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::getRegisteredLibraries[abi:cxx11]()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `ros:📦:getPlugins(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, bool)'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::MultiLibraryClassLoader::~MultiLibraryClassLoader()'
build/tmp-glibc/work/i586-oe-linux/kdl-parser/1.11.14-r0/recipe-sysroot/opt/ros/indigo/lib/liburdf.so: undefined reference to `class_loader::ClassLoader::loadLibrary()'
because of wrong value of -Wl,-rpath provided to the cross-linker.
This patch makes use of -Wl,-rpath-link option added unconditionally to all
catkin-based builds to aleviate the problem.
NB: The proper fix though should either replace -Wl,-rpath with
-Wl,-rpath-link where it's needed or use correct path to target
libs in -Wl,-rpath.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>