History log of /freebsd-current/lib/libthr/Makefile
Revision Date Author Comments
# 9bfd3b40 12-May-2024 Kyle Evans <kevans@FreeBSD.org>

Add a build knob for _FORTIFY_SOURCE

In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled,
otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0
unconditionally to ease bisect across older versions without the new
symbols, and we'll put out a call for testing.

include/*.h include their ssp/*.h equivalents as needed based on the
knob. Programs and users are allowed to override FORTIFY_SOURCE in their
Makefiles or src.conf/make.conf to force it off.

Reviewed by: des, markj
Relnotes: yes
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D32308


# f8bbbce4 06-Mar-2024 Konstantin Belousov <kib@FreeBSD.org>

libthr: remove explicit sys/cdefs.h includes

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# eb90239d 19-Feb-2024 Brooks Davis <brooks@FreeBSD.org>

lib{c,thr}: add DT_RUNPATH for gcc -m32

To allow gcc -m32 to work, link libc and libthr with --rpath-/usr/lib32.
When called with -m32, gcc is currently unable to communicate to
the bfd linker that it should look in /usr/lib32 to resolve needed (as
opposed to explicitly linked) libraries so we need to provide a hint.

See also: https://sourceware.org/bugzilla/show_bug.cgi?id=31395

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43910


# 99ea6757 19-Feb-2024 Brooks Davis <brooks@FreeBSD.org>

lib{c,sys}: move auxargs more firmly into libsys

Continue to filter the public interface (elf_aux_info()), but entierly
relocate the private interfaces (_elf_aux_info(),
__init_elf_aux_vector(), and __elf_aux_vector) to libsys.

This ensures that rtld updates the correct (only) copy of
__elf_aux_vector. After 968a18975adc9c2a619bb52aa2f009de99fc9e24
updates were confused and __getosreldate was failing, causing
the system to fall back to compat compat12 syscalls in some cases.

Return to explicitly linking libc to libsys and link libthr with libc
and libsys (in that order).

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43910


# 49d68436 07-Feb-2024 Brooks Davis <brooks@FreeBSD.org>

libthr: filter rather than link with libsys

The allows gcc + GNU ld to link programs with -m32 -pthread without
erroring out due to _umtx_op_err being undefined (unless -lsys is added
to the link command.

We now always link _umtx_op_err into libthr (not just when it's static)
and filter it with libsys so we call that implementation. The dynamic
implementations (at least the assembly ones) should likely become stubs
as a further refinement.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43783


# ef9871c6 17-Jan-2024 Brooks Davis <brooks@FreeBSD.org>

libthr: move _umtx_op_err() to libsys

Declare in sys/umtx.h and implement in libsys. Explicitly link libthr
with libsys.

When building libthr static include _umtx_op_err so we don't break static
linkage with -lpthread.

Reviewed by: kib, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/908


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# 642cd511 06-Jul-2023 Greg Becker <becker.greg@att.net>

libthr: Add src.conf variable WITHOUT_PTHREADS_ASSERTIONS

This patch fixes a bug which prevents building libthr without
_PTHREADS_INVARIANTS defined. The default remains to build libthr
with -D_PTHREADS_INVARIANTS. However, with this patch, if one builds
libthr with WITHOUT_PTHREADS_ASSERTIONS=true then the latency to
acquire+release a default pthread mutex is reduced by roughly 5%, and a
robust mutex by roughly 18% (as measured by a simple synthetic test on a
Xeon E5-2697a based machine).

Reviewed by: jhb, kib, mjg
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D40900


# bbf4df17 10-Feb-2022 John Baldwin <jhb@FreeBSD.org>

libthr: Disable stack unwinding on ARM.

When a thread exits, _Unwind_ForcedUnwind() is used to walk up stack
frames executing pending cleanups pushed by pthread_cleanup_push().
The cleanups are popped by thread_unwind_stop() which is passed as a
callback function to _Unwind_ForcedUnwind().

LLVM's libunwind uses a different function type for the callback on
32-bit ARM relative to all other platforms. The previous unwind.h
header (as well as the unwind.h from libcxxrt) use the non-ARM type on
all platforms, so this has likely been broken on 32-bit arm since it
switched to using LLVM's libunwind.

For now, just disable stack unwinding on 32-bit arm to unbreak the
build until a proper fix is tested.


# c00d3456 10-Feb-2022 John Baldwin <jhb@FreeBSD.org>

Install unwind.h into /usr/include

Install headers from LLVM's libunwind in place of the headers from
libcxxrt and allow C applications to use the library.

As part of this, remove include/unwind.h and switch libthr over to
using the installed unwind.h.

Reviewed by: dim, emaste
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D34065


# 9efbe526 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

libthr: work around an ASAN false-positive

I got the following error with an ASAN-instrument libthr:

==803==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffcdb0 at pc 0x000801863396 bp 0x7ff8
READ of size 4 at 0x7fffffffcdb0 thread T0
#0 0x801863395 in handle_signal /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:262:2
#1 0x801860da2 in thr_sighandler /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:246:2

Address 0x7fffffffcdb0 is located in stack of thread T0 at offset 208 in frame
#0 0x80186080f in thr_sighandler /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:213

This frame has 1 object(s):
[32, 64) 'act' (line 216) <== Memory access at offset 208 overflows this variable
HINT: this may be a false positive if your program uses some custom stack

This seems like a false-positive since the line in question is
`SIGSETOR(actp->sa_mask, ucp->uc_sigmask);` and it complains about a read
operation (from the ucontext_t argument) so this indicates to me that ASAN
does not understand that thr_sighandler() is a signal handler.

Differential Revision: https://reviews.freebsd.org/D31074


# c8c62548 22-Mar-2021 Alex Richardson <arichardson@FreeBSD.org>

Don't add -Winline for WARNS=6

This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235


# fac6dee9 12-May-2020 Eric van Gyzen <vangyzen@FreeBSD.org>

Remove tests for obsolete compilers in the build system

Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree.
Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions
for older compilers.

Reviewed by: imp (earlier version), emaste, jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24802


# 5d00c5a6 29-Mar-2019 Konstantin Belousov <kib@FreeBSD.org>

Fix initial exec TLS mode for dynamically loaded shared objects.

If dso uses initial exec TLS mode, rtld tries to allocate TLS in
static space. If there is no space left, the dlopen(3) fails. If space
if allocated, initial content from PT_TLS segment is distributed to
all threads' pcbs, which was missed and caused un-initialized TLS
segment for such dso after dlopen(3).

The mode is auto-detected either due to the relocation used, or if the
DF_STATIC_TLS dynamic flag is set. In the later case, the TLS segment
is tried to allocate earlier, which increases chance of the dlopen(3)
to succeed. LLD was recently fixed to properly emit the flag, ld.bdf
did it always.

Initial test by: dumbbell
Tested by: emaste (amd64), ian (arm)
Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D19072


# 09b47fc1 27-Mar-2019 Ed Maste <emaste@FreeBSD.org>

revert r341429 "disable BIND_NOW in libc, libthr, and rtld"

r345620 by kib@ fixed the rtld issue that caused a crash at startup
during resolution of libc's ifuncs with BIND_NOW.

PR: 233333
Sponsored by: The FreeBSD Foundation


# d49ca25d 30-Jan-2019 Konstantin Belousov <kib@FreeBSD.org>

Rename rtld-elf/malloc.c to rtld-elf/rtld_malloc.c.

Then malloc.c file name is too generic to use it for libthr.a.

Sponsored by: The FreeBSD Foundation
MFC after: 13 days


# 381c2d2e 29-Jan-2019 Konstantin Belousov <kib@FreeBSD.org>

Untangle jemalloc and mutexes initialization.

The need to use libc malloc(3) from some places in libthr always
caused issues. For instance, per-thread key allocation was switched to
use plain mmap(2) to get storage, because some third party mallocs
used keys for implementation of calloc(3).

Even more important, libthr calls calloc(3) during initialization of
pthread mutexes, and jemalloc uses pthread mutexes. Jemalloc provides
some way to both postpone the initialization, and to make
initialization to use specialized allocator, but this is very fragile
and often breaks. See the referenced PR for another example.

Add the small malloc implementation used by rtld, to libthr. Use it in
thr_spec.c and for mutexes initialization. This avoids the issues with
mutual dependencies between malloc and libthr in principle. The
drawback is that some more allocations are not interceptable for
alternate malloc implementations. There should be not too much memory
use from this allocator, and the alternative, direct use of mmap(2) is
obviously worse.

PR: 235211
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D18988


# 0e450664 03-Dec-2018 Ed Maste <emaste@FreeBSD.org>

disable BIND_NOW in libc, libthr, and rtld

An issue remains with BIND_NOW and processes using threads. For now,
restore libc's BIND_NOW disable, and also disable BIND_NOW in rtld and
libthr.

A patch is in review (D18400) that likely fixes this issue, but just
disable BIND_NOW pending further testing after it is committed.

PR: 233333
Sponsored by: The FreeBSD Foundation


# 9c4a7c50 23-May-2018 John Baldwin <jhb@FreeBSD.org>

Remove references to the LIBC_SCCS and SYSLIBC_SCCS C macros.

This language dates back to when libthr was libc_r that included its own
syscalls and replaced libc entirely. It hasn't been relevant for a long
time.


# d511b20a 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.


# 4b330699 02-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after: 1 weeks


# afba14e2 26-May-2017 Eric van Gyzen <vangyzen@FreeBSD.org>

libthr: increase WARNS to the default (6)

...and silence cast-align warnings from gcc.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10935


# cfc1010f 22-May-2017 Eric van Gyzen <vangyzen@FreeBSD.org>

Revert r318583 (libthr: use default WARNS level of 6)

Revert this while I fix RISC-V, SPARC, and probably all architectures
that use GCC.

Reported by: kib
Pointy hat to: vangyzen
Sponsored by: Dell EMC


# 0b2f3f20 20-May-2017 Eric van Gyzen <vangyzen@FreeBSD.org>

libthr: Use CLI flags instead of pragmas to disable warnings

People tweaking the build system or compilers tend to look into
the Makefile and not into the source. Having some warning controls
in the Makefile and some in the source code is surprising.

Pragmas have the advantage that they leave the warnings enabled
for more code, but that advantage isn't very relevant in these cases.

Requested by: kib
Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832


# d71b2897 20-May-2017 Eric van Gyzen <vangyzen@FreeBSD.org>

libthr: use default WARNS level of 6

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832


# 6eccf6e3 20-May-2017 Eric van Gyzen <vangyzen@FreeBSD.org>

libthr: disable thread-safety warnings

These warnings don't make sense for code that implements
the locking primitives.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832


# 58368ba9 19-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon


# e13c6045 20-Mar-2016 Konstantin Belousov <kib@FreeBSD.org>

Fix typo.

MFC after: 3 days


# c389411c 05-Feb-2016 Glen Barber <gjb@FreeBSD.org>

Remove libc, librtld_db, libthr packages, and further increase
the constraints on what needs to be installed in a specific to
maintain consistency during upgrades.

Create a new clibs package containing libraries that are needed
as a bare minimum for consistency.

With much help and input from: kib
Sponsored by: The FreeBSD Foundation


# a70cba95 04-Feb-2016 Glen Barber <gjb@FreeBSD.org>

First pass through library packaging.

Sponsored by: The FreeBSD Foundation


# 18b2ee82 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Revert r284417 it is not necessary anymore


# 4232f826 15-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Enforce overwritting SHLIBDIR

Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by: many


# 1119ece4 27-Apr-2015 Enji Cooper <ngie@FreeBSD.org>

Build/install libc, librt, libthr, and msun NetBSD test suites on all
architectures

MFC after: 1 week


# 0538aafc 18-Apr-2015 Konstantin Belousov <kib@FreeBSD.org>

The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and
pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x
kernels which required padding before the off_t parameter. The
fcntl(2) contains compatibility code to handle kernels before the
struct flock was changed during the 8.x CURRENT development. The
shims were reasonable to allow easier revert to the older kernel at
that time.

Now, two or three major releases later, shims do not serve any
purpose. Such old kernels cannot handle current libc, so revert the
compatibility code.

Make padded syscalls support conditional under the COMPAT6 config
option. For COMPAT32, the syscalls were under COMPAT6 already.

Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to
(partially) disable the removed shims.

Reviewed by: jhb, imp (previous versions)
Discussed with: peter
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 20fe2c94 21-Jan-2015 Andrew Turner <andrew@FreeBSD.org>

Merge all the copies of _tcb_ctor and _tcb_dtor.

The amd64, i386, and sparc64 versions were identical, with the one
difference where the former two used inline asm instead of _tcb_get. I
have compared the function before and after replacing the asm with _tcb_get
and found the object files to be identical.

The arm, mips, and powerpc versions were almost identical. The only
difference was the powerpc version used an alignment of 1 where arm and
mips used 16. As this is an increase in alignment is will be safe.

Along with this arm, mips, and powerpc all passed, when initial was true,
the value returned from _tcb_get as the first argument to
_rtld_allocate_tls. This would then return this pointer back to the caller.
We can remove these extra calls by checking if initial is set and setting
the thread control block directly. As this is what the sparc64 code does
we can use it directly.

As after these observations all the architectures can now have identical
code we can merge them into a common file.

Differential Revision: https://reviews.freebsd.org/D1556
Reviewed by: kib
Sponsored by: The FreeBSD Foundation


# 8495e8b1 03-Jan-2015 Konstantin Belousov <kib@FreeBSD.org>

Fix known issues which blow up the process after dlopen("libthr.so")
(or loading a dso linked to libthr.so into process which was not
linked against threading library).

- Remove libthr interposers of the libc functions, including
__error(). Instead, functions calls are indirected through the
interposing table, similar to how pthread stubs in libc are already
done. Libc by default points either to syscall trampolines or to
existing libc implementations. On libthr load, libthr rewrites the
pointers to the cancellable implementations already in libthr. The
interposition table is separate from pthreads stubs indirection
table to not pull pthreads stubs into static binaries.

- Postpone the malloc(3) internal mutexes initialization until libthr
is loaded. This avoids recursion between calloc(3) and static
pthread_mutex_t initialization.

- Reinstall signal handlers with wrapper on libthr load. The
_rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2)
when libthr is statically referenced from the main binary.

In the process, fix openat(2), swapcontext(2) and setcontext(2)
interposing. The libc symbols were exported at different versions
than libthr interposers. Export both libc and libthr versions from
libc now, with default set to the higher version from libthr.

Remove unused and disconnected swapcontext(3) userspace implementation
from libc/gen.

No objections from: deischen
Tested by: pho, antoine (exp-run) (previous versions)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 3eee258d 15-Nov-2014 Enji Cooper <ngie@FreeBSD.org>

Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as
lib/libthr/tests

A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures

Original work by: pho
Sponsored by: EMC / Isilon Storage Division


# c6063d0d 05-May-2014 Warner Losh <imp@FreeBSD.org>

Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.


# a5fc5b62 05-Apr-2014 Warner Losh <imp@FreeBSD.org>

Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 0935fc89 07-Oct-2010 David Xu <davidxu@FreeBSD.org>

Oops, don't remove -fexceptions flag.


# 0c3c9625 07-Oct-2010 David Xu <davidxu@FreeBSD.org>

unwind.h was imported, gcc directory is no longer needed.


# f4213b90 24-Sep-2010 David Xu <davidxu@FreeBSD.org>

To support stack unwinding for cancellation points, add -fexceptions flag
for them, two functions _pthread_cancel_enter and _pthread_cancel_leave
are added to let thread enter and leave a cancellation point, it also
makes it possible that other functions can be cancellation points in
libraries without having to be rewritten in libthr.


# 3832fd24 14-Sep-2010 David Xu <davidxu@FreeBSD.org>

add code to support stack unwinding when thread exits. note that only
defer-mode cancellation works, asynchrnous mode does not work because
it lacks of libuwind's support. stack unwinding is not enabled unless
LIBTHR_UNWIND_STACK is defined in Makefile.


# 10f3ae58 12-Sep-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd, with a small amount of rework:
For all libthr contexts, use ${MACHINE_CPUARCH}
for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use
${MACHINE_CPUARCH}
Move some common code up a layer (the .PATH statement was the same in
all the arch submakefiles).

# Hope she hasn't busted powerpc64 with this...


# f4fbf9c8 24-Aug-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Unify 32-bit and 64-bit PowerPC libthr support. This reduces code
duplication, and simplifies the TBEMD import.

Requested by: imp


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 6d772c3b 28-Nov-2009 Konstantin Belousov <kib@FreeBSD.org>

Revert r199830 for now. Too many ports dlopen() libraries linked with
libthr, but forgot to link main binary with it.


# 86665365 26-Nov-2009 Konstantin Belousov <kib@FreeBSD.org>

Libthr cannot be dynamically loaded into the running process.
Mark it with -z nodlopen for now.

Discussed with: jhb, kan
MFC after: 3 weeks


# 35c60825 30-Mar-2009 David Xu <davidxu@FreeBSD.org>

Turn on nodelete linker flag because libthr can not be unloaded safely,
it does hook on to libc.


# c30c187d 08-Mar-2009 David Xu <davidxu@FreeBSD.org>

Don't reference non-existent __fcntl_compat if WITHOUT_SYSCALL_COMPAT is defined.

Submitted by: Pawel Worach "pawel dot worach at gmail dot com"


# 241715e7 24-Feb-2009 Ruslan Ermilov <ru@FreeBSD.org>

With only one threading library, simplify the logic of setting SHLIBDIR.


# d9ca85fc 21-Feb-2009 Ruslan Ermilov <ru@FreeBSD.org>

Fix build when WITH_SSP is set explicitly.

Submitted by: Jeremie Le Hen


# 455cc6ec 13-Feb-2009 Jung-uk Kim <jkim@FreeBSD.org>

Honor WITHOUT_INSTALLLIB in some places.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 042df2e2 25-Jun-2008 Ruslan Ermilov <ru@FreeBSD.org>

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
turned opt-in for stable branches depending on the consensus. You
can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
It is harmless to steal the knob as SSP symbols have been provided
by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
(sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
libc will be automatically downgraded to -fstack-protector because it
breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>


# dbdb679c 29-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longer
build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.


# e03efb02 25-Mar-2008 Ruslan Ermilov <ru@FreeBSD.org>

Compile libthr with warnings.


# a9b9744f 06-Feb-2008 Dag-Erling Smørgrav <des@FreeBSD.org>

Convert pthread.map to the format expected by version_gen.awk, and modify
the Makefile accordingly; libthr now explicitly uses libc's Versions.def.

MFC after: 2 weeks


# 8d0a4dab 17-Jan-2008 David Xu <davidxu@FreeBSD.org>

SYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthr
supports.


# 73ba600f 20-Nov-2007 David Xu <davidxu@FreeBSD.org>

Remove warning level and aliasing restrictions.


# 0aad0f22 19-Nov-2007 John Birrell <jb@FreeBSD.org>

These are the things that the tinderbox has problems with because it
doesn't use the default CFLAGS which contain -fno-strict-aliasing.

Until the code is cleaned up, just add -fno-strict-aliasing to the
CFLAGS of these for the tinderboxes' sake, allowing the rest of the
tree to have -Werror enabled again.


# 946367b8 09-Oct-2007 David E. O'Brien <obrien@FreeBSD.org>

Tweak the handling of "WITHOUT_LIBPTHREAD". Also remove the accidental
treatment of 'LIBKSE' as an "old style" knob.

Submitted by: ru
Approved by: re(kensmith)


# 948809b1 01-Oct-2007 Ruslan Ermilov <ru@FreeBSD.org>

Always install libpthread.* symlinks if at least one of
the threading libraries is built. This simplifies the
logic in makefiles that need to check if the pthreads
support is present. It also fixes a bug where we would
build a threading library that we shouldn't have built:
for example, building with WITHOUT_LIBTHR and the default
value of DEFAULT_THREADING_LIB (libthr) would mistakenly
build the libthr library, but not install it.

Approved by: re (kensmith)


# 44a31c2d 07-Jun-2007 David Xu <davidxu@FreeBSD.org>

Set warning level to 2.


# 419ecd5d 20-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Bump library versions in preparation for 7.0.

Ok'd by: kan


# 539e7a77 17-May-2007 Ruslan Ermilov <ru@FreeBSD.org>

Fix a logic bug I re-introduced in my patch I sent to Daniel
that would cause the selected shared threading library to be
overwritten with its 32-bit version on amd64.

PR: amd64/112509


# 683f4c0a 16-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Allow DEFAULT_THREAD_LIB to be set from /etc/src.conf.

Submitted by: ru


# 00fb440c 13-May-2007 Daniel Eischen <deischen@FreeBSD.org>

Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries. If necessary, this will happen later.


# 8af480ae 26-Nov-2006 Ruslan Ermilov <ru@FreeBSD.org>

- When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.
- Don't build ngctl(8) and cached(8) if threading libs aren't built.
- Fix various issues in a cached(8) makefile.


# 2b46c64c 22-Aug-2006 Ruslan Ermilov <ru@FreeBSD.org>

Remove alpha left-overs.


# 84e709f1 12-Apr-2006 Ruslan Ermilov <ru@FreeBSD.org>

Install shared libpthread library into /lib; needed by some
/sbin programs.


# 649814dd 26-Mar-2006 David Xu <davidxu@FreeBSD.org>

Comment out -g compiler option, found by 'FreeBSD Build Options Survey'.


# 5740a2b6 18-Mar-2006 Ruslan Ermilov <ru@FreeBSD.org>

Convert NO_PROFILE and NO_LIB32 to new style.


# 07a26315 10-Jan-2006 David Xu <davidxu@FreeBSD.org>

The thr_new sysscall was already in libc, don't generate it.


# 55ac4c35 27-Oct-2005 David Xu <davidxu@FreeBSD.org>

Link libthr to libpthread on Alpha and Sparc.


# a84020c2 22-Jul-2005 Ken Smith <kensmith@FreeBSD.org>

Bump the shared library version number of all libraries that have not
been bumped since RELENG_5.

Reviewed by: ru
Approved by: re (not needed for commit check but in principle...)


# 5335c6bc 11-Jun-2005 Robert Watson <rwatson@FreeBSD.org>

Add a stub libthr(3) man page to document what it is and why, as well as
to point at libmap.conf(5). This will help answer questions about what
and why it is, although not in great detail.

Approved by: re (scottl)
MFC after: 1 week
MFC note: When MFC'd, don't MFC mention of work not yet MFC'd.


# 80c9676e 22-Apr-2005 David Xu <davidxu@FreeBSD.org>

Use thr_new syscall to create a new thread, obscure context operations
is no longer needed.


# d245d9e1 11-Apr-2005 David Xu <davidxu@FreeBSD.org>

Add debugger event reporting support, current only TD_CREATE and TD_DEATH
events are reported.


# 02e98e49 06-Apr-2005 David Xu <davidxu@FreeBSD.org>

Remove debug symbol from installed library, one can always
use compiled version in libthr directory.


# a091d823 01-Apr-2005 David Xu <davidxu@FreeBSD.org>

Import my recent 1:1 threading working. some features improved includes:
1. fast simple type mutex.
2. __thread tls works.
3. asynchronous cancellation works ( using signal ).
4. thread synchronization is fully based on umtx, mainly, condition
variable and other synchronization objects were rewritten by using
umtx directly. those objects can be shared between processes via
shared memory, it has to change ABI which does not happen yet.
5. default stack size is increased to 1M on 32 bits platform, 2M for
64 bits platform.
As the result, some mysql super-smack benchmarks show performance is
improved massivly.

Okayed by: jeff, mtm, rwatson, scottl


# a35d8893 24-Oct-2004 Ruslan Ermilov <ru@FreeBSD.org>

For variables that are only checked with defined(), don't provide
any fake value.


# e6f19330 15-Aug-2004 Doug Rabson <dfr@FreeBSD.org>

Add rtld-elf to the include path for the rtld to pthread TLS interface.


# ed74e027 27-Sep-2003 Marcel Moolenaar <marcel@FreeBSD.org>

Relink libc_r.a, libc_r.so and libc_r_p.so from libthr to libkse.
On ia64, where there's no libc_r at all, libkse is now the default
thread library by virtue of these links.

The reasons for this change are:
1. libkse is slated to become the default thread library anyway,
2. active development and maintenance is only present for libkse,
3. GNOME and KDE, both in the process of being supported on ia64,
work better with KSE; even on ia64.


# 0b3cbc5c 01-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

Axe AINC.

Submitted by: bde


# 6128a735 27-Jun-2003 Marcel Moolenaar <marcel@FreeBSD.org>

Create compatibility links for libc_r on ia64 to prevent build-time
breakages. Note that runtime compatibility is not guaranteed. Future
changes to setjmp/longjmp in libc will break threaded applications
linked against libc_r.so.5 on ia64. We pull our "tier 2" card once
more...

Reviewed by: ru


# 7d9d7ca2 23-May-2003 Mike Makonnen <mtm@FreeBSD.org>

Make WARNS2 clean. The fixes mostly included:
o removed unused variables
o explicit inclusion of header files
o prototypes for externally defined functions

Approved by: re/blanket libthr


# 7a57e9ab 01-Apr-2003 Jeff Roberson <jeff@FreeBSD.org>

- Adjust the makefiles so we have a per architecture makefile.


# bb535300 31-Mar-2003 Jeff Roberson <jeff@FreeBSD.org>

- Add libthr but don't hook it up to the regular build yet. This is an
adaptation of libc_r for the thr system call interface. This is beta
quality code.