View Full Version : Compiling glibc 2.7 on Ubuntu 7.10

November 10th, 2007, 08:10 AM
I'm trying to compile glibc 2.7 on Ubuntu 7.10 (Kernel Version 2.6.22-14). So here's what I've done till now -

1. Downloaded and extracted the glibc source from http://ftp.gnu.org/pub/gnu/glibc/glibc-2.7.tar.gz
2. Made a separate glibc-build directory from which I did a configure.

../libidn/configure --prefix=/usr --disable-profile --enable-add-ons --enable-kernel=2.6.22 --libexecdir=/usr/lib/glibc

3, This generated the Makefile and I did a make at which point it fails with the following error.

/home/vsriram/Desktop/glibc-build/elf/librtld.os: In function `print_statistics':
/home/vsriram/Desktop/libidn/elf/rtld.c:2800: undefined reference to `__stack_chk_fail_local'
/home/vsriram/Desktop/glibc-build/elf/librtld.os: In function `process_dl_debug':
/home/vsriram/Desktop/libidn/elf/rtld.c:2436: undefined reference to `__stack_chk_fail_local'
/home/vsriram/Desktop/glibc-build/elf/librtld.os: In function `process_envvars':
/home/vsriram/Desktop/libidn/elf/rtld.c:2695: undefined reference to `__stack_chk_fail_local'
/home/vsriram/Desktop/glibc-build/elf/librtld.os: In function `dl_main':
/home/vsriram/Desktop/libidn/elf/rtld.c:2316: undefined reference to `__stack_chk_fail_local'
/home/vsriram/Desktop/glibc-build/elf/librtld.os: In function `print_search_path':
/home/vsriram/Desktop/libidn/elf/dl-load.c:1567: undefined reference to `__stack_chk_fail_local'
/home/vsriram/Desktop/glibc-build/elf/librtld.os:/home/vsriram/Desktop/libidn/elf/dl-load.c:1787: more undefined references to `__stack_chk_fail_local' follow
collect2: ld returned 1 exit status
make[2]: *** [/home/vsriram/Desktop/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory `/home/vsriram/Desktop/libidn/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/home/vsriram/Desktop/libidn'
make: *** [all] Error 2

Now I googled "__stack_chk_fail_local" and found that it had to with the stack protection that Ubuntu provides and it can be disabled by setting the CFLAGS with -fno-stack-protector. Now I did this using export CFLAGS=" -fno-stack-protector -fno-stack-protector-all" and that still gives me the above error.

Couple of notable things:

a. I set the CFLAGS to export " -fno-stack-protector -fno-stack-protector-all" before doing the ./configure and I get the following error:

checking whether ln -s works... yes
checking for gcc... gcc
checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

If I unset CFLAGS configure works fine again.

b. I tried compiling glibc 2.6.1 and get the exact same error.

What is going on? How can I fix this?


November 10th, 2007, 05:59 PM
why exactly you want to compile newer glibc?

November 10th, 2007, 07:41 PM
I am working on this checkpointing software and it fails only in Ubuntu (6.10+). I believe it is a problem with whatever changes Ubuntu people might have made to glibc and want to compile a vanilla glibc and check if the checkpointing software works using the same.

March 7th, 2008, 05:28 AM
I am getting the same error. Any ideas? Thanks.

April 29th, 2008, 01:19 PM
I am getting the same error. Any ideas? Thanks.
Did you find a way around this error? I have run into the same problem.

June 2nd, 2008, 09:01 PM
what gcc version are you using ?

June 3rd, 2008, 02:51 AM
I was using glibc 2.5 but I have got it compiled successfully now. Thanks

June 17th, 2008, 11:34 AM
Hello venkat.....

could you please tell me how u resolved ur problem.....
Thanks in advance....

July 24th, 2008, 02:06 PM
We did get a solution to this problem. The issue was with the Stack Smashing protection that Ubuntu's glibc has. We fixed the issue by adding -fno-stack-protection in the Makefile. A more detailed solution is available here (https://wiki.ccs.neu.edu/display/CSG280/MTCP+on+Ubuntu) and here (http://perilsofdecadence.blogspot.com/2008/07/glibc-on-ubuntu.html).

July 25th, 2008, 04:27 PM
Hi Sriram, thanks for the input. I've managed to extract the build params they used for building glibc-2.7 for the Hardy release, see http://ubuntuforums.org/showthread.php?t=867674.


February 18th, 2011, 03:08 AM
I've run into the same problem. I tried adding

export CFLAGS="-fno-stack-protection"

in the makefile but it doesn't help. I am still getting the stack_chk_fail_local error.

Any ideas what might be causing this?