Linux 如何从源代码编译我自己的 glibc C 标准库并使用它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10412684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to compile my own glibc C standard library from source and use it?
提问by pythonic
I am trying to compile my own glibc. I have a directory glibc
, which contain the glibc
source code I downloaded from the internet. From that directory I typed mkdir ../build-glibc
. Now from the build-glibc
directory I typed ../glibc/configure
, which performed the configuration. Now I'm not sure how to call make
. I can't call it from glibc
directory since it doesn't have the configuration set, neither I can call it from build-glibc
, since makefile is not in that directory. How do I solve this problem?
我正在尝试编译我自己的 glibc。我有一个目录glibc
,其中包含glibc
我从 Internet 下载的源代码。我从那个目录输入mkdir ../build-glibc
. 现在从build-glibc
我输入的目录../glibc/configure
中执行配置。现在我不确定如何调用make
. 我不能从glibc
目录中调用它,因为它没有配置集,我也不能从 调用它build-glibc
,因为 makefile 不在该目录中。我该如何解决这个问题?
采纳答案by ArjunShankar
The Makefile
is going to exist in your build-glibc
directory if the configure
script finishes successfully.
该Makefile
会在你的存在build-glibc
的目录,如果configure
脚本成功完成。
If everything seemsto have gone smoothly during configure
and still no Makefile
, then you probably missed an idiosyncrasy:
如果在此期间一切似乎都很顺利configure
,但仍然没有Makefile
,那么您可能错过了一个特质:
While doing a configure
for glibc, it is expected that you normally provide an alternative --prefix
, because installing to the default location (/usr/local
) can potentially cripple the system. If you don't provide one, then you need to switch on --disable-sanity-checks
.
在configure
为 glibc执行 a 时,通常希望您提供一个替代方案--prefix
,因为安装到默认位置 ( /usr/local
) 可能会削弱系统。如果您不提供,则需要打开--disable-sanity-checks
.
If this is not the case either, look for a config.log
file, and read its contents.
如果也不是这种情况,请查找config.log
文件并阅读其内容。