简体   繁体   English

构建glibc时出错

[英]Error while building glibc

I'm trying to install glibc to debug a C-framework I'm working on. 我正在尝试安装glibc来调试我正在研究的C框架。 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. 我上周早些时候在同一台机器上构建了glibc而没有任何错误。 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. 我正在重建它,因为glibc默认使用优化级别2(-O2)进行编译,我无法从代码转储中查看库函数中的一些变量的值,因为它们已经过优化。 I'm currently trying to compile with optimization level 1. 我目前正在尝试使用优化级别1进行编译。

Thanks 谢谢

看起来你正在尝试make install ,而不是先成功完成make all

This is for the benefit of anyone who might be trying to build glibc on their ubuntu box. 这是为了任何可能试图在他们的ubuntu盒子上构建glibc的人的利益。 I went through the following problems and resolved them the following way. 我经历了以下问题,并通过以下方式解决了这些问题。

These problems were encountered in ubuntu 12.04 在ubuntu 12.04中遇到了这些问题

  • I created a directory glib-build on the same level as the glib-VERSION and ran the following command 我在与glib-VERSION相同的级别上创建了一个目录glib-build,并运行了以下命令

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

that gave me the following error that makeinfo is missing. 这给了我以下错误,makeinfo丢失了。

for that 为了那个原因

$>sudo apt-get install texinfo $> 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 它抛出了有关当前目录的LD_LIBRARY_PATH错误(即使它不存在),在命令提示符下运行以下命令

    $>set LD_LIBRARY_PATH $>设置LD_LIBRARY_PATH

this will clear the LD_LIBRARY_PATH only for that console temporarily. 这将暂时清除该控制台的LD_LIBRARY_PATH。 Then run the configure again. 然后再次运行configure。

You might encounter another problem with configure.. "function strtonum never defined" 您可能会遇到配置的另一个问题.. “函数strtonum从未定义”

look at the config.log file and it might be missing mawk or gawk. 查看config.log文件,它可能缺少mawk或gawk。 install them using 使用安装它们

sudo apt-get install gawk 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.) 如果你遇到一个特殊的文件没有编译..只需复制gcc ...然后再将它粘贴到命令提示符后,你有cd到该目录(错误之前的命令行应该告诉你去哪里。 )

make install make install

You might get a warning about not able to find etc/ld.config... file. 您可能会收到有关无法找到etc / ld.config ...文件的警告。 ignore that.. you are all set now. 忽略那个..你们现在都已经完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM