diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-05-12 06:19:18 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-05-12 06:19:18 +0000 |
commit | f0da4aa1d854ca9c2a0e652dcb1d81bbf4d971f4 (patch) | |
tree | 39dd87100094d48dbc7e8557f26d5c02d331606f /ldso | |
parent | 249cb00d9f655778aa8a4519ee3e610a904d694d (diff) |
Ok, this should finish off my massive ro-organization. The source
tree is less messy now (which helps), all libraries are placed into
uClibc/lib when compiling, all libraries now use a consistant mechanism
for being built, all libraries use a consistant naming scheme where the
lib name includes the uClibc version number, which makes ldconfig
happy and willing to work with us.
-Erik
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/Makefile | 18 | ||||
-rw-r--r-- | ldso/Rules.mak | 1 | ||||
-rw-r--r-- | ldso/ldso/Makefile | 49 | ||||
-rw-r--r-- | ldso/libdl/Makefile | 72 | ||||
-rw-r--r-- | ldso/util/Makefile | 4 |
5 files changed, 96 insertions, 48 deletions
diff --git a/ldso/Makefile b/ldso/Makefile index d7af33f89..dab0025f4 100644 --- a/ldso/Makefile +++ b/ldso/Makefile @@ -3,22 +3,14 @@ include Rules.mak SUBDIRS = util d-link libdl # man - all: - @if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ - set -e ; for d in $(SUBDIRS) ; do $(MAKE) -C $$d ; done \ - fi; - @if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ - install -d $(TOPDIR)lib ; \ - install -m 755 $(TOPDIR)ld.so-1/d-link/$(UCLIBC_LDSO) $(TOPDIR)lib/ld-linux-uclibc.so ; \ - install -m 644 $(TOPDIR)ld.so-1/libdl/$(LIBDL).$(MAJOR_VERSION) $(TOPDIR)lib ; \ - (cd $(TOPDIR)lib;ln -sf ld-linux-uclibc.so $(UCLIBC_LDSO)); \ - (cd $(TOPDIR)lib;ln -sf $(LIBDL).$(MAJOR_VERSION) $(LIBDL)) ; \ + @if [ -d $(TOPDIR)ldso/d-link/$(TARGET_ARCH) ] ; then \ + $(MAKE) -C d-link; \ fi; -ldso: - @if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ - $(MAKE) -C d-link; \ +shared: + @if [ -d $(TOPDIR)ldso/d-link/$(TARGET_ARCH) ] ; then \ + set -e ; for d in $(SUBDIRS) ; do $(MAKE) -C $$d ; done \ fi; clean: diff --git a/ldso/Rules.mak b/ldso/Rules.mak index 4c58ff928..b853c1426 100644 --- a/ldso/Rules.mak +++ b/ldso/Rules.mak @@ -1,7 +1,6 @@ include $(TOPDIR)Rules.mak LDSO_VERSION=1.9.11 -LIBDL = libdl.so DEVEL=true diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile index ae181bb0a..d69823c9c 100644 --- a/ldso/ldso/Makefile +++ b/ldso/ldso/Makefile @@ -1,7 +1,31 @@ +# Makefile for uClibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more +# details. +# +# You should have received a copy of the GNU Library General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + + TOPDIR=../../ -include $(TOPDIR)/ld.so-1/Rules.mak +include $(TOPDIR)/ldso/Rules.mak + +LDSO_FULLNAME=ld-uclibc-$(MAJOR_VERSION).$(MINOR_VERSION).so -CFLAGS += -DUSE_CACHE -fPIC -D__PIC__ #-DDL_DEBUG #-funroll-loops CSRC= boot1.c hash.c readelflib1.c vsprintf.c $(TARGET_ARCH)/elfinterp.c COBJS=$(patsubst %.c,%.o, $(CSRC)) @@ -9,24 +33,25 @@ ASRC=$(shell ls $(TARGET_ARCH)/*.S) AOBJS=$(patsubst %.S,%.o, $(ASRC)) OBJS=$(AOBJS) $(COBJS) -ELF_LDFLAGS=--shared # using GNU ld -all: ld.so.h lib +CFLAGS += -DUSE_CACHE -fPIC -D__PIC__ #-DDL_DEBUG #-funroll-loops -ld.so.h: - echo "char *_dl_progname = \""$(UCLIBC_LDSO)"\";" > ld.so.h +all: lib -lib:: $(OBJS) $(DLINK_OBJS) - $(LD) -e _dl_boot $(ELF_LDFLAGS) -o $(UCLIBC_LDSO) \ +lib:: ld.so.h $(OBJS) $(DLINK_OBJS) + $(LD) -e _dl_boot --shared -o $(LDSO_FULLNAME) \ -soname $(UCLIBC_LDSO) $(OBJS) + install -d $(TOPDIR)lib ; \ + install -m 755 $(LDSO_FULLNAME) $(TOPDIR)lib; \ + (cd $(TOPDIR)lib;ln -sf $(LDSO_FULLNAME) $(UCLIBC_LDSO)); + +ld.so.h: + echo "char *_dl_progname = \""$(UCLIBC_LDSO)"\";" > ld.so.h $(COBJS): %.o : %.c $(CC) -I. -I./$(TARGET_ARCH) -I../libdl $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o -realclean:: - $(RM) -f .depend $(UCLIBC_LDSO)* core *.o *.a *.s *.i tmp_make foo *~ - clean:: - $(RM) -f $(UCLIBC_LDSO)* $(OBJS) core *.o *.a *.s *.i tmp_make foo *~ + $(RM) -f $(UCLIBC_LDSO)* $(OBJS) $(LDSO_FULLNAME)* core *.o *.a *.s *.i tmp_make foo *~ diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile index 6aac97002..1e1a0ac36 100644 --- a/ldso/libdl/Makefile +++ b/ldso/libdl/Makefile @@ -1,32 +1,64 @@ +# Makefile for uClibc +# +# Copyright (C) 2000 by Lineo, inc. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU Library General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more +# details. +# +# You should have received a copy of the GNU Library General Public License +# along with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Derived in part from the Linux-8086 C library, the GNU C Library, and several +# other sundry sources. Files within this library are copyright by their +# respective copyright holders. + + TOPDIR=../../ -include $(TOPDIR)/ld.so-1/Rules.mak +include $(TOPDIR)/ldso/Rules.mak -CFLAGS += -DUSE_CACHE -CFLAGS += #-fPIC -D__PIC__ #-funroll-loops +LIBDL=libdl.a +LIBDL_SHARED=libdl.so +LIBDL_SHARED_FULLNAME=libdl-$(MAJOR_VERSION).$(MINOR_VERSION).so +TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc CSRC= dlib.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) -OBJS=$(COBJS) +OBJS=$(patsubst %.c,%.o, $(CSRC)) -all: lib +CFLAGS += -DUSE_CACHE #-fPIC -D__PIC__ #-funroll-loops -$(COBJS): %.o : %.c - $(CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o +all: $(OBJS) $(LIBDL) -ELF_LDFLAGS=--shared -nostartfiles -nostdlib # using GNU ld -#ELF_LDFLAGS=-G # with SVr4 ld +$(LIBDL): ar-target -lib:: $(OBJS) - $(CC) $(ELF_LDFLAGS) \ - -o $(LIBDL).$(MAJOR_VERSION) -Wl,-soname -Wl,$(LIBDL).$(MAJOR_VERSION) \ - *.o $(TOPDIR)$(SHARED_FULLNAME) +ar-target: $(OBJS) + $(AR) $(ARFLAGS) $(LIBDL) $(OBJS) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBDL) + install -m 644 $(LIBDL) $(TOPDIR)lib + +$(OBJS): %.o : %.c + $(TARGET_CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(CFLAGS) -c $< -o $@ + $(STRIPTOOL) -x -R .note -R .comment $*.o -obj: $(OBJS) +$(OBJ): Makefile -realclean:: - $(RM) -f .depend $(LIBDL) core *.o *.a *.s *.i tmp_make foo *~ +shared: all + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBDL_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBDL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \ + $(LIBDL) $(TOPDIR)lib/$(SHARED_FULLNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION) + install -m 644 $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib; + (cd $(TOPDIR)lib; ln -sf $(LIBDL_SHARED_FULLNAME) $(LIBDL_SHARED).$(MAJOR_VERSION)); -clean:: - $(RM) -f $(LIBDL)* core *.o *.a *.s *.i tmp_make foo *~ +clean: + $(RM) -f .depend $(LIBDL_SHARED)* $(LIBDL_SHARED_FULLNAME) core *.o *.a *.s *.i tmp_make foo *~ diff --git a/ldso/util/Makefile b/ldso/util/Makefile index ac80544e9..a8f482f20 100644 --- a/ldso/util/Makefile +++ b/ldso/util/Makefile @@ -1,9 +1,9 @@ TOPDIR=../../ -include $(TOPDIR)/ld.so-1/Rules.mak +include $(TOPDIR)/ldso/Rules.mak CFLAGS += -DLDSO_ADDR="0x62f00020" # needed by ldd.o CFLAGS += -I./ -I../../include/ -LDFLAGS += -nostdlib ../../libc.a ../../crt0.o $(GCCINCDIR)/../libgcc.a +LDFLAGS += -nostdlib $(TOPDIR)lib/libc.a $(TOPDIR)lib/crt0.o $(GCCINCDIR)/../libgcc.a ALL = ldconfig ldd # lddstub |