benchtests: Link against objects in build directory

Message ID 20140415084944.GM11072@spoyarek.pnq.redhat.com
State Committed
Headers

Commit Message

Siddhesh Poyarekar April 15, 2014, 8:49 a.m. UTC
  On Tue, Apr 15, 2014 at 09:47:33AM +0200, Andreas Schwab wrote:
> Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> 
> > +LDLIBS-bench-acos = $(objpfx)$(..)math/libm.so
> 
> This should be $(common-objpfx)math/libm.so or
> $(common-objpfx)math/libm.a, depending on $(build-shared).  Also, you
> shouldn't use LDLIBS for built libraries, instead add it to the
> dependency list of the binaries, where $(+link) will pick it up.
> 
> See the use of link-libm in stdlib/Makefile, for example.

Thanks, here's an updated patch.  How does this look?

Siddhesh

	* benchtests/Makefile: Depend on libraries in build directory.
	(bench-math): Separate out math tests.
	(bench-pthread): Separate out pthread tests.
	(bench): Include math and pthread tests.
  

Comments

Andreas Schwab April 15, 2014, 8:56 a.m. UTC | #1
Looks better.

Andreas.
  

Patch

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 4989794..a0954cd 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -22,8 +22,12 @@ 
 subdir := benchtests
 
 include ../Makeconfig
-bench := acos acosh asin asinh atan atanh cos cosh exp exp2 ffs ffsll \
-	log log2 modf pow pthread_once rint sin sincos sinh sqrt tan tanh
+bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 ffs ffsll \
+	      log log2 modf pow rint sin sincos sinh sqrt tan tanh
+
+bench-pthread := pthread_once
+
+bench := $(bench-math) $(bench-pthread)
 
 # String function benchmarks.
 string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \
@@ -40,27 +44,9 @@  benchset := $(string-bench-all) $(stdlib-bench)
 CFLAGS-bench-ffs.c += -fno-builtin
 CFLAGS-bench-ffsll.c += -fno-builtin
 
-LDLIBS-bench-acos = -lm
-LDLIBS-bench-acosh = -lm
-LDLIBS-bench-asin = -lm
-LDLIBS-bench-asinh = -lm
-LDLIBS-bench-atan = -lm
-LDLIBS-bench-atanh = -lm
-LDLIBS-bench-cos = -lm
-LDLIBS-bench-cosh = -lm
-LDLIBS-bench-exp = -lm
-LDLIBS-bench-exp2 = -lm
-LDLIBS-bench-log = -lm
-LDLIBS-bench-log2 = -lm
-LDLIBS-bench-pow = -lm
-LDLIBS-bench-pthread_once = -lpthread
-LDLIBS-bench-rint = -lm
-LDLIBS-bench-sin = -lm
-LDLIBS-bench-sinh = -lm
-LDLIBS-bench-sqrt = -lm
-LDLIBS-bench-tan = -lm
-LDLIBS-bench-tanh = -lm
-LDLIBS-bench-sincos = -lm
+$(addprefix $(objpfx)bench-,$(bench-math)): $(common-objpfx)math/libm.so
+$(addprefix $(objpfx)bench-,$(bench-pthread)): \
+	$(common-objpfx)nptl/libpthread.so