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?
Thanks!
Bookmarks