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

1

7

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.

Westland answered 26/11, 2015 at 14:8 Comment(0)
W
4

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.

Westland answered 26/11, 2015 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.