We're running RHEL6, which only officially supports glibc 2.12. A user is requesting that we install a newer version.
I grabbed 2.18 from http://ftp.gnu.org/gnu/glibc/ and had no trouble running configure/make.
However when I attempt a small program to test it, I don't get the desired result:
test.c
#include <stdio.h>
#include </scratch/new-glibc-testing/include/gnu/libc-version.h>
int main (void) { puts (gnu_get_libc_version ()); return 0; }
I then compile and run with:
gcc test.c
./a.out
And the output I get is:
2.12
when I was hoping to get:
2.18
I also tried:
gcc -I/scratch/new-glibc-testing/include test.c
and changed the define line to:
#include <gnu/libc-version.h>
which compiles, but gives the same result (2.12).
I tried also using -nostdlib, ex:
gcc -nostdlib -I/scratch/new-glibc-testing test.c
This, however, throws errors:
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400144
/tmp/cc6x03Do.o: In function `main':
test.c:(.text+0x5): undefined reference to `gnu_get_libc_version'
test.c:(.text+0xd): undefined reference to `puts'
collect2: ld returned 1 exit status
gcc --version
results in:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
chroot
or lx container will do, no need for a full vm in this case. – oakad Jan 10 '14 at 00:31