Commit Diff


commit - 8d82ccefd2b4b058e20ae0a7e3d9ef9b6b8cf8c3
commit + cb8f7357867a2a5d0bd742ceeb77bce9ad5f435c
blob - 0291e7135f7027e77c286569e507fd1b6d7ccd7a
blob + 11d350058cdfad5d24119d33ebcd7e11363ab7e1
--- INSTALL
+++ INSTALL
@@ -66,23 +66,6 @@ DragonFly|*BSD)
 esac
 
 (
-if [ `uname` = Linux ]; then
-	# On Linux, we use the kernel version to decide whether
-	# to use pthreads or not.  On 2.6 versions that aren't
-	# linking with NPTL by default, pretend to be an older kernel.
-	echo "* Running on Linux: checking for NPTL..."
-	gcc lib/linux-isnptl.c -lpthread
-	if ./a.out >/dev/null
-	then	
-		echo "	NPTL found."
-		echo "SYSVERSION=2.6.x" >>$PLAN9/config
-	else
-		echo "	NPTL not found."
-		echo "SYSVERSION=2.4.x" >>$PLAN9/config
-	fi
-	rm -f ./a.out
-fi
-
 if [ `uname` = SunOS ]; then
 	# On Solaris x86, uname -p cannot be trusted.
 	echo "* Running on Solaris: checking architecture..."
@@ -168,7 +151,7 @@ if $dobuild; then
 		echo "* Error: mk failed to build."
 		exit 1
 	fi
-	
+
 	echo "* Building everything (be patient)..."
 	mk clean
 	mk libs-nuke
@@ -216,13 +199,13 @@ if $doinstall; then
 			mk man
 		)
 	fi
-	
+
 	if [ -x LOCAL.INSTALL ]; then
 		echo "* Running local modifications..."
 		echo cd `pwd`';' ./LOCAL.INSTALL
 		./LOCAL.INSTALL
 	fi
-	
+
 	echo "* Done. "
 	echo "	"
 	echo "* Add these to your profile environment."
blob - 20919e9ace9d6ff4580c0dfa8ea47f50fcab0d57
blob + b07d01492bbb11321327389b4642e49ec7ebf422
--- bin/9c
+++ bin/9c
@@ -93,28 +93,20 @@ case "$tag" in
 		useclang
 		cflags="$ngflags -g3 -m32"
 		;;
-*Darwin*)	usegcc 
+*Darwin*)	usegcc
 		cflags="$ngflags -g3 -no-cpp-precomp -m32" ;;
 *HP-UX*)	cc=${CC9:-cc}; cflags="-g -O -c -Ae" ;;
-*Linux*)	usegcc 
+*Linux*)	usegcc
 		case "${CC9:-gcc}" in
 		tcc)
 			cc=tcc
 			cflags="-c -g"
 			;;
 		esac
-		case "${SYSVERSION:-`uname -r`}" in
-		2.4.*)
-			cflags="$cflags -D__Linux24__"
-			;;
-		2.6.*)
-			cflags="$cflags -D__Linux26__"
-			;;
-		esac
 		;;
 *OSF1*)		cc=${CC9:-cc}; cflags="-g -O -c" ;;
 *SunOS*-cc)	cc=cc;
-		cflags="-mt -g -O -c -xCC -D__sun__" 
+		cflags="-mt -g -O -c -xCC -D__sun__"
 		u=`uname`
 		v=`uname -r`
 		s=`echo $u$v | tr '. ' '__'`
blob - 8af271543c127b7ee082f20e2056f03d75b8ab6b
blob + a10aab72820eacdfa813753aaafb1b1f1612a03f
--- bin/9l
+++ bin/9l
@@ -25,12 +25,7 @@ case "$tag" in
 *Linux*)
 	ld=${CC9:-gcc}
 	userpath=true
-	extralibs="$extralibs -lutil -lresolv"
-	case "${SYSVERSION:-`uname -r`}" in
-	2.6.* | [3-9].* | [1-9][0-9].*)
-		extralibs="$extralibs -lpthread"
-		;;
-	esac
+	extralibs="$extralibs -lutil -lresolv -lpthread"
 	;;
 *Darwin*x86_64*)
 	ld="${CC9:-gcc} -m64"
