16

if anyone could give a beginner some help on gcc version issue?

I met the issue on "version GLIBCXX_3.4.20' not found". After I followed the link: How to Install gcc 5.3 with yum on CentOS 7.2? I met extra issues as below:

scl enable devtoolset-7 bash
git: relocation error: libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference 
Vimanyu
  • 625
  • 2
  • 9
  • 24
vicky
  • 161
  • 1
  • 1
  • 4

2 Answers2

17

if anyone could give a beginner some help on gcc version issue?

Your problem has nothing to do with any GCC versions.

git: relocation error: libc.so.6: symbol _dl_starting_up, ...

This error most likely means that you are trying to use something other than the system libc.so.6 (perhaps by pointing LD_LIBRARY_PATH to directory that contains a copy of libc.so.6 from a different system).

Don't do that: it doesn't work. Using alternate GLIBC version is possible, but complicated. This answer provides some ways to do that.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • 7
    It is false that it does not work. Several SDKs do that routinely in hundreds of production machines. GLIBC has versioned symbols, so you have graceful errors like the ones reported. I do not downvote because the answer is mostly correct, except for the "Don't do that: it doesn't work." – Paulo Neves Mar 09 '21 at 10:11
4

Solution is as follows:

  1. Create a local installation path mirroring / (root path) and containing usr/lib64 and a symlink to usr/lib64 at the same level as usr
  2. Compile and install GLibC locally (i.e. configure --prefix=/local/installation/path (/local/installation/path contains usr and lib64 symlink)
  3. Install other necessary dependencies
  4. Invoke your application by as follows

    /local/installation/path/usr/lib/ld-linux-${arch}.so.${version} \
      --library-path /local/installation/path/usr/lib:/local/installation/path/usr/lib64:... \
      Your-Bin-Name \
      Your-Bin-CLI-Options
    

    NOTE: Add additional paths as needed, separating each with a colon

Sam
  • 51
  • 3