]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add support for rtld directory different from slib directory
authorAndreas Schwab <schwab@suse.de>
Mon, 18 Mar 2013 11:44:47 +0000 (12:44 +0100)
committerAndreas Schwab <schwab@suse.de>
Tue, 19 Mar 2013 11:07:26 +0000 (12:07 +0100)
ChangeLog
Makeconfig
Makerules
config.make.in
configure
configure.in
elf/Makefile
scripts/rellns-sh

index e50ae01898359a5e2b0321169f9d2939b0398096..2fb09f6b3f3dffbd4b4e35f64cff306c31811fca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-03-19  Andreas Schwab  <schwab@suse.de>
+
+       * configure.in: Substitute libc_cv_rtlddir.
+       * configure: Regenerate.
+       * config.make.in (rtlddir): Set from libc_cv_rtlddir.
+       * Makeconfig (rtlddir, inst_rtlddir): New variables.
+       (rtld-LDFLAGS): Use them with $(rtld-installed-name).
+       * elf/Makefile (install-others, CFLAGS-interp.c)
+       (ldso_install, common-ldd-rewrite): Likewise.
+       ($(inst_rtlddir)/$(rtld-installed-name)): Renamed from
+       $(inst_slibdir)/$(rtld-installed-name).
+       * scripts/rellns-sh: Add -p option.
+       * Makerules (make-shlib-link): Use rellns-sh to get relative name
+       for source.
+
 2013-03-19  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
        * manual/nptl.texi: Renamed to ...
index 6c8891827e4e3a0646d837a26f973b24635fd788..70deb1e1823858ecb642b3d7d52a9a1801016e3e 100644 (file)
@@ -151,12 +151,18 @@ libdir = $(exec_prefix)/lib
 endif
 inst_libdir = $(install_root)$(libdir)
 
-# Where to install the shared library and dynamic linker.
+# Where to install the shared library.
 ifndef slibdir
 slibdir = $(exec_prefix)/lib
 endif
 inst_slibdir = $(install_root)$(slibdir)
 
+# Where to install the dynamic linker.
+ifndef rtlddir
+rtlddir = $(slibdir)
+endif
+inst_rtlddir = $(install_root)$(rtlddir)
+
 # 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
@@ -441,7 +447,7 @@ endif
 endif
 ifeq (yes,$(build-shared))
 ifndef rtld-LDFLAGS
-rtld-LDFLAGS = -Wl,-dynamic-linker=$(slibdir)/$(rtld-installed-name)
+rtld-LDFLAGS = -Wl,-dynamic-linker=$(rtlddir)/$(rtld-installed-name)
 endif
 ifndef rtld-tests-LDFLAGS
 ifeq (yes,$(build-hardcoded-path-in-tests))
index b115f1a92c77c1f76e28672edaa7d57213b7b8d8..5ba670c1ccd74eee8421e487c5d3514775d70b12 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -864,7 +864,7 @@ ifeq (no,$(cross-compiling))
 symbolic-link-prog := $(common-objpfx)elf/sln
 symbolic-link-list := $(common-objpfx)elf/symlink.list
 define make-shlib-link
-echo $(<F) $@ >> $(symbolic-link-list)
+echo `$(..)scripts/rellns-sh -p $< $@` $@ >> $(symbolic-link-list)
 endef
 else # cross-compiling
 # We need a definition that can be used by elf/Makefile's install rules.
@@ -874,7 +874,7 @@ endif
 ifndef make-shlib-link
 define make-shlib-link
 rm -f $@
-$(LN_S) $(<F) $@
+$(LN_S) `$(..)scripts/rellns-sh -p $< $@` $@
 endef
 endif
 
index a966dcae23a71a4c9bd326ac5c80a234968132e4..2cab2f352e7e7638d9f8a81ce1ff9ff8e0121d04 100644 (file)
@@ -11,6 +11,7 @@ exec_prefix = @exec_prefix@
 datadir = @datadir@
 libdir = @libdir@
 slibdir = @libc_cv_slibdir@