@@ -41,7 +36,7 @@ case "$tag" in
 *SunOS*)
 	ld="${CC9:-cc} -g"
 	extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
-	# Record paths to shared libraries to avoid needing LD_LIBRARY_PATH 
+	# Record paths to shared libraries to avoid needing LD_LIBRARY_PATH
 	for i in "$libsl $@"
 	do
 		case "$i" in
@@ -106,7 +101,7 @@ then
 			lpaths="$lpaths $l"
 		esac
 	done
-	
+
 	if $verbose
 	then
 		echo "ofiles $ofiles"
@@ -309,7 +304,7 @@ then
 
 	frameworks=""
 	for i in $autoframeworks
-	do	
+	do
 		frameworks="-framework $i $frameworks"
 	done
 fi
@@ -335,8 +330,8 @@ fi
 
 xtmp="${TMPDIR-/tmp}/9l.$$.$USER.out"
 xxout() {
-	sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . | 
-	egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub' 
+	sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . |
+	egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub'
 	rm -f $xtmp
 }
 
blob - 8a715b1edd7417301f2d8fd7615dc91f5bd0eb07
blob + 3bea890e34a4c5240f7ce866a0e1f2ce64e0ed4d
--- include/u.h
+++ include/u.h
@@ -66,10 +66,8 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)
 
 #if defined(__linux__)
 #	include <sys/types.h>
-#	if defined(__Linux26__)
-#		include <pthread.h>
-#		define PLAN9PORT_USING_PTHREADS 1
-#	endif
+#	include <pthread.h>
+#	define PLAN9PORT_USING_PTHREADS 1
 #	if defined(__USE_MISC)
 #		undef _NEEDUSHORT
 #		undef _NEEDUINT
blob - e4c23c63703964293b705e2f0b202851246c7986 (mode 644)
blob + /dev/null
--- lib/linux-isnptl.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int
-main(void)
-{
-	ulong x;
-
-	x = (ulong)pthread_self();
-	printf("%lx\n", x);
-	if(x < 1024*1024)
-		exit(1);	/* NOT NPTL */
-	exit(0);
-}
blob - fb04a29619e71d9ccbd8aa0f1d92a8d9ca4f8460
blob + 8d24d67d5171c2becbfd9197085c10d4b6a80b88
--- man/man1/9c.1
+++ man/man1/9c.1
@@ -79,9 +79,7 @@ to the include path.
 .I 9c
 also defines
 .B __sun__
-on SunOS systems and
-.B __Linux26__
-on Linux systems with 2.6-series kernels.
+on SunOS systems.
 .PP
 .I 9a
 assembles the named files into object files for the current system.
@@ -136,13 +134,13 @@ but
 always provides the following key characters:
 .TP
 .B d
-Delete 
-.I files 
+Delete
+.I files
 from the archive file.
 .TP
 .B r
 Replace
-.I files 
+.I files
 in the archive file, or add them if missing.
 .TP
 .B t
@@ -181,7 +179,7 @@ Normally
 will create a new archive when
 .I afile
 does not exist, and give a warning.
-Option 
+Option
 .B c
 discards any old contents and suppresses the warning.
 .PD
blob - be35bd35414877b03a47673dff5c319c51ba8dc7
blob + 8fcc9e4187924ed23f84873c731036ede3722e5f
--- man/man1/install.1
+++ man/man1/install.1
@@ -32,7 +32,7 @@ rebuilds and installs everything, and then cleans up.
 .PP
 There are a few files in tree which have the root
 hard-coded in them.
-After the build, 
+After the build,
 .I INSTALL
 edits these files to replace the string
 .B /usr/local/plan9
@@ -71,31 +71,20 @@ expectations of certain package management systems.
 .PP
 At the end of the installation,
 .I INSTALL
-prints suggested settings for the environment variables 
+prints suggested settings for the environment variables
 .B $PLAN9
 and
 .BR $PATH .
 .PP
