Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while building glibc

I'm trying to install glibc to debug a C-framework I'm working on. But, I'm getting an error in the build process. Here's the error msg:

make[3]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
/usr/bin/install -c /root/glibc-2.14-build/elf/ld.so /usr/local/myglibc/lib/ld-2.14.so.new
mv -f /usr/local/myglibc/lib/ld-2.14.so.new /usr/local/myglibc/lib/ld-2.14.so
/usr/bin/install -c /root/glibc-2.14-build/libc.so /usr/local/myglibc/lib/libc-2.14.so.new
mv -f /usr/local/myglibc/lib/libc-2.14.so.new /usr/local/myglibc/lib/libc-2.14.so
echo ld-2.14.so /usr/local/myglibc/lib/ld-linux-x86-64.so.2 >> /root/glibc-2.14-build/elf/symlink.list
/usr/bin/install -c /root/glibc-2.14-build/elf/sotruss-lib.so /usr/local/myglibc/lib/audit/sotruss-lib.so.new
mv -f /usr/local/myglibc/lib/audit/sotruss-lib.so.new /usr/local/myglibc/lib/audit/sotruss-lib.so
make[2]: *** No rule to make target `/root/glibc-2.14-build/dlfcn/libdl.so.2', needed by `/root/glibc-2.14-build/elf/sprof'.  Stop.
make[2]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
make[1]: *** [elf/subdir_install] Error 2
make[1]: Leaving directory `/root/glibc-source/glibc-2.14'
make: *** [install] Error 2

Is this a known problem? I had built glibc on the same machine earlier last week without any errors. I'm rebuilding it because glibc is compiled with optimization level 2(-O2) by default and I'm unable to look into the values of a few variables inside the library functions from the code dump as they've been optimized out. I'm currently trying to compile with optimization level 1.

Thanks

like image 436
AnilRamakrishna Avatar asked Mar 24 '12 16:03

AnilRamakrishna


2 Answers

It looks like you are trying to make install, without first doing a successful make all.

like image 140
Employed Russian Avatar answered Sep 23 '22 09:09

Employed Russian


This is for the benefit of anyone who might be trying to build glibc on their ubuntu box. I went through the following problems and resolved them the following way.

These problems were encountered in ubuntu 12.04

  • I created a directory glib-build on the same level as the glib-VERSION and ran the following command

$> ../glibc-2.16.0/configure --prefix=/home/gugovind/tsapp/glibc/glibc-build/

that gave me the following error that makeinfo is missing.

for that

$>sudo apt-get install texinfo

will resolve the problem.

  • It threw and error about LD_LIBRARY_PATH having the current directory (even if it does not exist) for that run the following in your command prompt

    $>set LD_LIBRARY_PATH

this will clear the LD_LIBRARY_PATH only for that console temporarily. Then run the configure again.

You might encounter another problem with configure.. "function strtonum never defined"

look at the config.log file and it might be missing mawk or gawk. install them using

sudo apt-get install gawk

This should get you through the configure part.

now run

make all

if in case you encounter a particular file not compiling.. just copy the gcc ... before that and paste it in the command prompt again after you have cd to that directory (the command lines before the error should tell you where to go.)

make install

You might get a warning about not able to find etc/ld.config... file. ignore that.. you are all set now.

like image 1
Guru Govindan Avatar answered Sep 20 '22 09:09

Guru Govindan