From owner-svn-src-all@FreeBSD.ORG Sat May 25 22:17:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E1A1E7; Sat, 25 May 2013 22:17:15 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D002B47; Sat, 25 May 2013 22:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4PMHFOx022831; Sat, 25 May 2013 22:17:15 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4PMHFSI022830; Sat, 25 May 2013 22:17:15 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305252217.r4PMHFSI022830@svn.freebsd.org> From: Jeremie Le Hen Date: Sat, 25 May 2013 22:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250992 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 22:17:15 -0000 Author: jlh Date: Sat May 25 22:17:14 2013 New Revision: 250992 URL: http://svnweb.freebsd.org/changeset/base/250992 Log: Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced. The build system is really intricate and I had a hard time to remind the whole picture even when reading my own words. This one will hopefully be better. Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat May 25 18:59:11 2013 (r250991) +++ head/share/mk/bsd.lib.mk Sat May 25 22:17:14 2013 (r250992) @@ -294,16 +294,21 @@ _libinstall: .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory -# prefix where shared objects will be installed. ${_LDSCRIPTROOT} is the -# directory prefix that will be used in generated ld(1) scripts. They cannot -# be coalesced because of the way ld(1) handles the sysroot prefix (used in the -# cross-toolchain): -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty. +# prefix where shared objects will be installed by the install target. +# +# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating +# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an +# alternative directory which is called "sysroot", so during buildworld binaries +# won't be linked against the running system libraries but against the ones of +# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of +# the location where we store them: +# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty +# because ld(1) will manage to find them from sysroot; # - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path. Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty. -# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it -# does not involve the logic of a tool we do not own. +# path, outside of sysroot. +# Note that ld(1) scripts are generated both during buildworld and +# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty +# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \