Go to file
Siddhesh Poyarekar 67e58f3941 Add framework for tunables
The tunables framework allows us to uniformly manage and expose global
variables inside glibc as switches to users.  tunables/README has
instructions for glibc developers to add new tunables.

Tunables support can be enabled by passing the --enable-tunables
configure flag to the configure script.  This patch only adds a
framework and does not pose any limitations on how tunable values are
read from the user.  It also adds environment variables used in malloc
behaviour tweaking to the tunables framework as a PoC of the
compatibility interface.

	* manual/install.texi: Add --enable-tunables option.
	* INSTALL: Regenerate.
	* README.tunables: New file.
	* Makeconfig (CPPFLAGS): Define TOP_NAMESPACE.
	(before-compile): Generate dl-tunable-list.h early.
	* config.h.in: Add HAVE_TUNABLES.
	* config.make.in: Add have-tunables.
	* configure.ac: Add --enable-tunables option.
	* configure: Regenerate.
	* csu/init-first.c (__libc_init_first): Move
	__libc_init_secure earlier...
	* csu/init-first.c (LIBC_START_MAIN):... to here.
	Include dl-tunables.h, libc-internal.h.
	(LIBC_START_MAIN) [!SHARED]: Initialize tunables for static
	binaries.
	* elf/Makefile (dl-routines): Add dl-tunables.
	* elf/Versions (ld): Add __tunable_set_val to GLIBC_PRIVATE
	namespace.
	* elf/dl-support (_dl_nondynamic_init): Unset MALLOC_CHECK_
	only when !HAVE_TUNABLES.
	* elf/rtld.c (process_envvars): Likewise.
	* elf/dl-sysdep.c [HAVE_TUNABLES]: Include dl-tunables.h
	(_dl_sysdep_start): Call __tunables_init.
	* elf/dl-tunable-types.h: New file.
	* elf/dl-tunables.c: New file.
	* elf/dl-tunables.h: New file.
	* elf/dl-tunables.list: New file.
	* malloc/tst-malloc-usable-static.c: New test case.
	* malloc/Makefile (tests-static): Add it.
	* malloc/arena.c [HAVE_TUNABLES]: Include dl-tunables.h.
	Define TUNABLE_NAMESPACE.
	(DL_TUNABLE_CALLBACK (set_mallopt_check)): New function.
	(DL_TUNABLE_CALLBACK_FNDECL): New macro.  Use it to define
	callback functions.
	(ptmalloc_init): Set tunable values.
	* scripts/gen-tunables.awk: New file.
	* sysdeps/mach/hurd/dl-sysdep.c: Include dl-tunables.h.
	(_dl_sysdep_start): Call __tunables_init.
