Turns out, the custom installation of gcc-5.2.0 installed a libstdc++.la with the following libdir
line:
libdir='/usr/local/gcc-5.2.0/lib/../lib64'
But when libtool links against libstdc++.la
, it uses the path reported in the warning (which also happens to be part of g++ --print-search-dirs
output—this is likely related).
The fix is to change the libdir
value in libstdc++.la
to the exact path that libstdc++.la
is searched in by libtool:
libdir='/usr/local/gcc-5.2.0/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib64'
Apparently, libtool won't normalize or canonicalize paths and compares them as strings, thus the error. See also a related thread on the libtool mailing list from 2006.