From owner-freebsd-current@FreeBSD.ORG Thu Sep 4 13:27:28 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10E3416A4BF; Thu, 4 Sep 2003 13:27:28 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA9A343FEC; Thu, 4 Sep 2003 13:27:19 -0700 (PDT) (envelope-from ru@sunbay.com) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h84KRF86025613 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Sep 2003 23:27:15 +0300 (EEST) (envelope-from ru@sunbay.com) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9/8.12.8/Submit) id h84KRF76025612; Thu, 4 Sep 2003 23:27:15 +0300 (EEST) (envelope-from ru) Date: Thu, 4 Sep 2003 23:27:15 +0300 From: Ruslan Ermilov To: Gordon Tetlow , "David O'Brien" , Peter Wemm Message-ID: <20030904202715.GD4481@sunbay.com> References: <200309040429.h844TBhD058678@repoman.freebsd.org> <20030904083617.GA56261@dragon.nuxi.com> <20030904092755.GD45051@sunbay.com> <20030904140129.GA61909@dragon.nuxi.com> <20030904155659.GC97732@sunbay.com> <20030904162656.GA396@dragon.nuxi.com> <20030904174100.GY695@roark.gnf.org> <20030904185839.GB4481@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XStn23h1fwudRqtG" Content-Disposition: inline In-Reply-To: <20030904185839.GB4481@sunbay.com> User-Agent: Mutt/1.5.4i cc: current@FreeBSD.org Subject: /lib/foo.so.X -> /usr/lib/foo.so X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 20:27:28 -0000 --XStn23h1fwudRqtG Content-Type: multipart/mixed; boundary="zaRBsRFn0XYhEU69" Content-Disposition: inline --zaRBsRFn0XYhEU69 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 04, 2003 at 09:58:39PM +0300, Ruslan Ermilov wrote: [...] > The patch is not a problem (attached). I've been looking at > how our friends do this. NetBSD has symlinks in /usr/lib to > /lib, both to .so and .so.X, and their cc(1) and ld(1) don't > look things in /lib. Linux looks things up in both /lib and > /usr/lib, and does not have symlinks from /usr/lib to /lib. >=20 There is a sad typo above: Linux *does* have symlinks from /usr/lib to /lib, so both use /usr/lib for linking. > The only reason while I still think we should support both > /lib and /usr/lib in cc(1) and ld(1) by default is to allow > our users to have /usr symlinked somethere, otherwise relative > symlinking from /usr/lib to ../../lib does not work, and we > are back to that endless thread. >=20 Not that I'm completely happy with introducing yet another variable in bsd.lib.mk, but the attached patch: - Leaves only one set of .so symlinks in /usr/lib. Benefits: all other systems that use both /lib and /usr/lib (that I've been able to test) have .so links in /usr/lib only, and use them for linking; GCC in ports will like this better. - Uses absolute paths in .so symlinks. Benefit: works for people who have their /usr symlinked somewhere. - Works without any more modifications to GCC. ld(1) hacks can go away too. Please review. Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software Ltd, ru@FreeBSD.org FreeBSD committer --zaRBsRFn0XYhEU69 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.389 diff -u -r1.389 Makefile.inc1 --- Makefile.inc1 1 Sep 2003 06:43:24 -0000 1.389 +++ Makefile.inc1 4 Sep 2003 19:30:19 -0000 @@ -227,6 +227,7 @@ # world stage WMAKEENV= ${CROSSENV} \ DESTDIR=${WORLDTMP} \ + SHLIBDIRPREFIX=${WORLDTMP} \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 Index: share/mk/bsd.lib.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v retrieving revision 1.153 diff -u -r1.153 bsd.lib.mk --- share/mk/bsd.lib.mk 4 Sep 2003 04:29:11 -0000 1.153 +++ share/mk/bsd.lib.mk 4 Sep 2003 19:34:08 -0000 @@ -208,9 +208,10 @@ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} .if defined(SHLIB_LINK) - ln -fs ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK} -.if (${LIBDIR} != ${SHLIBDIR}) - ln -fs ${LIBDIR:C|/[^/]+|/..|g:S|^/||}${SHLIBDIR}/${SHLIB_NAME} \ +.if ${SHLIBDIR} == ${LIBDIR} + ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK} +.else + ln -fs ${SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${LIBDIR}/${SHLIB_LINK} .endif .endif --zaRBsRFn0XYhEU69-- --XStn23h1fwudRqtG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/V6AiUkv4P6juNwoRAgH8AJ4shZVRX6NnjzjIprMoIWGODRg9ugCfWTX1 Bv2r15X67cTw5fx1kEojeE8= =SZiG -----END PGP SIGNATURE----- --XStn23h1fwudRqtG--