2016-12-31 23:49:24 +05:30
argp Installed-header hygiene (BZ#20366): Simple self-contained fixes. 2016-09-23 08:43:55 -04:00
assert assert.h: allow gcc to detect assert(a = 1) errors 2016-12-18 01:30:51 -08:00
benchtests Add configure check for python program 2016-12-22 23:07:52 +05:30
bits Define __intmax_t, __uintmax_t in bits/types.h. 2016-12-30 13:41:40 +00:00
catgets
conform Enable linknamespace testing for libdl and libcrypt. 2016-11-16 22:47:57 +00:00
crypt New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
csu Add framework for tunables 2016-12-31 23:49:24 +05:30
ctype
debug PLT avoidance for __stack_chk_fail [BZ #7065] 2016-12-26 10:11:05 +01:00
dirent support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
dlfcn support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
elf Add framework for tunables 2016-12-31 23:49:24 +05:30
gmon Installed-header hygiene (BZ#20366): obsolete BSD u_* types. 2016-09-23 08:43:56 -04:00
gnulib
grp
gshadow
hesiod
hurd hurd: fix using hurd.h in C++ programs 2016-12-04 23:18:32 +01:00
iconv gconv.h: fix build with GCC 7 2016-11-06 21:33:10 +01:00
iconvdata gconv: Adjust GBK to support the Euro sign 2016-11-29 18:35:21 +01:00
include resolv: Turn historic name lookup functions into compat symbols 2016-12-30 18:43:04 +01:00
inet inet: Make IN6_IS_ADDR_UNSPECIFIED etc. usable with POSIX [BZ #16421] 2016-12-09 11:27:44 +01:00
intl hurd: fix pathconf visibility 2016-09-18 23:45:12 +02:00
io support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
libidn
libio support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
locale Bug 20729: Include libc-internal.h where required. 2016-10-31 16:46:57 -04:00
localedata Revert "Fix ChangeLog typo" 2016-12-31 08:53:42 +01:00
login Drop explicit stack-protection of pieces of the system [BZ #7065] 2016-12-26 10:11:05 +01:00
mach Fix old-style function definition 2016-09-20 23:10:51 +02:00
malloc Add framework for tunables 2016-12-31 23:49:24 +05:30
manual Add framework for tunables 2016-12-31 23:49:24 +05:30
math Add fromfp functions. 2016-12-31 00:40:59 +00:00
mathvec
misc Disable stack protector in early static initialization [BZ #7065] 2016-12-26 10:08:45 +01:00
nis resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582] 2016-12-31 18:55:14 +01:00
nptl New condvar implementation that provides stronger ordering guarantees. 2016-12-31 14:56:47 +01:00
nptl_db Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
nscd resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582] 2016-12-31 18:55:14 +01:00
nss resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582] 2016-12-31 18:55:14 +01:00
po Update PO files. 2016-08-04 11:41:27 -04:00
posix getentropy: Declare it in <unistd.h> for __USE_MISC [BZ #17252] 2016-12-31 15:11:29 +01:00
pwd
resolv resolv: Deprecate RES_BLAST 2016-12-31 19:08:39 +01:00
resource
rt support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
scripts Add framework for tunables 2016-12-31 23:49:24 +05:30
setjmp
shadow
signal Do not stack-protect sigreturn stubs [BZ #7065] 2016-12-26 10:11:06 +01:00
socket Installed-header hygiene (BZ#20366): conditionally defined structures. 2016-09-23 08:43:56 -04:00
soft-fp [soft-fp] Add support for various half-precision conversion routines. 2016-09-21 21:02:54 +00:00
stdio-common Fix crypt snprintf namespace (bug 20829). 2016-11-16 22:46:48 +00:00
stdlib Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
streams
string Fix x86_64 memchr for large input sizes 2016-12-27 10:50:41 -02:00
sunrpc sunrpc: Always obtain AF_INET addresses from NSS [BZ #20964] 2016-12-27 16:44:15 +01:00
support resolv: Add beginnings of a libresolv test suite 2016-12-31 18:52:32 +01:00
sysdeps Add framework for tunables 2016-12-31 23:49:24 +05:30
sysvipc Add SYSV shared memory test 2016-12-28 20:32:02 -02:00
termios
time support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
timezone
wcsmbs Add tst-wcstod-round 2016-08-19 11:17:07 -05:00
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4 Work even with compilers which enable -fstack-protector by default [BZ #7065] 2016-12-26 10:10:58 +01:00
BUGS
ChangeLog Add framework for tunables 2016-12-31 23:49:24 +05:30
ChangeLog.1
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8 ChangeLog: change Winblowz to Windows 2016-08-10 00:49:28 +08:00
ChangeLog.9
ChangeLog.10
ChangeLog.11 ChangeLog: change Winblowz to Windows 2016-08-10 00:49:28 +08:00
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.17
ChangeLog.old-ports
ChangeLog.old-ports-aarch64
ChangeLog.old-ports-aix
ChangeLog.old-ports-alpha
ChangeLog.old-ports-am33
ChangeLog.old-ports-arm
ChangeLog.old-ports-cris
ChangeLog.old-ports-hppa
ChangeLog.old-ports-ia64
ChangeLog.old-ports-linux-generic
ChangeLog.old-ports-m68k
ChangeLog.old-ports-microblaze
ChangeLog.old-ports-mips
ChangeLog.old-ports-powerpc
ChangeLog.old-ports-tile
config.h.in Add framework for tunables 2016-12-31 23:49:24 +05:30
config.make.in Add framework for tunables 2016-12-31 23:49:24 +05:30
configure Add framework for tunables 2016-12-31 23:49:24 +05:30
configure.ac Add framework for tunables 2016-12-31 23:49:24 +05:30
CONFORMANCE
COPYING
COPYING.LIB
cppflags-iterator.mk
extra-lib.mk support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
extra-modules.mk
gen-locales.mk
INSTALL Add framework for tunables 2016-12-31 23:49:24 +05:30
libc-abis
LICENSES
Makeconfig Add framework for tunables 2016-12-31 23:49:24 +05:30
Makefile Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
Makefile.in
Makerules Install libm.a as linker script (bug 20539). 2016-12-08 17:25:59 +03:00
NAMESPACE
NEWS resolv: Deprecate RES_BLAST 2016-12-31 19:08:39 +01:00
o-iterator.mk
README
README.pretty-printers Fix failing pretty printer tests when CPPFLAGS has optimizations. 2016-12-23 13:46:56 -05:00
README.tunables Add framework for tunables 2016-12-31 23:49:24 +05:30
Rules Fix pretty printer tests for run-built-tests == no 2016-12-30 09:42:38 +05:30
shlib-versions
test-skeleton.c support: Introduce new subdirectory for test infrastructure 2016-12-09 08:18:27 +01:00
version.h
WUR-REPORT

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.  The current
GNU/Hurd support requires out-of-tree patches that will eventually be
incorporated into an official GNU C Library release.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later on all architectures except
i[4567]86 and x86_64, where Linux kernel version 2.6.32 or later
suffices.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arm-*-linux-gnueabi
	hppa-*-linux-gnu	Not currently functional without patches.
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu
	tilegx-*-linux-gnu
	tilepro-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.