I have been using old version of gcc and libc for my SLES 10 machine to build my code. Recently in order to add support for new libraries, I added GCC 6.3 build version. But when I refer this
./gcc -o ~/test ~/test.c -L/home/newuser/newos/Gcc/glibc-2.17/lib -lXX
, I get following error:
./gcc: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./gcc)
./gcc: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by ./gcc)
the current glibc version in /lib64 is 2.4 and I can't upgrade it as it is needed by most of my files. I am trying to link glibc 2.14 to gcc 6.3.0 at compile time. Is there any way I can refer new glibc from gcc commandline ?
I tried to use the fix provided in this link as this scenario is very much similar to my scenario:
./gcc -Wl,--rpath=../../glibc-2.14/lib -Wl,--dynamic-linker=../../glibc-2.14/lib/libc.so.6
and
./gcc -Wl,--rpath=../../glibc-2.14/lib -Wl,--dynamic-linker=../../glibc-2.14/lib/ld-linux.so.2
But still the same error persists for me. Is there anything more i need to do?
EDIT1
I added additional command to export LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=/path/to/glibc2.14/lib
after this export, when I ran the gcc with above command, I was facing another error:
error while loading shared libraries. /path/to/glibc-2.14/lib/libm.so.6: ELF file OS ABI invalid