[csw-users] How Can I Determine If My Copies Of gcc And libstdc++ Are Compatible?

eric eric eric49933 at gmail.com
Wed Jul 4 18:33:36 CEST 2012


There are multiple copies of libstdc++.so on our system:

    $ find /opt/csw/ -name libstdc++.so
    /opt/csw/lib/libstdc++.so
    /opt/csw/lib/sparcv9/libstdc++.so
    /opt/csw/gcc4/lib/libstdc++.so
    /opt/csw/gcc4/lib/sparcv9/libstdc++.so

We were using the 3rd one listed above, which is version 6.0.14, built
with Blastwave.
The first one is version 6.0.17, built with gcc 4.7.1, the same
compiler that we are using.

1A)

    $ ls -l /opt/csw/gcc4/lib/libstdc++.so
    lrwxrwxrwx   1 root     root          19 Oct 19  2011
/opt/csw/gcc4/lib/libstdc++.so -> libstdc++.so.6.0.14

1B)

    $ mcs -p /opt/csw/gcc4/lib/libstdc++.so | head -8
    /opt/csw/gcc4/lib/libstdc++.so:

    @(#)SunOS 5.8 Generic February 2000
    ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.302

    /opt/csw/gcc4/lib/libstdc++.so:

    GCC: (Blastwave.org Inc. Mon Aug  9 07:10:45 GMT 2010) 4.5.1

2A)

    $ ls -l /opt/csw/lib/libstdc++.so
    lrwxrwxrwx   1 root     root          19 Jun 20 13:58
/opt/csw/lib/libstdc++.so -> libstdc++.so.6.0.17

2B)

    $ mcs -p /opt/csw/lib/libstdc++.so | head -8
    /opt/csw/lib/libstdc++.so:

    @(#)SunOS 5.10 Generic January 2005

    @(#)SunOS 5.10 Generic January 2005

    GCC: (GNU) 4.7.1

Switching to /opt/csw/lib/libstdc++.so fixed a couple of problems:

3) The problem lines from the ldd output went away:

    libstdc++.so.6 (GLIBCXX_3.4.15) =>       (version not found)
    libstdc++.so.6 (CXXABI_1.3) =>   (version not found)

4) The paths that we see in the stack trace and in the debugger now
indicate that libstdc++ was compiled with gcc version 4.7.1:

    (gdb) s
    __gthread_once (g=0xfef735d8)
        at /home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libstdc++-v3/libsupc++/guard.cc:75
    75      in /home/maciej/src/opencsw/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.7.1/libstdc++-v3/libsupc++/guard.cc


More information about the users mailing list