* elf/Makefile (ldd): Make it executable.

* Makeconfig (config-LDFLAGS): Find dynamic linker in $(slibdir).

	* Makeconfig (slibdir): New variable.
	* Makerules (install): Install libc.so in $(slibdir).
	* elf/Makefile (install-others): Install ld.so and ld-linux.so.1
	in $(slibdir).
This commit is contained in:
Roland McGrath 1995-11-08 02:28:15 +00:00
parent 86d2c878ac
commit 094bacdbd8
4 changed files with 26 additions and 8 deletions

View File

@ -1,5 +1,14 @@
Tue Nov 7 12:29:46 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* elf/Makefile (ldd): Make it executable.
* Makeconfig (config-LDFLAGS): Find dynamic linker in $(slibdir).
* Makeconfig (slibdir): New variable.
* Makerules (install): Install libc.so in $(slibdir).
* elf/Makefile (install-others): Install ld.so and ld-linux.so.1
in $(slibdir).
* elf/linux-compat.c: New file.
* elf/Makefile (distribute): Add linux-compat.c.
(generated): Add librtld.so.

View File

@ -56,7 +56,7 @@ objdir = $(ARCH)
endif
endif
# $(common-objdir) is the place to put objects and
# $(common-objdir) is the place to put objects and
# such that are not specific to a single subdir.
ifdef objdir
objpfx = $(objdir)/
@ -135,6 +135,11 @@ ifndef libdir
libdir = $(exec_prefix)/lib
endif
# Where to install the shared library and dynamic linker.
ifndef slibdir
slibdir = $(exec_prefix)/lib
endif
# Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
# the prefix is spliced between `lib' and the name, so the linker switch
# `-l$(libprefix)NAME' finds the library; for other files the prefix is
@ -281,7 +286,7 @@ ifndef +link
endif
ifndef config-LDFLAGS
ifeq (yes,$(build-shared))
config-LDFLAGS = -Wl,-dynamic-linker=$(libdir)/$(rtld-installed-name)
config-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
endif
endif
ifndef link-libc

View File

@ -475,12 +475,14 @@ endef
install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
install-lib := $(filter-out %.so %_pic.a,$(install-lib))
ifeq (yes,$(build-shared))
install: $(libdir)/libc.so$(libc.so-version)
install-lib-nosubdir: $(foreach so,$(install-lib.so),\
$(libdir)/$(patsubst $(libprefix)lib%,lib$(libprefix)%,\
$(libprefix)$(so))$($(so)-version))
install-lib.so += libc.so
install: $(slibdir)/libc.so$(libc.so-version)
$(slibdir)/lib$(libprefix)c.so$(libc.so-version): $(common-objpfx)libc.so
$(do-install-program)
$(foreach v,$(sort $(foreach so,$(install-lib.so),.so$($(so)-version))),\
$(libdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
$(do-install-program)
@ -646,7 +648,7 @@ $(common-objpfx)stub-$(subdir): $(+depfiles)
# Make the distribution tar file.
.PHONY: dist
dist: distinfo $(..)Make-dist
dist: distinfo $(..)Make-dist
$(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args)
# Avoid depending on source files found in sysdeps dirs,

View File

@ -38,12 +38,12 @@ include ../Makeconfig
ifeq (yes,$(build-shared))
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so
generated = librtld.so
install-others = $(libdir)/$(rtld-installed-name)
install-others = $(slibdir)/$(rtld-installed-name)
install-bin = ldd
ifneq (,$(filter linux%,$(config-os)))
extra-objs += linux-compat.so
install-lib += ld-linux.so.1
install-others += $(slibdir)/ld-linux.so.1
endif
endif
@ -73,8 +73,10 @@ $(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
$(LDFLAGS.so) $(LDFLAGS-dl.so) \
-Wl,--whole-archive $(^:$(objpfx)%=%)
$(libdir)$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
$(slibdir)/ld-linux.so.1: $(objpfx)ld-linux.so.1; $(do-install-program)
$(objpfx)ldd: ldd.sh.in
sed 's%@RTLD@%$(libdir)/$(rtld-installed-name)%g' < $< > $@.new
chmod 555 $@.new
mv -f $@.new $@