summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2001-07-17 09:44:30 +0000
committerDavid Schleef <ds@schleef.org>2001-07-17 09:44:30 +0000
commitebfd672d318b82b8bf1223ab0600ffc017c891a4 (patch)
tree0958d08f6fce6b31029f9a6a9ee6b2c195f797d7
parentea9de29581fb04f5b85065542faf4ce42ee41808 (diff)
Better rule for locating dynamic linker
-rw-r--r--Rules.mak9
1 files changed, 3 insertions, 6 deletions
diff --git a/Rules.mak b/Rules.mak
index 61256dbcd..e518f4f3c 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -84,11 +84,8 @@ endif
LDSO_PRESENT=$(strip $(shell cd $(TOPDIR)/ldso/d-link; ls -d $(TARGET_ARCH) 2>/dev/null))
# NOTE: This may need to be modified for your system
-ifeq ($(NATIVE_ARCH), $(TARGET_ARCH))
- SYSTEM_LDSO=$(strip $(shell ldd `which $(CC)` | sed -ne /ld/p | sed -e s/\ =.*//g))
-else
- SYSTEM_LDSO=/lib/ld-linux.so.2
-endif
+SYSTEM_LDSO=$(shell for each in `$(CC) -print-search-dirs|grep ^libraries|sed -e 's/^libraries: //' -e 's/:/ /g'`;do ls $$each/ld.so.* 2>/dev/null;done)
+#SYSTEM_LDSO=/lib/ld-linux.so.2
ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
LDSO=$(TOPDIR)lib/$(UCLIBC_LDSO)
@@ -96,7 +93,7 @@ ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
BUILD_DYNAMIC_LINKER=$(shell cd $(TOPDIR)lib; pwd)/$(UCLIBC_LDSO)
else
LDSO=$(SYSTEM_LDSO)
- DYNAMIC_LINKER=$(SYSTEM_LDSO)
+ DYNAMIC_LINKER=/lib/$(notdir $(SYSTEM_LDSO))
BUILD_DYNAMIC_LINKER=$(shell cd $(TOPDIR)lib; pwd)/$(UCLIBC_LDSO)
endif