Browse Source

Fix up a few little problems

Eric Andersen 23 years ago
parent
commit
0ad1b4fdd3
4 changed files with 14 additions and 13 deletions
  1. 5 0
      Makefile
  2. 4 1
      Rules.mak
  3. 2 9
      extra/gcc-uClibc/Makefile
  4. 3 3
      libc/Makefile

+ 5 - 0
Makefile

@@ -140,6 +140,11 @@ install: install_runtime install_dev
 install_runtime:
 	install -d $(INSTALL_DIR)/lib
 	cp -fa lib/* $(INSTALL_DIR)/lib;
+#ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
+	ln -sf $(INSTALL_DIR)/lib/$(UCLIBC_LDSO) /lib/$(UCLIBC_LDSO);
+	install -d $(INSTALL_DIR)/etc
+	ldso/util/ldconfig
+#endif
 
 # Installs development library and headers
 # This is done with the assumption that it can blow away anything

+ 4 - 1
Rules.mak

@@ -70,16 +70,19 @@ 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=$(shell ldd `which $(CC)` | sed -ne /ld/p | sed -e s/\ =.*//g)
+	SYSTEM_LDSO=$(strip $(shell ldd `which $(CC)` | sed -ne /ld/p | sed -e s/\ =.*//g))
 else
 	SYSTEM_LDSO=/lib/ld-linux.so.2
 endif
 
 ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
 	LDSO=$(TOPDIR)lib/$(UCLIBC_LDSO)
+	DYNAMIC_LINKER=/lib/$(UCLIBC_LDSO)
 else
 	LDSO=$(SYSTEM_LDSO)
+	DYNAMIC_LINKER=$(SYSTEM_LDSO)
 endif
 
 

+ 2 - 9
extra/gcc-uClibc/Makefile

@@ -1,14 +1,6 @@
 TOPDIR = ../../
 include $(TOPDIR)Rules.mak
 
-# NOTE: This may need to be modified for your system
-ifeq ($(LDSO_PRESENT), $(TARGET_ARCH))
-	DYNAMIC_LINKER=$(INSTALL_DIR)/lib/$(UCLIBC_LDSO)
-else
-	DYNAMIC_LINKER=$(SYSTEM_LDSO)
-endif
-
-
 UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
 GCC_BIN = $(shell which $(CC))
 LD_BIN = $(shell which $(LD))
@@ -33,7 +25,8 @@ gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
 ld-uClibc:
 	@echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
 	@echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
-	@echo "$(LD_BIN) -L- -L $(INSTALL_DIR)/lib -L$(UCLIBC_DIR) \$$@" >> $(TARGET_ARCH)-uclibc-ld
+	@echo "$(LD_BIN) -L- -L$(INSTALL_DIR)/lib -L$(INSTALL_DIR)/usr/lib "\
+		"-L$(UCLIBC_DIR) \$$@" >> $(TARGET_ARCH)-uclibc-ld
 	chmod a+x $(TARGET_ARCH)-uclibc-ld
 
 install: all

+ 3 - 3
libc/Makefile

@@ -46,13 +46,13 @@ shared: $(TOPDIR)lib/$(LIBNAME)
 	@(cd tmp; CC=$(CC) /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh)
 	if [ -s ./tmp/libgcc-need.a ] ; then \
 		$(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \
-		    -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \
+		    -Wl,-soname=$(SHARED_MAJORNAME) -Wl,--whole-archive \
 		    ./$(LIBNAME) ./tmp/libgcc-need.a \
-		    $(LDSO) ; \
+		    $(LDSO) -Wl,--dynamic-linker,$(DYNAMIC_LINKER); \
 	else \
 		$(CC) -g $(LDFLAGS) -shared -o $(SHARED_FULLNAME) \
 		    -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \
-		    ./$(LIBNAME) $(LDSO) ; \
+		    ./$(LIBNAME) $(LDSO)  -Wl,-dynamic-linker=$(DYNAMIC_LINKER); \
 	fi
 	@rm -rf tmp
 	install -d $(TOPDIR)lib