Go to file
Konstantin Belousov 8495e8b1e9 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
2015-01-03 18:38:46 +00:00
bin symlink(7): Note that stat(1) does not follow symlinks by default. 2014-12-29 13:02:03 +00:00
cddl Use the correct state name for unavailable pools in zpool list 2014-12-31 04:11:29 +00:00
contrib Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
crypto Merge OpenSSL 1.0.1j. 2014-10-15 19:12:05 +00:00
etc Merge ^/head r274961 through r276301. 2014-12-27 14:58:52 +00:00
games Update factor for changes to types in primes, which is a dependency. 2014-09-27 10:57:34 +00:00
gnu Remove gnu/ info pages to unbreak the build with MK_GCC != no, etc 2015-01-02 20:34:55 +00:00
include Deorbit the IEEE-488/GPIB support. 2014-12-25 20:15:13 +00:00
kerberos5 Remove GNU texinfo from base along with all info pages. 2015-01-02 18:45:03 +00:00
lib Fix known issues which blow up the process after dlopen("libthr.so") 2015-01-03 18:38:46 +00:00
libexec Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
release Document file update. 2015-01-02 23:10:28 +00:00
rescue Add sleep(1) to /rescue. This adds 664 bytes to the binary on amd64 but 2014-12-03 01:34:24 +00:00
sbin Belatedly commit the patch for SA-14:21 to head. It was not committed to 2015-01-03 01:52:06 +00:00
secure Reduce overlinking 2014-11-25 22:25:13 +00:00
share Remove MK_INFO guards in bsd.info.mk per r276556 2015-01-02 22:55:30 +00:00
sys Add rtld private interface for dso to detect dynamic loading 2015-01-03 18:09:53 +00:00
tests Vendor import of file 5.22. 2015-01-02 20:49:47 +00:00
tools Fix all nits reported by mandoc -Tlint. 2015-01-03 05:39:01 +00:00
usr.bin Add Makefile for elftoolchain readelf(1) 2015-01-02 22:26:54 +00:00
usr.sbin Add a manual page for phttpget(8). 2015-01-02 21:02:41 +00:00
.arcconfig Update the URL to the phabricator instance. 2014-08-14 16:25:43 +00:00
.arclint arc: add linting for python files 2014-06-02 00:21:42 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS
MAINTAINERS Remove cokane@ from MAINTAINERS for 3dfx(4)/tdfx(4) because their email 2014-11-25 05:25:12 +00:00
Makefile Revert r271159, Mis-patched the tree. 2014-09-05 14:35:34 +00:00
Makefile.inc1 Remove GNU texinfo from base along with all info pages. 2015-01-02 18:45:03 +00:00
ObsoleteFiles.inc Fix the date of texinfo removal 2015-01-02 18:45:48 +00:00
README Vendor import of file 5.22. 2015-01-02 20:49:47 +00:00
UPDATING Remove GNU texinfo from base along with all info pages. 2015-01-02 18:45:03 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html