Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libtool: link: warning: .../libstdc++.la seems to be moved

Tags:

libtool

I've been getting a lot of warnings of this form (line-break added for readability):

libtool: link: warning: `/usr/local/gcc-5.2.0/lib/gcc/x86_64-unknown-linux-gnu/
    5.2.0/../../../../lib64/libstdc++.la' seems to be moved

and couldn't figure out why or if the warning is relevant. Note that both paths resolve to the same location.

like image 758
Irfy Avatar asked Nov 26 '15 14:11

Irfy


1 Answers

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.

like image 192
Irfy Avatar answered Oct 07 '22 02:10

Irfy