From a0f546e88ff3ba025ed0bdc1f1bfbcc5b44a1f49 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 1 Aug 2008 21:52:41 +0000 Subject: Tweak the support for using ldd on 32-bit objects a bit further. Specifically, build a 32-bit /usr/bin/ldd32 on amd64 which handles 32-bit objects. Since it is a 32-bit binary, it can fork a child process which can dlopen() a 32-bit shared library. The current 32-bit support in ldd can't do this because it does the dlopen() from a 64-bit process. In order to preserve an intuitive interface for users, the ldd binary automatically execs /usr/bin/ldd32 for 32-bit objects. The end result is that ldd on amd64 now transparently handles 32-bit shared libraries in addition to 32-bit binaries. Submitted by: ps (indirectly) --- Makefile.inc1 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile.inc1') diff --git a/Makefile.inc1 b/Makefile.inc1 index 78da47d..cdb72a2 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -482,6 +482,8 @@ build32: .for _t in obj depend all cd ${.CURDIR}/libexec/rtld-elf; \ PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/usr.bin/ldd; \ + PROG=ldd32 ${LIB32WMAKE} ${_t} .endfor distribute32 install32: @@ -501,6 +503,7 @@ distribute32 install32: cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} .endif cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} + cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} .endif -- cgit v1.1