$ cd ~/build
$ tar xjf glibc-2.6.tar.bz2
$ mkdir glibc-2.6-build
$ cd glibc-2.6-build
$ ../glibc-2.6/configure --prefix=/usr --with-headers=~/build/linux-2.6.20.7/include
$ make
Mandriva Linux release 2006.0的動態(tài)庫是Glibc2.3.5。執(zhí)行"/lib/libc.so.6"可以知道當(dāng)前的Glibc是什么版本:
$ /lib/libc.so.6
GNU C Library stable release version 2.3.5, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.1 (4.0.1-2mdk for Mandriva Linux release 2006.0).
Compiled on a Linux 2.6.12 system on 2005-08-30.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Glibc-2.0 compatibility add-on by Cristian Gafton
libthread_db work sponsored by Alpha Processor Inc
Thread-local storage support included.
For bug reporting instructions, please see:
.
$ cd ~/build
$ cd glibc-2.6-build
$ su
# make install
在安裝過程中,將會出現(xiàn)如下錯誤:
/home/xyz/build/glibc-2.6-build/elf/sln
/home/xyz/build/glibc-2.6-build/elf/symlink.list
rm -f /home/xyz/build/glibc-2.6-build/elf/symlink.list
rm: relocation error: /lib/tls/libc.so.6: symbol _dl_out_of_memory, \
version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time reference
make[1]: *** [install-symbolic-link] Error 127
make[1]: Leaving directory `/home/xyz/build/glibc-2.6'
make: *** [install] Error 2
安裝失敗后,輸入任何命令都是無效的,系
統(tǒng)只會重復(fù)"relocation error: /lib/tls/libc.so.6: symbol _dl_out_of_memory,
version GLIBC_PRIVATE not defined in file ld-linux.so.2 with link time
reference"的錯誤信息,重新啟動計(jì)算機(jī)在啟動中就會失敗,根本無法進(jìn)入原Linux系統(tǒng)。
修
改了/lib/tls/下的鏈接和文件后,就可以重新啟動計(jì)算機(jī),進(jìn)入原Linux系統(tǒng),這次將會正常啟動,登陸后,執(zhí)行Coreutils的命令,例如
ls,已經(jīng)不會出現(xiàn)"relocation error: /lib/tls/libc.so.6: symbol
_dl_out_of_memory, version GLIBC_PRIVATE not defined in file
ld-linux.so.2 with link time
reference"的錯誤信息。由于Glibc2.6沒有徹底安裝完畢,我們還要重新執(zhí)行一次make install:
$ cd ~/build
$ cd glibc-2.6-build
$ su
# make install
這次make install將不會出現(xiàn)錯誤,如果安裝成功,到最后會有以下信息提示:
Your new glibc installation seems to be ok.
make[1]: Leaving directory `/home/xyz/build/glibc-2.6'
執(zhí)行/lib/libc.so.6查看Glibc的版本:
$ /lib/libc.so.6
GNU C Library stable release version 2.6, by Roland McGrath et al.
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0).
Compiled on a Linux >>2.6.12-12mdk.
執(zhí)行chk_lib_v:
$ ./chk_lib_v
2.6