benchtests: Link against objects in build directory

Message ID 20140415070305.GA8521@spoyarek.pnq.redhat.com
State Superseded
Headers

Commit Message

Siddhesh Poyarekar April 15, 2014, 7:03 a.m. UTC
  Using -lm and -lpthread results in the shared objects in the system
being used to link against.  This happened to work for libm because
there haven't been any changes to the libm ABI recently that could
break the existing benchmarks.  This doesn't work for the pthread
benchmarks though.  So to fix this, use the shared object directly
using $(objpfx)$(..) instead.

Tested on x6_64.

Siddhesh

	* benchtests/Makefile: Link against libpthread and libm from
	build directory.

---
 benchtests/Makefile | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)
  

Comments

Andreas Schwab April 15, 2014, 7:47 a.m. UTC | #1
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.

Andreas.
  

Patch

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 4989794..b4d006c 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -40,27 +40,27 @@  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
+LDLIBS-bench-acos = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-acosh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-asin = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-asinh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-atan = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-atanh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-cos = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-cosh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-exp = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-exp2 = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-log = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-log2 = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-pow = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-pthread_once = $(objpfx)$(..)nptl/libpthread.so
+LDLIBS-bench-rint = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-sin = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-sinh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-sqrt = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-tan = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-tanh = $(objpfx)$(..)math/libm.so
+LDLIBS-bench-sincos = $(objpfx)$(..)math/libm.so