diff options
author | Russ Cox <rsc@swtch.com> | 2020-01-19 21:10:11 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-01-19 23:04:58 -0500 |
commit | cb8f7357867a2a5d0bd742ceeb77bce9ad5f435c (patch) | |
tree | e21e8faaa68f8df48632973444a664f582de719a /src | |
parent | 8d82ccefd2b4b058e20ae0a7e3d9ef9b6b8cf8c3 (diff) | |
download | plan9port-cb8f7357867a2a5d0bd742ceeb77bce9ad5f435c.tar.gz plan9port-cb8f7357867a2a5d0bd742ceeb77bce9ad5f435c.tar.bz2 plan9port-cb8f7357867a2a5d0bd742ceeb77bce9ad5f435c.zip |
all: remove Linux 2.4 vs 2.6 detection
Linux 2.4 is dead.
(The libthread code hasn't worked for Linux 2.4 for a long time.)
Diffstat (limited to 'src')
-rw-r--r-- | src/libthread/README.Linux | 40 | ||||
-rw-r--r-- | src/libthread/sysofiles.sh | 7 |
2 files changed, 3 insertions, 44 deletions
diff --git a/src/libthread/README.Linux b/src/libthread/README.Linux deleted file mode 100644 index 04c491a8..00000000 --- a/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. - diff --git a/src/libthread/sysofiles.sh b/src/libthread/sysofiles.sh index 30a4c338..fd60f131 100644 --- a/src/libthread/sysofiles.sh +++ b/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 ;; *) |