glibc/malloc
Joseph Myers 79520f4bd6 Use existing makefile variables for dependencies on glibc libraries.
glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).

In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree.  This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles).  (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so.  But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)

To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files.  This patch just deals with straightforward cases
where such variables already exist.

It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries.  I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).

Tested x86_64.

	* benchtests/Makefile
	($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
	not $(common-objpfx)math/libm.so.
	($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
	$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
	* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	($(objpfx)tst-audit8): Depend on $(libm), not
	$(common-objpfx)math/libm.so.
	* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
	not $(common-objpfx)dlfcn/libdl.so.
	* math/Makefile
	($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
	Depend on $(libm), not $(objpfx)libm.so.  Do not condition on
	[$(build-shared) = yes].
	($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
	$(common-objpfx)nptl/libpthread.so.
	* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
	$(common-objpfx)math/libm.so$(libm.so-version) or
	$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
	* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
	$(common-objpfx)dlfcn/libdl.so.
	* setjmp/Makefile (link-libm): Remove variable.
	($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
	* stdio-common/Makefile (link-libm): Remove variable.
	($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
	* stdlib/Makefile (link-libm): Remove variable.
	($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
	($(objpfx)tst-strtod-round): Likewise.
	($(objpfx)tst-tininess): Likewise.
	($(objpfx)tst-strtod-underflow): Likewise.
	($(objpfx)tst-strtod6): Likewise.
	($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
	$(libdl), not $(common-objpfx)nptl/libpthread.so and
	$(common-objpfx)dlfcn/libdl.so.
2014-05-16 21:38:08 +00:00
..
arena.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Depend Update. 1999-10-04 22:59:43 +00:00
hooks.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
Makefile Use existing makefile variables for dependencies on glibc libraries. 2014-05-16 21:38:08 +00:00
malloc.c malloc: Fix MALLOC_DEBUG -Wundef warning 2014-04-11 09:54:18 +01:00
malloc.h Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mallocbug.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mcheck-init.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mcheck.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mcheck.h Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
memusage.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
memusage.sh Update remaining copyright dates 2014-01-01 22:02:55 +10:00
memusagestat.c Fix gettext call formatting 2014-01-05 17:39:45 +10:00
morecore.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mtrace.c malloc/mtrace.c: Cosmetic cleanup. 2014-02-11 10:02:57 +00:00
mtrace.pl Update remaining copyright dates 2014-01-01 22:02:55 +10:00
obstack.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
obstack.h Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
set-freeres.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
thread-freeres.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-calloc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-malloc-usable.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-malloc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-mallocfork.c * malloc/tst-mallocfork.c (do_test): Make sure sa_flags is 2005-12-06 00:50:15 +00:00
tst-mallocstate.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
tst-mallopt.c malloc: Add mallopt test. 2014-05-12 12:48:41 +01:00
tst-mcheck.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-memalign.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-mtrace.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
tst-mtrace.sh Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-obstack.c Update. 2000-11-20 17:40:29 +00:00
tst-posix_memalign.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-pvalloc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-realloc.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
tst-trim1.c * malloc/tst-trim1.c: New file. 2007-12-16 22:57:57 +00:00
tst-valloc.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Versions Implement aligned_alloc 2012-01-01 07:17:21 -05:00