+rtlddir = @libc_cv_rtlddir@
 localedir = @libc_cv_localedir@
 sysconfdir = @libc_cv_sysconfdir@
 libexecdir = @libexecdir@
index e386c1a6f7ee5b67d03206cf621ffa774c798351..2dc7eeb977cfc94b916347c23c22c7babf17bbdb 100755 (executable)
--- a/configure
+++ b/configure
@@ -594,6 +594,7 @@ libc_cv_rootsbindir
 libc_cv_localstatedir
 libc_cv_sysconfdir
 libc_cv_localedir
+libc_cv_rtlddir
 libc_cv_slibdir
 old_glibc_headers
 use_nscd
@@ -7374,6 +7375,7 @@ fi
 
 
 
+
 if test x$use_ldconfig = xyes; then
   $as_echo "#define USE_LDCONFIG 1" >>confdefs.h
 
index c57897974cbf7d89ab5d7a2e4270d37b2856643d..cb317308ab7162943486cb507cc664990e7ad721 100644 (file)
@@ -2153,6 +2153,7 @@ fi
 AC_SUBST(old_glibc_headers)
 
 AC_SUBST(libc_cv_slibdir)
+AC_SUBST(libc_cv_rtlddir)
 AC_SUBST(libc_cv_localedir)
 AC_SUBST(libc_cv_sysconfdir)
 AC_SUBST(libc_cv_localstatedir)
index 6d4b365fbb5f4e002454cf1ecc165b6966ca9d29..9477a4d96b717e41e667dc51720f744a204ff742 100644 (file)
@@ -66,7 +66,7 @@ endif
 ifeq (yes,$(build-shared))
 extra-objs     = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
 generated      += librtld.os dl-allobjs.os ld.so ldd
-install-others = $(inst_slibdir)/$(rtld-installed-name)
+install-others = $(inst_rtlddir)/$(rtld-installed-name)
 install-bin-script = ldd
 endif
 
@@ -340,7 +340,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
          | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
 
 # interp.c exists just to get this string into the libraries.
-CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
+CFLAGS-interp.c = -D'RUNTIME_LINKER="$(rtlddir)/$(rtld-installed-name)"' \
                  -DNOT_IN_libc=1
 $(objpfx)interp.os: $(common-objpfx)config.make
 
@@ -372,18 +372,19 @@ $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
        $(make-target-directory)
        $(do-install-program)
 
-$(inst_slibdir)/$(rtld-installed-name): \
+$(inst_rtlddir)/$(rtld-installed-name): \
   $(inst_slibdir)/$(rtld-version-installed-name) \
   $(inst_slibdir)/libc-$(version).so
+       $(make-target-directory)
        $(make-shlib-link)
 
 # Special target called by parent to install just the dynamic linker.
 .PHONY: ldso_install
-ldso_install: $(inst_slibdir)/$(rtld-installed-name)
+ldso_install: $(inst_rtlddir)/$(rtld-installed-name)
 endif
 
 
-common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
+common-ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
                     -e 's%@VERSION@%$(version)%g' \
                     -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
                     -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g'
index 0e861b5fa59d319641f1b9a75c2c8d87e26aa80a..9a1496a9fdbdad06746a7cea6a0e890f59a6bac3 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
+# With -p, instead of creating the link print the computed relative link
+# name.
+do_print=false
+case $1 in
+  -p)
+    do_print=true
+    shift
+    ;;
+esac
 if test $# -ne 2; then
-  echo "Usage: rellns SOURCE DEST" >&2
+  echo "Usage: rellns [-p] SOURCE DEST" >&2
   exit 1
 fi
 
@@ -70,4 +79,8 @@ while test -n "$from"; do
   from=`echo $from | sed 's%^[^/]*/*%%'`
 done
 
-ln -s $rfrom$to $2
+if $do_print; then
+  echo "$rfrom$to"
+else
+  ln -s $rfrom$to $2
+fi