@@ -44,9 +44,9 @@ benchset := $(string-bench-all) $(stdlib-bench)
CFLAGS-bench-ffs.c += -fno-builtin
CFLAGS-bench-ffsll.c += -fno-builtin
-$(addprefix $(objpfx)bench-,$(bench-math)): $(common-objpfx)math/libm.so
+$(addprefix $(objpfx)bench-,$(bench-math)): $(libm)
$(addprefix $(objpfx)bench-,$(bench-pthread)): \
- $(common-objpfx)nptl/libpthread.so
+ $(shared-thread-library)
@@ -653,7 +653,7 @@ $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
$(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
-$(objpfx)noload: $(objpfx)testobj1.so $(common-objpfx)dlfcn/libdl.so
+$(objpfx)noload: $(objpfx)testobj1.so $(libdl)
LDFLAGS-noload = -rdynamic $(no-as-needed)
$(objpfx)noload.out: $(objpfx)testobj5.so
@@ -1011,7 +1011,7 @@ $(objpfx)tst-audit9: $(libdl)
$(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so
tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so
-$(objpfx)tst-audit8: $(common-objpfx)math/libm.so
+$(objpfx)tst-audit8: $(libm)
$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
@@ -148,7 +148,7 @@ $(objpfx)memusage: memusage.sh
# The implementation uses `dlsym'
-$(objpfx)libmemusage.so: $(common-objpfx)dlfcn/libdl.so
+$(objpfx)libmemusage.so: $(libdl)
# Extra dependencies
$(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c
@@ -219,12 +219,8 @@ $(objpfx)libieee.a: $(objpfx)ieee-math.o
$(patsubst %/,cd % &&,$(objpfx)) \
$(LN_S) $(<F) $(@F)
-ifeq ($(build-shared),yes)
-$(addprefix $(objpfx),$(filter-out $(tests-static),$(tests))): $(objpfx)libm.so$(libm.so-version)
+$(addprefix $(objpfx),$(filter-out $(tests-static),$(tests))): $(libm)
$(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a
-else
-$(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
-endif
gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
@@ -233,4 +229,4 @@ gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
$(objpfx)atest-exp: $(gmp-objs)
$(objpfx)atest-sincos: $(gmp-objs)
$(objpfx)atest-exp2: $(gmp-objs)
-$(objpfx)test-fenv-tls: $(common-objpfx)nptl/libpthread.so
+$(objpfx)test-fenv-tls: $(shared-thread-library)
@@ -102,11 +102,7 @@ include ../Rules
$(objpfx)libg.a: $(dep-dummy-lib); $(make-dummy-lib)
-ifeq ($(build-shared),yes)
-$(objpfx)tst-tsearch: $(common-objpfx)math/libm.so$(libm.so-version)
-else
-$(objpfx)tst-tsearch: $(common-objpfx)math/libm.a
-endif
+$(objpfx)tst-tsearch: $(libm)
tst-error1-ENV = MALLOC_TRACE=$(objpfx)tst-error1.mtrace
tst-error1-ARGS = $(objpfx)tst-error1.out
@@ -530,7 +530,7 @@ $(addprefix $(objpfx), \
$(tests-nolibpthread), \
$(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \
$(objpfx)libpthread_nonshared.a
-$(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
+$(objpfx)tst-unload: $(libdl)
# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
# since otherwise libpthread.so comes before libc.so when linking.
$(addprefix $(objpfx), $(tests-reverse)): \
@@ -33,9 +33,4 @@ tests := tst-setjmp jmpbug bug269-setjmp tst-setjmp-fp \
include ../Rules
-ifeq ($(build-shared),yes)
-link-libm = $(common-objpfx)math/libm.so
-else
-link-libm = $(common-objpfx)math/libm.a
-endif
-$(objpfx)tst-setjmp-fp: $(link-libm)
+$(objpfx)tst-setjmp-fp: $(libm)
@@ -137,9 +137,4 @@ $(objpfx)tst-setvbuf1-cmp.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1.out
cmp $^ > $@; \
$(evaluate-test)
-ifeq ($(build-shared),yes)
-link-libm = $(common-objpfx)math/libm.so
-else
-link-libm = $(common-objpfx)math/libm.a
-endif
-$(objpfx)tst-printf-round: $(link-libm)
+$(objpfx)tst-printf-round: $(libm)
@@ -150,19 +150,14 @@ $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
$(build-module)
CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
-ifeq ($(build-shared),yes)
-link-libm = $(common-objpfx)math/libm.so
-else
-link-libm = $(common-objpfx)math/libm.a
-endif
-$(objpfx)bug-getcontext: $(link-libm)
-$(objpfx)tst-strtod-round: $(link-libm)
-$(objpfx)tst-tininess: $(link-libm)
-$(objpfx)tst-strtod-underflow: $(link-libm)
-$(objpfx)tst-strtod6: $(link-libm)
+$(objpfx)bug-getcontext: $(libm)
+$(objpfx)tst-strtod-round: $(libm)
+$(objpfx)tst-tininess: $(libm)
+$(objpfx)tst-strtod-underflow: $(libm)
+$(objpfx)tst-strtod6: $(libm)
tst-tls-atexit-lib.so-no-z-defs = yes
-$(objpfx)tst-tls-atexit: $(common-objpfx)nptl/libpthread.so \
- $(common-objpfx)dlfcn/libdl.so
+$(objpfx)tst-tls-atexit: $(shared-thread-library) \
+ $(libdl)
$(objpfx)tst-tls-atexit.out: $(objpfx)tst-tls-atexit-lib.so