summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Rules.mak7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Rules.mak b/test/Rules.mak
index 203e6a188..a52de4f0a 100644
--- a/test/Rules.mak
+++ b/test/Rules.mak
@@ -13,9 +13,7 @@ TESTDIR=$(top_builddir)test/
-include $(top_builddir).config
-ifndef UCLIBC_LDSO
-UCLIBC_LDSO := ld-uClibc.so.0
-endif
+UCLIBC_LDSO ?= $(firstword $(wildcard $(top_builddir)lib/ld*))
#--------------------------------------------------------
# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
@@ -95,6 +93,9 @@ ifneq ($(strip $(HAVE_SHARED)),y)
HOST_LDFLAGS += -static
endif
LDFLAGS += -B$(top_builddir)lib -Wl,-rpath,$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
+ifeq ($(findstring -static,$(LDFLAGS)),)
+LDFLAGS += -Wl,--dynamic-linker,$(UCLIBC_LDSO)
+endif
# Filter output