CentOS-5.5でのglibcのコンパイルインストール



--------いくつかの説明1、rootを使ったほうがいい
2、glibcバージョン:glibc-2.73、'make'中に'**'が発生したのは深刻なエラーです.INSTALLファイルの抜粋は以下の通りである:To build the library and related programs,type`make'.  This will produce a lot of output, some of which may look like errors from `make' but isn't.  Look for error messages from `make' containing `***'. Those indicate that something is seriously wrong.
 
----------configure [/test]# mkdir glibc-build [/test]# cd glibc-build [/test/glibc-build]# ../glibc-2.7/configure--prefix=/usr取得ファイル:bits config.h  config.log  config.make  config.status  Makefile
【よくあるエラー】1、[/test/glibc-2.7]#./configureは現在のディレクトリの下でconfigureできません
INSTALLファイル抜粋:GNU libc cannot be compiled in the source directory.  You must build it in a separate build directory.  For example, if you have unpacked the glibc sources in `/src/gnu/glibc-2.4', create a directory `/src/gnu/glibc-build' to put the object files in.  This allows removing the whole build directory in case an error occurs, which is the safest way to get a fresh start and should always be done.
2、[/test/glibc-build]# ../glibc-2.7/configure('--prefix=/usr')エラーメッセージは次のとおりです:***On GNU/Linux systems the GNU C Library should not be installed into*/usr/local since this might make your system totally unusable.***We strongly advise to use a different prefix.  For details read the FAQ. *** If you really mean to do this, run configure again using the extra *** parameter `--disable-sanity-checks'.
ファイルのみ取得:config.log
INSTALLファイルの抜粋は以下の通りである:`configure'takes many options,but the only one that is usually mandatory is`--prefix'.  This option tells `configure' where you want glibc installed.  This defaults to `/usr/local', but the normal setting to install as the standard system library is `--prefix=/usr' for GNU/Linux systems and `--prefix=' (an empty prefix) for GNU/Hurd systems.
------インストールディレクトリの選択について
--prefix=PREFIXインストールディレクトリ.デフォルトは/usr/local Linuxファイルシステム標準で、基本ライブラリは/libディレクトリにあり、ルートディレクトリと同じパーティションにある必要がありますが、/usrは他のパーティションまたは他のディスクにあります.したがって、--prefix=/usrを指定すると、ベースライブラリ部分は/usr/libディレクトリに自動的にインストールされ、ベースライブラリ部分ではなく/usr/libディレクトリに自動的にインストールされます.ただし、デフォルト値を維持したり、他のディレクトリを指定したりすると、すべてのコンポーネント間がPREFIXディレクトリにインストールされます.
----------make 1、 [/test/glibc-build]# vim config.make
2、の後に<-march=i 686>(CFLAGS=-g-O 2-march=i 686、'uname-m'によると'i 686'であることがわかり、ここで直接`uname-m`に取って代わることができるかどうか分からない)【推奨】http://www.linuxsir.org/bbs/thread368805.html
【一般的なエラー】1、'make'ポストエラー:make[1]:***[/test/glibc-build/libc.so]エラー1 make[1]:Leaving directory`/test/glibc-2.7'make:***[all]エラー2解決:上記参照(後に<-march=i 686>)
 
----------make install [/test/glibc-build]# make install
 
--------glibcバージョンの表示には、1、[...]#/の3つの方法があります.lib/libc.so.6任意のディレクトリでこのコマンドラインを実行
2、Cプログラムを通す
#include <stdio.h>
#include <gnu/libc-version.h>
int main (void)
{
	puts(gnu_get_libc_version());
	return 0;
}

上記の2つの方法について、FAQファイルの要約は以下の通りである:4.9. How can I find out which version of glibc I am using in the moment?
{UD} If you want to find out about the version from the command line simply run the libc binary.  This is probably not possible on all platforms but where it is simply locate the libc DSO and start it as an application.  On Linux like
 /lib/libc.so.6
This will produce all the information you need.
What always will work is to use the API glibc provides.  Compile and run the following little program to get the version information:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include #include int main (void) { puts (gnu_get_libc_version ()); return 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This intece can also obviously be used to perform tests at runtime if this should be necessary.
3、 [...]# ldd --version