[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [scl.org] devtoolset toolchain shared libs (libstdc++, libgcc, etc)



On Wed, Feb 8, 2017 at 8:21 PM, cls <cls seawood org> wrote:
Hi,

It appears as though the devtoolset toolchain rpms do not come with a copy of the libstdc++ shared library nor a handful of other shared libraries usually provided by gcc. Comparing the SCL and non-SCL gcc.spec files, it's clear that someone deliberately removed those shared libs. Why is that? I didn't see any mention of this in the mailing list archives.

I'm seeing a weird segfault during the destruction of a std::string derived-object that I do not see with the system compiler (gcc 4.8.5). I thought that it may have been a compiler error but then while debugging, I noticed that the c++ programs & libraries are linked against the system version of libstdc++.so.6 instead of the devtoolset-6 version. That seems like that could cause major problems.

I'm using the pre-built devtoolset-6 from http://vault.centos.org/7.2.1511/sclo/x86_64/rh/devtoolset-6/ on CentOS 7.2.1511. I modified the boost package to build as part of the collection since it is highly dependent upon the toolchain. You can see the runtime dependency upon the system library below as well as the ld script that causes the system library to get referenced at link time.

[build cls-scelbuild-72 tmp]$ scl enable devtoolset-6 'ldd /opt/rh/devtoolset-6/root/usr/lib64/libboost_filesystem.so.1.53.0'
        linux-vdso.so.1 =>  (0x00007ffecfbbe000)
        libboost_system.so.1.53.0 => /opt/rh/devtoolset-6/root/usr/lib64/libboost_system.so.1.53.0 (0x00007f52ac67d000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f52ac365000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f52ac063000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f52abe4d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f52aba8a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f52acab6000)
[build cls-scelbuild-72 tmp]$ find /opt/rh/devtoolset-6/root/ -name 'libstdc++*.so*' | grep -v gdb
find: ‘/opt/rh/devtoolset-6/root/root’: Permission denied
/opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1/libstdc++.so
/opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1/32/libstdc++.so
[build cls-scelbuild-72 tmp]$ cat /opt/rh/devtoolset-6/root/usr/lib/gcc/x86_64-redhat-linux/6.2.1/libstdc++.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-x86-64)
INPUT ( /usr/lib64/libstdc++.so.6 -lstdc++_nonshared )
[build cls-scelbuild-72 tmp]$

One of the main selling points of the devtoolset is that it uses the libraries from the system and statically links in features that aren't available. That allows the binaries built with it to be used on other machines without needing to install devtoolset or any other additional dependencies. 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]