On some host machines (example: Gentoo amd64 no-multilib) by default
cmake will install libraries to lib64. But in OpenWrt the correct libdir
is lib (for instance the RPATH is set to lib). So you may end up with
libraries in lib64 while RPATH points to lib:
sk@darth ~/tmp/openwrt $ ldd staging_dir/hostpkg/bin/protoc
linux-vdso.so.1 (0x00007ffc741ea000)
libprotoc.so.3.8.0.0 => not found
libprotobuf.so.3.8.0.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0a8f7ea000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libstdc++.so.6 (0x00007f0a8f572000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0a8f427000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/libgcc_s.so.1 (0x00007f0a8f40d000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0a8f23c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0a8f827000)
sk@darth ~/tmp/openwrt $
Fix this by specifying the libdir during host builds.
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>