diff options
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/Makefile.in | 45 | ||||
-rw-r--r-- | ldso/ldso/Makefile.in | 39 | ||||
-rw-r--r-- | ldso/libdl/Makefile.in | 57 |
3 files changed, 102 insertions, 39 deletions
diff --git a/ldso/Makefile.in b/ldso/Makefile.in new file mode 100644 index 000000000..8d3c5fcda --- /dev/null +++ b/ldso/Makefile.in @@ -0,0 +1,45 @@ +# Makefile for uClibc +# +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +DIRS=$(shell if test -f $(top_builddir)lib/libc.so ; then echo "ldso libdl" ; else echo "ldso" ; fi) + +libs: subdirs + +LN_HEADERS := $(patsubst %, include/%, elf.h) +LN_ARCH_HEADERS := $(patsubst %, include/%, dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h) +HEADERS := $(LN_HEADERS) $(LN_ARCH_HEADERS) include/dl-progname.h + +headers-y+=ldso_headers + +ldso_headers: $(HEADERS) + +$(LN_HEADERS): + $(LN) -sf $(top_builddir)../$@ $@ + +$(LN_ARCH_HEADERS): + $(LN) -sf ../ldso/$(TARGET_ARCH)/$(patsubst include/%,%,$@) $@ + +include/dl-progname.h: + echo '#include "$(TARGET_ARCH)/elfinterp.c"' > $@ + +headers_clean-y+=ldso_headers_clean + +ldso_headers_clean: + $(RM) $(HEADERS) + +clean: subdirs_clean ldso_headers_clean + +subdirs: $(patsubst %, _dir_%, $(DIRS)) +subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS)) + +$(patsubst %, _dir_%, $(DIRS)): ldso_headers + $(MAKE) -C $(patsubst _dir_%, %, $@) + +$(patsubst %, _dirclean_%, $(DIRS)): dummy + $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean + +.PHONY: dummy diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index a272e771b..2ba7e2f71 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -1,13 +1,13 @@ # Makefile for uClibc # -# Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # - -LIB_NAME:=ld-uClibc # psm: I do not know if the order of includes is relevant # to be sure I have put them first -CFLAGS:=-I$(top_srcdir)ldso/include -I. $(CFLAGS) $(PICFLAG) $(SSP_DISABLE_FLAGS) +CFLAGS:=-I$(top_builddir)ldso/include -I. $(CFLAGS) $(PICFLAG) $(SSP_DISABLE_FLAGS) CFLAGS+=-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" @@ -39,21 +39,32 @@ ifeq ($(SUPPORT_LD_DEBUG),y) LDFLAGS:=$(LDFLAGS_NOSTRIP) endif -srcdir=$(top_srcdir)ldso/ldso -$(LIB_NAME)_DIR:=$(top_builddir)ldso/ldso +# useless, only 1 source file +DOMULTI=n + +LIB_NAME:=ld-uClibc -$(LIB_NAME)_SRC:=$(srcdir)/ldso.c +ld-uClibc_DIR:=$(top_srcdir)ldso/ldso +ld-uClibc_OUT:=$(top_builddir)ldso/ldso -$(LIB_NAME)_SSRC:=$(wildcard $(srcdir)/$(TARGET_ARCH)/*.S) -$(LIB_NAME)_SOBJ:=$(patsubst $(srcdir)/$(TARGET_ARCH)/%.S,$($(LIB_NAME)_DIR)/$(TARGET_ARCH)/%.o,$($(LIB_NAME)_SSRC)) +ld-uClibc_SRC:=$(ld-uClibc_DIR)/ldso.c +ld-uClibc_OBJ:=$(patsubst $(ld-uClibc_DIR)/%.c,$(ld-uClibc_OUT)/%.o,$(ld-uClibc_SRC)) + +ld-uClibc_SSRC:=$(wildcard $(ld-uClibc_DIR)/$(TARGET_ARCH)/*.S) +ld-uClibc_SOBJ:=$(patsubst $(ld-uClibc_DIR)/$(TARGET_ARCH)/%.S,$(ld-uClibc_OUT)/$(TARGET_ARCH)/%.o,$(ld-uClibc_SSRC)) + +ld-uClibc_OBJS:=$(ld-uClibc_OBJ) $(ld-uClibc_SOBJ) EXTRA_LINK_OPTS:=-e _start -z now -Bsymbolic --export-dynamic --sort-common --discard-locals --discard-all --no-undefined EXTRA_LINK_LIBS:=$(LIBGCC) # $(LDADD_LIBFLOAT) -libso-$(HAVE_SHARED)+=$(top_builddir)lib/$(LIB_NAME).so -libclean-y+=$(LIB_NAME)_clean $(LIB_NAME)_arch_clean +ld-uClibc-so-$(HAVE_SHARED):=$(ld-uClibc_OBJS:.o=.os) + +#ld-uClibc-multi-$(HAVE_SHARED):=$(ld-uClibc_SRC) + +objclean-y+=ld-uClibc_clean ld-uClibc_arch_clean -$(LIB_NAME)_arch_clean: - $(RM) $($(LIB_NAME)_DIR)/*/*.{o,os} +ld-uClibc_arch_clean: + $(RM) $(ld-uClibc_OUT)/*/*.{o,os} -include $(top_srcdir)Makefile.libs +lib-so-$(HAVE_SHARED)+=$(top_builddir)lib/ld-uClibc.so diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in index 389484e9b..24a53422e 100644 --- a/ldso/libdl/Makefile.in +++ b/ldso/libdl/Makefile.in @@ -1,12 +1,13 @@ # Makefile.in for uClibc # -# Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. +# Copyright (C) 2000 by Lineo, inc. +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # - -LIB_NAME:=libdl # psm: I do not know if the order of includes is relevant -# to be sure I added them first +# to be sure I added them first, Jocke please cleanup if needed CFLAGS:=-I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso $(CFLAGS) $(SSP_ALL_CFLAGS) CFLAGS+=-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" @@ -20,33 +21,39 @@ ifeq ($(TARGET_ARCH),mips) CFLAGS:=$(CFLAGS:-O0=-O1) endif -CFLAGS-.os=-DSHARED -# we adapt CFLAGS, because libdl.a has an additional object -ifeq ($(DOPIC),y) -CFLAGS-.o=$(PICFLAG) -resolv:=$(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.os -else -resolv:=$(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o -endif +# useless, only 1 source file +DOMULTI=n + +LIB_NAME:=libdl EXTRA_LINK_OPTS:=-fini dl_cleanup +# keep in sync w/ Makerules +EXTRA_LINK_LIBS:=$(top_builddir)libc/misc/internals/interp.os $(top_builddir)lib/libc.so $(LIBGCC) $(top_builddir)lib/$(UCLIBC_LDSO) + +libdl_DIR:=$(top_srcdir)ldso/libdl +libdl_OUT:=$(top_builddir)ldso/libdl + +libdl_SRC:=$(libdl_DIR)/libdl.c +libdl_OBJ:=$(patsubst $(libdl_DIR)/%.c,$(libdl_OUT)/%.o,$(libdl_SRC)) -# we need for all cases a "full" libdl.a the pic version used to build libdl.so misses $(resolv) -# because it is linked against ld.so -DOPIC=n +# use other suffixes, so that it does not pick up the multi rule from Makerules +$(libdl_OUT)/libdl.oS: $(libdl_DIR)/libdl.c + $(compile.c) -DSHARED -srcdir=$(top_srcdir)ldso/$(LIB_NAME) -$(LIB_NAME)_DIR:=$(top_builddir)ldso/$(LIB_NAME) +resolve:=$(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o -$(LIB_NAME)_SRC:=$(srcdir)/libdl.c +libdl-a-$(HAVE_SHARED):=$(libdl_OBJ) $(resolve) +libdl-a-pic-$(HAVE_SHARED):=$(libdl_OBJ:.o=.os) $(resolve:.o=.os) +libdl-so-$(HAVE_SHARED):=$(libdl_OBJ:.o=.oS) -$(LIB_NAME)_A_ADD:=$(resolv) +# we enable this although no use of multi, else libdl.o gets empty sources +libdl-multi-$(HAVE_SHARED):=$(libdl_SRC) -libso-$(HAVE_SHARED)+=$(top_builddir)lib/$(LIB_NAME).so -liba-$(HAVE_SHARED)+=$(top_builddir)lib/$(LIB_NAME).a -libclean-y+=$(LIB_NAME)_clean +objclean-y+=libdl_clean libdl_extra_clean -include $(top_srcdir)Makefile.libs +libdl_extra_clean: + $(RM) $(libdl_OUT)/*.oS -# !!! these lines have to come after including Makefile.libs !!! -EXTRA_LINK_LIBS+=$(top_builddir)lib/$(UCLIBC_LDSO) +lib-a-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.a +lib-a-pic-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.a +lib-so-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.so |