GentooNPTL

From Richliu's wiki

Jump to: navigation, search

目錄

安裝步驟

  • 在 make.config 的 USE flag 加入 nptl nptlonly

如下:

USE="apache2 nptl nptlonly nls zh_TW -java -toys threads"
  • 修改 linux-header 從 2.4 到 2.6 (在 2004.3 的 Gentoo 似乎己經升級到 2.6 了)
#emerge -C linux-headers   
 移掉 linux-headers
#emerge --oneshot linux26-headers
#emerge glibc 
 重新 Compile glibc 

確認 NPTL 有加入到 glibc 內,有"Native POSIX Threads Library by Ulrich Drepper et al"那一行才表示有正確裝到 NPTL.

#/lib/libc.so/6
GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 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 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6).
Compiled on a Linux 2.6.8 system on 2004-11-26.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        The C stubs add-on version 2.1.2.
        GNU Libidn by Simon Josefsson
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

或是使用

#getconf GNU_LIBPTHREAD_VERSION
NPTL 2.3.4

檢查NPTL 版本

Gentoo 若是只有加上 nptl flag ,會 compile 二次一次 for Linux Thread,另一次是 nptl ,文件內說到預設是用 nptl,不過我自己試的結果是用 nptlonly 比較穩當

glibc 沒有支援 nptl 的時候會顯示 "linuxthreads-0.10 by Xavier Leroy"

# ./libc-2.2.93.so
GNU C Library development release version 2.2.93, by Roland McGrath et al.
Copyright (C) 1992-2001, 2002 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 3.2 20020903 (Red Hat Linux 8.0 3.2-7).
Compiled on a Linux 2.4.9-9 system on 2002-09-05.
Available extensions:
       GNU libio by Per Bothner
       crypt add-on version 2.1 by Michael Glad and others
       The C stubs add-on version 2.1.2.
       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
Report bugs using the `glibcbug' script to <bugs@gnu.org>.

Gentoo 內支援 NPTL 的 Portage

app-emulation / wine   	 free implementation of Windows(tm) on Unix - CVS snapshot  	  
app-office / openoffice 	OpenOffice.org, a full office productivity suite. 
app-office / openoffice-ximian 	Ximian-ized version of OpenOffice.org, a full office productivity  suite. 	
dev-dotnet / mono 	Mono runtime and class libraries, a C# compiler/interpreter 	 
dev-java / sun-j2sdk 	Sun's J2SE Development Kit, version 1.4.1 (From sources) 	 
media-video / helixplayer 	A free open-source media player by real 	 
net-dns / pdnsd 	Proxy DNS server with permanent caching 	 
sys-libs / glibc 	GNU libc6 (also called glibc2) C library 	 
x11-libs / fltk 	C++ user interface toolkit for X and OpenGL.

我是用 GENTOO-PORTAGE 查的.

問題

在安裝 NPTL 的時候,遇到了一些問題 首先是,要處理 linux-headers Package 的問題,解決如下.

狀況如下

# emerge -p glibc
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[blocks B     ] sys-kernel/linux-headers (from pkg sys-kernel/linux26-headers-2.6.8.1-r1)
[ebuild  N    ] sys-kernel/linux-headers-2.4.22
[ebuild  N    ] sys-kernel/linux26-headers-2.6.8.1-r1
[ebuild     U ] sys-libs/glibc-2.3.4.20041102 [2.3.4.20041006]

解法

# emerge -C linux-headers
# emerge --oneshot linux26-headers
# emerge libc


相關 URL

http://gentoo-wiki.com/HOWTO_Gentoo_2004.2_for_linux_2.6_and_NPTL

個人工具