summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/Makefile.in40
-rw-r--r--ldso/ldso/Makefile.in86
-rw-r--r--ldso/libdl/Makefile.in61
3 files changed, 94 insertions, 93 deletions
diff --git a/ldso/Makefile.in b/ldso/Makefile.in
index 8d3c5fcda..7bbef23a0 100644
--- a/ldso/Makefile.in
+++ b/ldso/Makefile.in
@@ -5,41 +5,5 @@
# 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
+include $(top_srcdir)ldso/ldso/Makefile.in
+include $(top_srcdir)ldso/libdl/Makefile.in
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 12853afc2..0bf5c02ed 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -5,61 +5,85 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# psm: I do not know if the order of includes is relevant
-# to be sure I have put them first
-CFLAGS:=-I$(top_builddir)ldso/include -I. $(CFLAGS) $(PICFLAG) $(SSP_DISABLE_FLAGS)
+CFLAGS-ldso := -DNOT_IN_libc #-DIS_IN_rtld
-CFLAGS+=-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\"
+# This stuff will not work with -fomit-frame-pointer
+CFLAGS-ldso += -fno-omit-frame-pointer
+
+CFLAGS-ldso += -I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso $(SSP_DISABLE_FLAGS)
+CFLAGS-ldso += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\"
ifeq ($(SUPPORT_LD_DEBUG),y)
-CFLAGS+=-D__SUPPORT_LD_DEBUG__
+CFLAGS-ldso += -D__SUPPORT_LD_DEBUG__
endif
ifeq ($(SUPPORT_LD_DEBUG_EARLY),y)
-CFLAGS+=-D__SUPPORT_LD_DEBUG_EARLY__
+CFLAGS-ldso += -D__SUPPORT_LD_DEBUG_EARLY__
endif
-CFLAGS+=-DNOT_IN_libc
-
ifeq ($(DODEBUG),y)
# Not really much point in including debugging info, since gdb
# can't really debug ldso, since gdb requires help from ldso to
# debug things....
-# psm: keep this in sync w/ Rules.mak
-CFLAGS:=$(CFLAGS:-O0 -g3=-Os -g)
+CFLAGS-ldso += -Os -g
endif
-# This stuff will not work with -fomit-frame-pointer
-CFLAGS:=$(CFLAGS:-fomit-frame-pointer=)
+CFLAGS-ldso/ldso/$(TARGET_ARCH)/ := $(CFLAGS-ldso)
-ifeq ($(SUPPORT_LD_DEBUG),y)
-LDFLAGS:=$(LDFLAGS_NOSTRIP)
+ifneq ($(SUPPORT_LD_DEBUG),y)
+LDFLAGS-ld-uClibc.so := $(LDFLAGS)
+else
+LDFLAGS-ld-uClibc.so := $(LDFLAGS_NOSTRIP) -z defs
endif
+LDFLAGS-ld-uClibc.so += -e _start -z now -Bsymbolic --export-dynamic --sort-common --discard-locals --discard-all --no-undefined
+
+ldso_FULL_NAME := ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
+
+ld-uClibc_DIR := $(top_srcdir)ldso/ldso
+ld-uClibc_OUT := $(top_builddir)ldso/ldso
+
+ld-uClibc_CSRC := $(ld-uClibc_DIR)/ldso.c
+ld-uClibc_COBJ := $(patsubst $(ld-uClibc_DIR)/%.c,$(ld-uClibc_OUT)/%.o,$(ld-uClibc_CSRC))
+
+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_COBJ) $(ld-uClibc_SOBJ)
-# can't combine .c w/ .S
-DOMULTI=n
+ld-uClibc-so-y := $(ld-uClibc_OBJS:.o=.os)
-LIB_NAME:=ld-uClibc
+LN_HEADERS := $(patsubst %, $(top_builddir)ldso/include/%, elf.h)
+LN_ARCH_HEADERS := $(patsubst %, $(top_builddir)ldso/include/%, dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h)
+HEADERS := $(LN_HEADERS) $(LN_ARCH_HEADERS) $(top_builddir)ldso/include/dl-progname.h
-ld-uClibc_DIR:=$(top_srcdir)ldso/ldso
-ld-uClibc_OUT:=$(top_builddir)ldso/ldso
+#lib-so-y := $(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO))
+ld-uClibc-y := $(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO))
+objclean-y += ld-uClibc_clean
+headers-$(HAVE_SHARED) += ldso_headers
+headers_clean-y += ldso_headers_clean
-ld-uClibc_SRC:=$(ld-uClibc_DIR)/ldso.c
-ld-uClibc_OBJ:=$(patsubst $(ld-uClibc_DIR)/%.c,$(ld-uClibc_OUT)/%.o,$(ld-uClibc_SRC))
+$(top_builddir)lib/$(patsubst %.$(MAJOR_VERSION),%,$(UCLIBC_LDSO)): $(ld-uClibc_OUT)/ld-uClibc_so.a headers_root
+ $(call link.so,$(ldso_FULL_NAME),$(MAJOR_VERSION))
+ #(RM) $@
-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_OUT)/ld-uClibc_so.a: $(ld-uClibc-so-y)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
-ld-uClibc_OBJS:=$(ld-uClibc_OBJ) $(ld-uClibc_SOBJ)
+ldso_headers: $(HEADERS)
-EXTRA_LINK_OPTS:=-e _start -z now -Bsymbolic --export-dynamic --sort-common --discard-locals --discard-all --no-undefined
-EXTRA_LINK_LIBS:=$(LIBGCC) # $(LDADD_LIBFLOAT)
+$(LN_HEADERS):
+ $(LN) -sf ../../$(top_srcdir)include/$(notdir $@) $@
-ld-uClibc-so-$(HAVE_SHARED):=$(ld-uClibc_OBJS:.o=.os)
+$(LN_ARCH_HEADERS):
+ $(LN) -sf ../../$(top_srcdir)ldso/ldso/$(TARGET_ARCH)/$(notdir $@) $@
-objclean-y+=ld-uClibc_clean ld-uClibc_arch_clean
+$(top_builddir)ldso/include/dl-progname.h:
+ echo '#include "$(TARGET_ARCH)/elfinterp.c"' > $@
-ld-uClibc_arch_clean:
- $(RM) $(ld-uClibc_OUT)/*/*.{o,os}
+ldso_headers_clean:
+ $(RM) $(HEADERS)
-lib-so-$(HAVE_SHARED)+=$(top_builddir)lib/ld-uClibc.so
+ld-uClibc_clean:
+ $(RM) $(ld-uClibc_OUT)/*.{o,os,a} $(ld-uClibc_OUT)/*/*.{o,os}
diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in
index e804b3458..6622226c5 100644
--- a/ldso/libdl/Makefile.in
+++ b/ldso/libdl/Makefile.in
@@ -6,41 +6,54 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-# psm: I do not know if the order of includes is relevant
-# 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-libdl := -DNOT_IN_libc
-CFLAGS+=-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\"
+CFLAGS-libdl +=-I$(top_builddir)ldso/include -I$(top_builddir)ldso/ldso $(SSP_ALL_CFLAGS)
+
+CFLAGS-libdl += -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\"
ifeq ($(SUPPORT_LD_DEBUG),y)
-CFLAGS+=-D__SUPPORT_LD_DEBUG__
+CFLAGS-libdl += -D__SUPPORT_LD_DEBUG__
endif
-# can't combine .c w/ .S
-DOMULTI=n
+LDFLAGS-libdl.so := $(LDFLAGS) -fini dl_cleanup
+
+LIBS-libdl.so := $(LIBS) $(top_builddir)lib/$(UCLIBC_LDSO)
-LIB_NAME:=libdl
+libdl_FULL_NAME := libdl-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
-EXTRA_LINK_OPTS:=-fini dl_cleanup
-# keep in sync w/ Makerules
-EXTRA_LINK_LIBS:=$(top_builddir)libc/misc/internals/interp.os -L$(top_builddir)lib $(top_builddir)lib/libc.so $(LIBGCC) $(top_builddir)lib/$(UCLIBC_LDSO)
+libdl_DIR := $(top_srcdir)ldso/libdl
+libdl_OUT := $(top_builddir)ldso/libdl
-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))
-libdl_SRC:=$(libdl_DIR)/libdl.c
-libdl_OBJ:=$(patsubst $(libdl_DIR)/%.c,$(libdl_OUT)/%.o,$(libdl_SRC))
+resolve := $(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o
-resolve:=$(top_builddir)ldso/ldso/$(TARGET_ARCH)/resolve.o
+libdl-a-y := $(libdl_OBJ) $(resolve)
+libdl-so-y := $(libdl_OUT)/libdl.oS
-libdl-a-$(HAVE_SHARED):=$(libdl_OBJ)
-libdl-static-$(HAVE_SHARED):=$(resolve)
-libdl-shared-$(HAVE_SHARED):=$(libdl_OUT)/libdl.oS
+lib-a-$(HAVE_SHARED) += $(top_builddir)lib/libdl.a
+lib-so-y += $(top_builddir)lib/libdl.so
+objclean-y += libdl_clean
-objclean-y+=libdl_clean libdl_extra_clean
+$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a ld-uClibc-y libc-y
+ $(call link.so,$(libdl_FULL_NAME),$(MAJOR_VERSION))
-libdl_extra_clean:
- $(RM) $(libdl_OUT)/*.oS
+$(libdl_OUT)/libdl_so.a: $(libdl-so-y)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
+
+ifeq ($(DOPIC),y)
+$(top_builddir)lib/libdl.a: $(libdl-a-y:.o=.os)
+else
+$(top_builddir)lib/libdl.a: $(libdl-a-y)
+endif
+ $(Q)$(INSTALL) -d $(dir $@)
+ $(Q)$(RM) $@
+ $(do_strip)
+ $(do_ar)
-lib-a-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.a
-lib-so-$(HAVE_SHARED)+=$(top_builddir)lib/libdl.so
+libdl_clean:
+ $(RM) $(libdl_OUT)/*.{o,os,a,oS}