cvs commit: hints nptl.txt

timothy at linuxfromscratch.org timothy at linuxfromscratch.org
Mon May 12 16:17:06 PDT 2003


timothy     03/05/12 19:17:06

  Modified:    .        nptl.txt
  Log:
  Another rewrite. LFS has moved to PLFS. rm 2.4 patch and nvidia.
  
  Revision  Changes    Path
  1.11      +120 -190  hints/nptl.txt
  
  Index: nptl.txt
  ===================================================================
  RCS file: /home/cvsroot/hints/nptl.txt,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- nptl.txt	7 May 2003 01:25:41 -0000	1.10
  +++ nptl.txt	12 May 2003 23:17:06 -0000	1.11
  @@ -1,21 +1,19 @@
   TITLE:		Native POSIX Threading Library (NPTL)
  -LFS VERSION:	4.1+
  +LFS VERSION:	5.0+ (PLFS)
   AUTHOR:		Zack Winkles <winkie at linuxfromscratch.org>
   
   SYNOPSIS:
  -	This hint covers how to install the Native POSIX Threading Library
  -	written by Ulrich Drepper, an alternative to linuxthreads.
  +	This hint covers how to install the Native POSIX Threading
  +	Library by Ulrich Drepper, an alternative to linuxthreads.
   
   HINT:
   
   Contents
   ========
  -
   1. Introduction
  -2. Prerequisities
  -3. In-line Installation
  -4. Post-LFS Problems
  -5. Feedback
  +2. Prerequisites
  +3. Inline Installation
  +4. Feedback
   
   
   Changelog
  @@ -24,257 +22,189 @@
     * 0.2 - 20030411 - Initial release of rewrite.
     * 0.3 - 20030418 - Added patch for 2.4.20 futex support.
     * 0.4 - 20030421 - Backed out futex patch. General cleanups.
  -  * 0.5 - 20030421 - Added note about module-init-tools (Thanks DJ Lucas).
  -		     Added warning about NVIDIA.
  -  * 0.6 - 20030423 - Moved to GCC 3.3.
  -  * 0.7 - 20030424 - w00t. NVIDIA_GLX works now.
  -  * 0.8 - 20030426 - Devfs notes. Patch to make 2.4.20 work w/ NPTL (Thanks YuX)
  -  * 0.9 - 20030505 - Added fix to allow building against old hosts. Added patch
  -		     to fix detection of eh_frame using coreutils. Added note
  -		     about rml's procps.
  -  * 0.10 - 20030506 - Oops. Forgot to put up the location of the GCC patch.
  +  * 0.5 - 20030421 - Added note about module-init-tools (Thanks DJ
  +	Lucas). Added warning about NVIDIA.
  +  * 0.6 - 20030423 - Moved to GCC 3.3
  +  * 0.7 - 20030424 - NVIDIA_GLX works now.
  +  * 0.8 - 20030426 - Devfs notes. Patch to make 2.4.20 work w/ NPTL
  +	(Thanks YuX).
  +  * 0.9 - 20030505 - Added fix to allow building against old hosts.
  +	Added patch to fix detection of eh_frame using coreutils. Added
  +	note about rml's procps.
  +  * 0.10 - 20030506 - Oops. Forgot to put up the location of the GCC
  +	patch.
  +  * 0.11 - 20030512 - Another rewrite. LFS has moved to PLFS. Don't
  +	disable fixincl as it breaks GCC on old hosts. Removed 2.4
  +	patch. Removed any remants of NVIDIA.
   
   
   Introduction
   ============
   
   The Native POSIX Threading Library is a relatively new threading library
  -designed to replace the linuxthreads package as the Glibc threading library.
  -It has many advantages over the linuxthreads package, one of which is the
  -focus on standards-compliance.  NPTL never sarcrifices standards-compliance
  -under any circumstances, no matter the gains.  Despite this, NPTL has
  -world-class performance, with thread-spawning speeds as much as 500x the speed
  -of traditional thread libs.
  -
  -Despite all these changes, it maintains near complete backwards-compatability
  -with linuxthreads, and generally works perfectly as a drop-in replacement where
  -the proper compiler infrastructure is already present.
  -
  -It is required to follow the Pure LFS hint as a basis for NPTL.  Currently, the
  -LFS build method is flawed, and often the use of NPTL instead of linuxthreads
  -will bring out the flaws, crashing hard either sooner or later.  Pure LFS
  -provides the proper basis off which to build a system, is far FAR less likely
  -to go awry with the use of NPTL.  You can find the Pure LFS hint at the
  -following location: http://linuxfromscratch.org/~greg/pure_lfs.txt
  +designed to replace the linuxthreads package in Glibc. It has many
  +advantages over the linuxthreads package, one of which is the focus on
  +standards-compliance. NPTL never sarcrifices standards-compliance under
  +any circumstances, no matter the gains. Despite this, NPTL has
  +world-class performance, with thread-spawning speeds as much as 500x the
  +speed of traditional thread libs.
  +
  +Despite all these changes, it maintains near-complete
  +backwards-compatibility with linuxthreads, and generally works perfectly
  +as a drop-in replacement where the proper compiler infrastructure is
  +already present.
   
   
   Prerequisites
   =============
   
  -1. A kernel with proper support for thread-local storage. This means that you
  -   either must use a fairly recent development kernel, or use a (rather
  -   intrusive) patch against 2.4.21-pre3. If you choose to use a development
  -   kernel, you should be aware that the 2.5 series is maturing at a fairly high
  -   rate, and a large majority of the feature additions that will happen before
  -   2.6/3.0 have already happened. So it's mostly bugfixes to what's already
  -   there. To use the more recent of the dev kernels, you must install
  -   module-init-tools, the module handling package for 2.5.47 and later. Grab
  -   your copy here:
  +1. A kernel with proper support for thread-local storage. This means
  +   that you must use a fairly recent development (2.5) kernel. Be aware
  +   that the 2.5 series is maturing at a fairly high rate, and a large
  +   majority of the major changes have already happened, it's all a
  +   matter of stablizing what's there. To use a kernel greater than
  +   version 2.5.47 (*HIGHLY* recommended), you must use the new module
  +   handling package called module-init-tools. It comes with a very
  +   comprehensive README, so I won't go into any details here.
   
   	ftp://ftp.kernel.org/pub/linux/kernel/people/rusty/modules/
   
  -   If you would rather use a kernel that's already proven itself in a normal
  -   system environment, you may wish to download a linux 2.4.21-pre3 kernel
  -   and apply the following patch (thanks to YuX):
  -
  -  http://linuxfromscratch.org/~winkie/downloads/linux-2.4.21-pre3-nptl.patch.bz2
  -
  -2. A recent CVS tarball of Glibc. NPTL has an extremely nasty habit of using
  -   features that aren't yet in the releases, hence this is needed. Download the
  -   required sources, and create a tarball for use in Ch.6:
  +2. A recent CVS tarball of Glibc. This is required because NPTL uses
  +   features of Glibc that aren't yet in any released tarball. Download
  +   the required source, and create a tarball:
   
   	export CVSROOT=:pserver:anoncvs at sources.redhat.com:/cvs/glibc
   	cvs -z3 co libc
   	unset CVSROOT
  -	mv libc glibc-2.3-`date +%Y%m%d`
  -	tar -c glibc-2.3-`date +%Y%m%d` | bzip2 > glibc-2.3-`date +%Y%m%d`.tar.bz2
  -	rm -rf glibc-2.3-`date +%Y%m%d`
  -
  -   Now you have a nice pretty little tarball with the required Glibc.
  -
  -3. A (preferably recent) tarball of GCC 3.3. All the necessary TLS stuff is
  -   there, and for the most part the testsuite passes with flying colors. Judging
  -   from talk on the gcc mailing list, GCC 3.3 is likely going to be released
  -   very soon after 3.2.3. GCC 3.3 is a very high quality compiler now, and it's
  -   the way to go. Grab a tarball like so:
  +	mv libc glibc-2.3-$(date +%Y%m%d)
  +	tar -cf glibc-2.3-$(date +%Y%m%d).tar glibc-2.3-$(date +%Y%m%d)
  +	bzip2 glibc-2.3-$(date +%Y%m%d).tar
  +	rm -rf glibc-2.3-$(date +%Y%m%d)
  +
  +3. A recent CVS tarball of GCC (the 3.3 branch). The reason this is
  +   required is that NPTL takes advantage of a keyword (__thread) that
  +   currently isn't in the 3.2 series. Download the CVS, and create a
  +   tarball like so:
   
   	export CVSROOT=:pserver:anoncvs at subversions.gnu.org:/cvsroot/gcc
   	cvs -z3 co -r gcc-3_3-branch gcc
   	unset CVSROOT
   	cd gcc && contrib/gcc_update --touch && cd ..
  -	mv gcc gcc-3.3-`date +%Y%m%d`
  -	tar -c gcc-3.3-`date +%Y%m%d` | bzip2 > \
  -		gcc-3.3-`date +%Y%m%d`.tar.bz2
  -	rm -rf gcc-3.3-`date +%Y%m%d`
  -
  -   Also, grab the patch for GCC to allow building against coreutils 5.0, which
  -   has changed the syntax to tail and head, breaking part of GCC's configure,
  -   and therefore compromising the build.
  +	mv gcc gcc-3.3-$(date +%Y%m%d)
  +	tar -cf gcc-3.3-$(date +%Y%m%d).tar gcc-3.3-$(date +%Y%m%d)
  +	bzip2 gcc-3.3-$(date +%Y%m%d).tar
  +	rm -rf gcc-3.3-$(date +%Y%m%d)
   
  -       http://linuxfromscratch.org/~winkie/downloads/gcc-3.3-coreutils.patch.bz2
  +4. NPTL - duh. Grab the latest tarball from here.
   
  -4. NPTL - duh. Grab the latest tarball from:
   	ftp://people.redhat.com/drepper/nptl/
   
  -5. H J Lu's binutils - This isn't absolutely necessary, but it is highly
  +5. H J Lu's Binutils - This isn't absolutely necessary, but it is highly
      recommended for the latest TLS support and bugfixes.
   
   
  -In-line Installation
  -====================
  +Inline Installation
  +===================
   
   <IMPORTANT>
  -As stated earlier, you must follow the Pure LFS hint to be able to pull all this
  -off, otherwise it will be nearly impossible to get a stable system. Unless
  -otherwise noted, follow the instuctions according to the Pure LFS hint, making
  -sure to exchange the recommended Glibc and GCC versions with ones we downloaded
  -earlier.
  +It is imparative that you use the tarballs that we downloaded earlier
  +(GCC CVS, Glibc CVS, and H J Lu's Binutils). I know it's stupid to say
  +this, but it is VERY IMPORTANT.
   </IMPORTANT>
   
   
  -Ch.5 -- Kernel headers
  -----------------------
  +Ch.5 -- Installing GCC - Pass 1
  +-------------------------------
   
  -You _MUST_ install the kernel headers that apply to the kernel you are building
  -against. This means that if you are installing a 2.5.67 kernel, install those
  -very same headers, and nothing else. Any changes to this will break the hell out
  -of Glibc.
  +Do not disable fixincludes. Doing so will run a high risk of causing
  +your GCC build to bomb out due to invalid syntax on system headers. This
  +is due to use of the __thread keyword in an incorrect fashion.
   
  -If you are using a 2.5 kernel, use the command "make include/asm" instead of
  -"make symlinks", as the latter no longer works.
   
  +Ch.5 -- Installing Kernel Headers
  +---------------------------------
   
  -Ch.5 -- Glibc
  --------------
  +When installing the kernel headers, it is highly recommended that you
  +install the headers for the kernel that you will be running on the LFS
  +system (2.5.xx), and not something from some other kernel (e.g. 2.4.20).
  +Though it has not been tested, it may be possible to compile against
  +headers other than those for the kernel you'll be running.
   
  -Untar the Glibc CVS we downloaded earlier, and untar the NPTL tarball inside of
  -it as you would usually do with linuxthreads. You may notice that the dirs
  -related to linuxthreads are present already, but it's safe to ignore them. When
  -configuring Glibc, use the following comand:
  +When installing the headers, you must use the "make include/asm" command
  +in place of "make symlinks". The latter no longer works in dev kernels.
   
  -	CFLAGS="-O2 -pipe" ../glibc-*/configure --prefix=/stage1 \
  -	   --enable-add-ons=nptl --disable-profile --enable-kernel=2.4.0 \
  -	   --with-binutils=/stage1/bin --with-headers=/stage1/include \
  -	   --without-gd --with-tls --with-__thread
   
  -NOTE: You may notice that we are telling Glibc that we have a 2.4.0 kernel, but
  -in fact we are using a much later version. The reason for this is because there
  -is no reason to support the really old kernels, but specifying anything higher
  -than 2.4.0 seems to break Glibc.
  +Ch.5 -- Installing Glibc
  +------------------------
   
  +While inside the Glibc directory, extract the NPTL tarball as you would
  +normally do for linuxthreads. You may notice that linuxthreads is
  +already present within our CVS image. Ignore this. Configure Glibc with
  +the following command:
   
  -Ch.5 -- GCC
  ------------
  +	../glibc-*/configure --prefix=/stage1 --enable-add-ons=nptl \
  +	--disable-profile --enable-kernel=2.4.0 \
  +	--with-binutils=/stage1/bin --with-headers=/stage1/include \
  +	--without-gd --with-tls --with-__thread
  +	    
  +NOTE: Do not modify the --enable-kernel parameter. It is true that we
  +most definately won't be using a 2.4 kernel, passing anything higher has
  +been known to cause instabilities. Just leave this alone.
   
  -Apply the gcc-3.3-coreutils patch. This fixes some deprecrated syntax to the
  -head and tail commands, one of which will cause the configure script to fail
  -in detecting eh_frame optimization support, therefore compromising the build.
   
  -Some tests will fail. It is recommended but not necessary that you examine the
  -testsuite logs to see why the tests failed, in addition to examining each test
  -case to decide if it really matters to you. Last time I checked, I had some 9
  -different tests fail, and of those 9, only 2 of them were actual failures, the
  -rest were outdated or broken test cases.
  +Ch.5 -- Installing GCC - Pass 2
  +-------------------------------
   
  -During any of the Chapter 5 GCC builds, you may run into an error somewhat like
  -the following: "storage class specified for parameter `type name'" or something
  -of that sort. The cause of this is deprecated use of the __thread keyword,
  -and can be fix by sed'ing all of the __thread occurances to __thread_old.
  +Some tests will fail, this is to be expected. You may wish to examine
  +why the tests fail, as an overwhelming majority of them are just due to
  +the updated warning messages in GCC 3.3, where the tests have not been
  +updated to accept the new syntax.
   
   
  -Ch.6 -- Kernel headers
  -----------------------
  +Ch.6 -- Installing Kernel Headers
  +---------------------------------
   
   See the Chapter 5 note for kernel headers.
   
   
  -Ch.6 -- Glibc
  --------------
  -
  -Again, use the tarball we downloaded earlier, and unpack the NPTL tarball inside
  -of the created directory. Use the following configure command instead of the one
  -specified by Pure LFS:
  -
  -	CFLAGS="-O2 -pipe" ../glibc-*/configure --prefix=/usr \
  -	   --enable-add-ons=nptl --disable-profile --libexecdir=/usr/bin \
  -	   --enable-kernel=2.4.0 --with-headers=/usr/include \
  -	   --with-tls --with-__thread
  -
  -
  -Ch.6 -- GCC
  ------------
  -
  -See the Chapter 5 note for GCC.
  -
  -
  -Ch.6 -- Modutils
  -----------------
  +Ch.6 -- Installing Glibc
  +------------------------
   
  -If you are using a 2.5 kernel, it's safe to say that you have no reason at all
  -to install this package. Just install module-init-tools in its place.
  +Use the following command to configure Glibc:
   
  +	../glibc-*/configure --prefix=/usr --libexecdir=/usr/bin \
  +	--enable-add-ons=nptl --disable-profile --enable-kernel=2.4.0 \
  +	--with-headers=/usr/include --with-tls --with-__thread
   
  -Ch.6 -- Procps
  ---------------
  -
  -Since you're likely using a development kernel, it's safe to say that you'd want
  -a good stable procps package to read it's (sometimes incompatible) /proc fs. The
  -version of procps that you probably want to use is located here:
  -
  -	http://tech9.net/rml/procps
  -
  -While it could be said that this version of procps is inferious because it uses
  -the "old" codebase, you must look at the argument from the other side of the
  -issue, and look closer at the other version (procps 3.x.xx). The older code has
  -been proven time and time again, as opposed to the mostly rewritten version,
  -which has been bugged beyond belief since its inception. For example, there was
  -a bug that lived for who know's how long that prevented procps from showing
  -__ANY__ pid's starting with the number 6. Just imagine what hasn't been found
  -yet.
  -
  -
  -Ch.6 -- Sysklogd
  -----------------
  -
  -The following patch is required to compile sysklogd against a 2.5 kernel:
  -
  -   http://www.linuxfromscratch.org/~winkie/downloads/sysklogd-1.4.1.patch.bz2
   
  +Ch.6 -- Installing GCC
  +----------------------
   
  -Post-LFS Problems
  -=================
  +See the Chapter 5 note for Pass 2 of GCC.
   
  -NVIDIA
  -------
   
  -At the following location you can find a very well done patch to allow the
  -kernel module to compile properly against a 2.5 kernel here:
  +Ch.6 -- Installing Modutils
  +---------------------------
   
  -	http://www.minion.de/nvidia.html
  +Feel free to skip this package and install module-init-tools in it's
  +place. Modutils is useful to 2.5 kernels.
   
  -Once you have NVIDIA_GLX installed, you must move the TLS-enabled libraries to
  -their proper location as follows:
   
  -	rm -f /usr/lib/libGL*
  -	mv /usr/lib/tls/libGL* /usr/lib
  +Ch.6 -- Installing Sysklogd
  +---------------------------
   
  -DevFS
  ------
  +The following patch is required to compile Sysklogd against 2.5 kernels:
   
  -Currently devfsd is not very compatible with the newer kernels, namely in the
  -disagreement it has with the new module utilities. Because of this, you must
  -create an /etc/modprobe.devfs to quiet devfsd down. It is highly recommended
  -that your kernel be as monolithic as possible. If you are using the patch to
  -2.4.21-pre3 then you have nothing to worry about.
  +http://www.linuxfromscratch.org/~winkie/downloads/sysklogd-1.4.1.patch.bz2
   
   
   Feedback
   ========
   
  -If you have had success setting up NPTL, or have an idea for a contribution,
  -please email me to let me know. Hell, email me to tell me my hint sucks if that
  -floats your boat, just give me some feedback! Thanks.
  -
  -	Email: winkie at linuxfromscratch.org
  +If you have had success getting NPTL working on your system, have an
  +idea for something I should add, or want to report a bug, please e-mail
  +me to let me know. Hell, e-mail to tell me my hint sucks if that floats
  +your boat, just give me some feedback! Thanks.
   
  +	E-mail: winkie at linuxfromscratch.org
   
  
  
  
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list