LinuxThreads is an POSIX pthreads implementation using "kernel threads". In
this FreeBSD port, a kernel thread is started using rfork (whereas in the
original Linux implementation a kernel thread is started using the Linux clone
call).
This implementation provides a so-called one-to-one mapping of threads to
kernel schedulable entities. For more information see about the original
LinuxThreads implementation see:
WWW: http://pauillac.inria.fr/~xleroy/linuxthreads/
Note that LinuxThreads has been integrated with the GNU C library (glibc) since
version 2.0, so the above URL points to dated information.
The complete FreeBSD source code matching the installed userland
must be installed in /usr/src before building linuxthreads.
- Fix plist and mark as UNBROKEN.
- Use USE_LDCONFIG.
- Pass maintainer to submitter.
PR: ports/136037
Submitted by: Sylvio Cesar <scjamorim@bsd.com.br>
Previous backport of the 2001-09-11 fix from newer linuxthreads version
failed to take into account that the library contains wrappers for read()
and write() that calls __libc_read() and __libc_write(). This incorrectly
causes normal read() and write() operations to be retried if aborted by a
signal.
Instead of making __libc_read() and __libc_write() retry if aborted by a
signal, add new functions __libc_safe_read() and __libc_safe_write() that
retries operation after a signal. Change reads from manager pipe and
writes to manager pipe to use __libc_safe_read() and __libc_safe_write().
Correct retrieval of stack address and size when getting the current
thread attributes for the main thread.
Add emulation of native threads (libc_r) method of getting the current
thread attributes (pthread_attr_get_np()) and adjust emulation of native
threads pthread_attr_getstackaddr() to return bottom of stack instead of
top of stack.
Correct emulation of native threads pthread_mutexattr_settype() when
selecting recursive mutexes. Previously, the argument conversion before
calling the linuxthreads version of pthread_mutexattr_setattr() ended up
selecting errorcheck mutexes instead of recursive mutexes.
Make it buildable on RELENG_6 after MFC of getXXX_r(3).
Reported by: Eric Schuele <e.schuele__at__computer.org>,
Ganbold <ganbold__at__micom.mng.net>
Approved by: tegge (maintainer)
Backport 2001-09-11 fix from newer linuxthreads versions making
the communication over the pthread manager pipe a little more robust by
retrying after EINTR failures. Without this fix, linuxthreads based
binaries that run fine on FreeBSD 4 starts crashing in mysterious ways
on FreeBSD 6.
Backport 2002-03-22 fix from newer linuxthreads versions defining
MEMORY_BARRIER() as a asm op which clobbers memory to avoid unintended
reordering by the compiler.
Check for NO_PIC and NO_PROFILE on FreeBSD >= 6.0.
Add sys/_pthreadtypes.h to allow compilation on FreeBSD >= 6.0.
Initialize signal trampoline variables earlier to avoid race in wrapper
around sigaction.
Fix known API wrapper bugs.
Port compile time options:
Add option for using an alternate restart signal instead of SIGUSR2.
Add options for adjustment of maximum thread stack size and maximum
number of threads.
Make all options start with LINUXTHREADS_
Note that complete FreeBSD source matching userland must be installed
in /usr/src when compiling this port.
Add option to ignore posix priority scheduling.
Add threadsafe versions of some libc functions on FreeBSD 4.x.
Register liblgcc_r_pic.a as installed for FreeBSD 5.x.
Restore gethostbyaddr_r wrapper and remove getpw{nam,uid}_r wrappers for
newer versions of FreeBSD 5.X.
Drop use of deprecated AINC variable.
Reenable use of ld(1) to restore the LINUXTHREADS_WRAP_API option.
Rename __thread to __xthread in prototypes to avoid conflict with
new gcc keyword.
Bump port revision.
Add new experimental option, LINUXTHREADS_WRAP_API, that adds wrapper
functions providing most of the native threads API while avoiding name
clashes by transparently prefixing all function names that directly
provide the linuxthreads API.
Adjust to changed compilation environment (Makefiles setup) in 5.1-CURRENT.
Link with liblgcc_r when creating linuxthreads versions of shared
libraries.
Register PIC archives when INSTALL_PIC_ARCHIVE has been defined.
Defining INSTALL_LIBLTHREAD_PIC_ARCHIVE causes installation and
registration of PIC archive for liblthread, which can be used to
generate a shared liblthread library for a different gcc installation.
Bump port revision.
Build linuxthreads version of libstdc++ and libsupc++ under 5.0-CURRENT.
Don't misuse DESTDIR when building linuxthreads version of libgcc.
Fix varargs warning under 5.0-CURRENT.
Don't try to register profiled libraries when NOPROFILE has been specified.
Don't try to register shared libraries when NOPIC has been specified.
Bump port revision.
PR: 38876
Fix hang caused by a thread calling exit():
- Block cancel signal while creating new thread to avoid losing
the signal.
- Terminate the process with _exit(1) if it's unsafe to continue
calling atexit functions and destructors.
Document that FreeBSD source code is needed to build linuxthreads port. Add
sanity check for presence of needed FreeBSD source code. Unbreak compilation
on 5.0-CURRENT, DEFS.h is no longer available. Bump port revision.
Add an optional experimental patch that reduce the number of context switches
on UP systems when the thread waiting on a condition has a higher priority
than the thread signalling the condition.
Backout library major number bump. It wasn't needed. Additionally, ldconfig
-r didn't list the library, making it impossible for other ports to depend on
the linuxthreads port.
Change PKGDIR from pkg/ to . Also fix places where ${PKGDIR} is spelled out
(many of which are ${PKGDIR}/MESSAGE -> ${PKGMESSAGE} type fixes that
shouldn't have been necessary) and the string "/pkg/" appear.
Fix a mistake in the directions for creating symlinks. Add instructions for
creating a gcc specs file (prompted by Dima Ruben). Remove obsolete
information and update various tidbits.
Rather than copying the entirety of src/gnu/lib/libgcc/Makefile, .include it
and override variables as necessary. This vastly shortens this file, makes
tracking toolchain changes more automatic, and makes the linuxthreads port
build on both -stable and -current.