Browse Source

Move libdl and udate build method a bit
-Erik

Eric Andersen 23 years ago
parent
commit
beef72b5c0
6 changed files with 19 additions and 24 deletions
  1. 3 2
      ldso/Makefile
  2. 1 1
      ldso/ldso/.cvsignore
  3. 4 12
      ldso/ldso/Makefile
  4. 1 1
      ldso/ldso/dl-hash.c
  5. 1 1
      ldso/ldso/hash.c
  6. 9 7
      ldso/libdl/Makefile

+ 3 - 2
ldso/Makefile

@@ -2,7 +2,7 @@ TOPDIR=../
 include $(TOPDIR)Rules.mak
 include Config.mk
 
-SUBDIRS = util d-link # man
+SUBDIRS = util d-link libdl # man
 TARGETDIR=/usr/$(TARGET_ARCH)-linux-uclibc
 
 
@@ -13,7 +13,8 @@ all:
 install: all
 	mkdir -p $(TARGETDIR)/etc
 	mkdir -p $(TARGETDIR)/lib
-	cp -a ./d-link/ld-linux-uclibc.so.1 ./d-link/libdl/libdl.so.1 $(TARGETDIR)/lib 
+	cp -a ./d-link/$(DLINKER).$(LDSO_VMAJOR) \
+		./libdl/$(LIBDL).$(LDSO_VMAJOR) $(TARGETDIR)/lib 
 	./util/ldconfig
 
 clean:

+ 1 - 1
ldso/ldso/.cvsignore

@@ -1,2 +1,2 @@
-ld-linux-uclibc.so.1
+ld-linux-uclibc.so.0
 

+ 4 - 12
ldso/ldso/Makefile

@@ -2,7 +2,7 @@ TOPDIR=../../
 include $(TOPDIR)Rules.mak
 include $(TOPDIR)/ld.so-1/Config.mk
 
-DIRS = $(TARGET_ARCH) libdl
+DIRS = $(TARGET_ARCH)
 
 CFLAGS += -DNO_UNDERSCORE -DVERBOSE_DLINKER
 CFLAGS += -DUSE_CACHE -fPIC -D__PIC__ #-funroll-loops
@@ -11,29 +11,21 @@ CSRC= boot1.c hash.c readelflib1.c vsprintf.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
-DLINKER = ld-linux-uclibc.so
-
 ELF_LDFLAGS=--shared # using GNU ld
 
-ifneq ($(DIRS),)
-lib realclean clean::
-	@set -e; for i in $(DIRS); do \
-	  echo making $@ in $$i; \
-	  $(MAKE) -C $$i $@; \
-	done;
-endif
+all: lib
 
 lib:: $(OBJS)
 	$(LD) -e _dl_boot $(ELF_LDFLAGS) -o $(DLINKER).$(LDSO_VMAJOR) \
 	  -soname $(DLINKER).$(LDSO_VMAJOR) *.o
 
 $(COBJS): %.o : %.c
-	$(CC) -I. -I./$(TARGET_ARCH) $(CFLAGS) -c $< -o $@
+	$(CC) -I. -I./$(TARGET_ARCH) -I../libdl $(CFLAGS) -c $< -o $@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 realclean::
 	$(RM) -f .depend $(DLINKER) core *.o *.a *.s *.i tmp_make foo *~
 
 clean::
-	$(RM) -f $(DLINKER) core *.o *.a *.s *.i tmp_make foo *~
+	$(RM) -f $(DLINKER)* core *.o *.a *.s *.i tmp_make foo *~
 

+ 1 - 1
ldso/ldso/dl-hash.c

@@ -25,7 +25,7 @@
 #include <linux/unistd.h>
 #include <linux/elf.h>
 
-#include "libdl/dlfcn.h"
+#include "dlfcn.h"
 #include "hash.h"
 #include "linuxelf.h"
 #include "syscall.h"

+ 1 - 1
ldso/ldso/hash.c

@@ -25,7 +25,7 @@
 #include <linux/unistd.h>
 #include <linux/elf.h>
 
-#include "libdl/dlfcn.h"
+#include "dlfcn.h"
 #include "hash.h"
 #include "linuxelf.h"
 #include "syscall.h"

+ 9 - 7
ldso/libdl/Makefile

@@ -1,26 +1,27 @@
-TOPDIR=../../../
+TOPDIR=../../
 include $(TOPDIR)Rules.mak
 include $(TOPDIR)/ld.so-1/Config.mk
 
 CFLAGS += -DNO_UNDERSCORE -DVERBOSE_DLINKER -DUSE_CACHE
 CFLAGS += #-fPIC -D__PIC__ #-funroll-loops
 
-LIBDL = libdl.so
-
 CSRC= dlib.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 OBJS=$(COBJS)
 
+all: lib
+
 $(COBJS): %.o : %.c
-	$(CC) -I.. -I../$(TARGET_ARCH) $(CFLAGS) -c $< -o $@
+	$(CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(CFLAGS) -c $< -o $@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 ELF_LDFLAGS=--shared -nostartfiles -nostdlib # using GNU ld
 #ELF_LDFLAGS=-G  # with SVr4 ld
 
 lib:: $(OBJS)
-	$(LD) $(ELF_LDFLAGS) -o $(LIBDL).$(LDSO_VMAJOR) \
-		 -soname $(LIBDL).$(LDSO_VMAJOR) *.o -lc
+	$(CC) $(ELF_LDFLAGS) \
+		-o $(LIBDL).$(LDSO_VMAJOR) -Wl,-soname -Wl,$(LIBDL).$(LDSO_VMAJOR) \
+		*.o $(TOPDIR)uClibc-0.95.so
 
 obj: $(OBJS)
 
@@ -28,4 +29,5 @@ realclean::
 	$(RM) -f .depend $(LIBDL) core *.o *.a *.s *.i tmp_make foo *~
 
 clean::
-	$(RM) -f $(LIBDL) core *.o *.a *.s *.i tmp_make foo *~
+	$(RM) -f $(LIBDL)* core *.o *.a *.s *.i tmp_make foo *~
+