-Plan 9 from User Space uses different threading implementations on Linux 2.6 and
-later kernels than on 2.4 and earlier;
-and on FreeBSD 5 and later kernels than on FreeBSD 4 and earlier.
-Running binaries from one class on another will not work.
-.PP
-Some Linux 2.6 systems (e.g., Gentoo) do not use the new NPTL pthread library
-even though the kernel supports them.  On these systems, plan9port must 
-fall back on the threading code intended for Linux 2.4.  To accomplish this,
 .I INSTALL
-checks whether the running system uses NPTL and sets
-.B SYSVERSION
-in
-.B \*9/config
-accordingly.
+writes various autodetected settings to
+.BR \*9/config .
 The file
 .B \*9/LOCAL.config
 is appended to
 .B config
 after this auto-detection and can be used to override the choices.
-If 
+If
 .B LOCAL.config
 contains a line
 .B WSYSTYPE=nowsys
@@ -110,7 +99,7 @@ On Ubuntu, it suffices to install xorg-dev.
 can safely be repeated to rebuild the system from scratch.
 .PP
 Once the system is built for the first time,
-it can be maintained and rebuilt using 
+it can be maintained and rebuilt using
 .IR mk (1).
 To rebuild individual commands or libraries,
 run
blob - 04c491a8be3b83a832af32ef4875e26159b6bcee (mode 644)
blob + /dev/null
--- src/libthread/README.Linux
+++ /dev/null
@@ -1,40 +0,0 @@
-Thread support on Linux is confused by the recent thread local storage (TLS)
-support that has been put into the ELF tool chain.  The TLS libraries are 
-installed in /lib/tls on most Linux systems.
-
-We provide two different implementations of the os-dependent parts
-of libthread for Linux.  The first is intended for use on Linux 2.4 and earlier
-kernels, which do not support TLS.  It is in Linux.c and Linuxasm.c and
-does not use the pthread interface.  The second is intended for Linux 2.6
-and later kernels, which do support TLS.  It is in pthread.c and uses the
-standard pthread interface.  It expects to be linked against the TLS-aware
-thread library aka NPTL.
-
-If you use Linux.c and Linuxasm.c with TLS libraries, they do not
-set up the TLS properly so you will get incorrect programs.
-For example, there will only be one errno among all the procs
-in your program instead of one per proc.  The pthread NPTL
-implementation is needed to use the TLS libraries properly.
-
-If you use pthread.c without TLS libraries (i.e., with the old Linux
-pthread library known as LinuxThreads), then you will also get
-incorrect programs, although more obviously so.  The LinuxThreads
-library assumes it can look at the stack pointer to distinguish between
-threads, but libthread does its own stack management, breaking this
-assumption.  If you run a pthread-compiled program with the 
-LinuxThreads library, LinuxThreads itself will cause a segmentation
-fault in __pthread_getspecific() the first time it is called from a
-non-standard stack.
-
-So, it is important that you compile binaries that match your
-system's choice of TLS vs. not-TLS libraries.  The hard part is figuring
-out which your system has chosen.  Plan9port looks at the kernel
-version you are running and assumes that on kernels that support
-TLS (2.6+) you will be using TLS.
-
-Apparently Gentoo and maybe other distributions do not follow this rule.
-They use non-TLS libraries even on kernels that can support TLS.
-To accomodate them, you can add a line SYSVERSION=2.4 to $PLAN9/config
-to force the build to think you are running an old kernel.
-The INSTALL script sets up this file automatically on Linux systems.
-
blob - 30a4c33888664ad87284355eb065336e715902c8
blob + fd60f1314caac0359564e514980868be51932310
--- src/libthread/sysofiles.sh
+++ src/libthread/sysofiles.sh
@@ -2,12 +2,11 @@
 
 test -f $PLAN9/config && . $PLAN9/config
 
-tag="$OBJTYPE-$SYSNAME-${SYSVERSION:-`uname -r`}-${CC9:-cc}"
-case "$tag" in
-*-NetBSD-*)
+case "$SYSNAME" in
+NetBSD)
 	echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o pthread.o stkmalloc.o
 	;;
-*-OpenBSD-*)
+OpenBSD)
 	echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o stkmmap.o
 	;;
 *)