From owner-freebsd-arch@FreeBSD.ORG Tue May 7 19:37:12 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36F914CF for ; Tue, 7 May 2013 19:37:12 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 01C36E38 for ; Tue, 7 May 2013 19:37:11 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id D7A7F988; Tue, 7 May 2013 21:33:14 +0200 (CEST) Date: Tue, 7 May 2013 21:39:40 +0200 From: Pawel Jakub Dawidek To: Warner Losh Subject: Re: Building library that depends on another library. Message-ID: <20130507193940.GC1888@garage.freebsd.pl> References: <20130505201436.GJ1374@garage.freebsd.pl> <86r4hkgd04.fsf@nine.des.no> <20130507185005.GB1888@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DSayHWYpDlRfCAAQ" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 19:37:12 -0000 --DSayHWYpDlRfCAAQ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 07, 2013 at 01:27:34PM -0600, Warner Losh wrote: >=20 > On May 7, 2013, at 12:50 PM, Pawel Jakub Dawidek wrote: >=20 > > On Mon, May 06, 2013 at 08:49:15PM +0200, Dag-Erling Sm=F8rgrav wrote: > >> Pawel Jakub Dawidek writes: > >>> It looks like to make such dependency work one HAS TO add libnv to > >>> _prebuild_libs in src/Makefile.inc1, which seems wrong. > >>=20 > >> It may seem wrong, but it is correct, cf the following comment in > >> Makefile.inc1: > >>=20 > >> # The list of libraries with dependents (${_prebuild_libs}) and their > >> # interdependencies (__L) are built automatically by the > >> # ${.CURDIR}/tools/make_libdeps.sh script. > >=20 > > Yes, this also means SUBDIR_ORDERED in lib/Makefile doesn't make sense. > >=20 > > All in all I really don't like to add libraries to Makefile.inc1, it > > doesn't sound right. I'd like this to be self-contained. For bsd.prog.mk > > it is enough to specify DPADD/LDADD in program's Makefile instead of > > hacking some central Makefile. > >=20 > > I came up with something like the following. Instead of: > >=20 > > DPADD=3D ${LIBNV} > > LDADD=3D -lnv > > (plus modifying src/Makefile.inc1) > >=20 > > I only add: > >=20 > > LDADD=3D -L${.OBJDIR}/../libnv -lnv > >=20 > > What do people think? >=20 > Still won't work. It won't ensure that libnv is built, leading to cross-t= hreading on upgrade issues. >=20 > Better would be a 'plus modifying src/Makefile.inc1' would instead be 'ha= ve Makefile.inc1 figure it out fast.' We have to get the order right, there= 's no way around that. I forgot to mention. The way I'm proposing makes SUBDIR_ORDERED relevant again. So we should either remove SUBDIR_ORDERED fro lib/Makefile and keep adding to _prebuild_libs or adopt what I'm proposing. One argument against my method was that my library without DPADD won't be relinked after libnv change, which may affect symbol versioning. My libraries don't use symbol versioning yet, but I'm after general solution here. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --DSayHWYpDlRfCAAQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGJWHwACgkQForvXbEpPzTp0wCgqgK9lNTPOxzvPlExqSAW3Zfh 19IAoMl/ibO1jY+71/ip6+9h+bFn7MKO =P/nh -----END PGP SIGNATURE----- --DSayHWYpDlRfCAAQ--