Date: Thu, 6 Nov 2014 07:35:16 -0700 From: Warner Losh <imp@bsdimp.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: Konstantin Belousov <kostikbel@gmail.com>, arch@freebsd.org, "Simon J. Gerraty" <sjg@juniper.net> Subject: Re: Overlinking in base Message-ID: <0A3B2AAE-91A7-4F79-BC3C-2463E3AF6C68@bsdimp.com> In-Reply-To: <20141106130555.GP10388@ivaldir.etoilebsd.net> References: <20141105113839.GG10388@ivaldir.etoilebsd.net> <20141105125431.GD53947@kib.kiev.ua> <20141105125931.GJ10388@ivaldir.etoilebsd.net> <20141105133029.GH53947@kib.kiev.ua> <20141105134006.GL10388@ivaldir.etoilebsd.net> <3912.1415233494@chaos> <20141106130555.GP10388@ivaldir.etoilebsd.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_212DDC0F-7FF5-4146-A5C7-DC090AE62788 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Nov 6, 2014, at 6:05 AM, Baptiste Daroussin <bapt@freebsd.org> wrote: > On Wed, Nov 05, 2014 at 04:24:54PM -0800, Simon J. Gerraty wrote: >> Baptiste Daroussin <bapt@freebsd.org> wrote: >>> In the second case we could do it via make(1) >>> LIBADD=3D liba libc libc >>> this will open something like a ${PATHTOTHELIB}/link.mk which will = define >>> DYNAMIC_ADD >>> STATIC_ADD >>>=20 >>> And this could be recursive. >>=20 >> We do something like that in the Junos build >>=20 >> prog makefile might have DPLIBS+=3D ${LIBFOO} >> which is exactly equivalent to >>=20 >> LDADD+=3D -lfoo >> DPADD+=3D ${LIBFOO} >>=20 >> but ensures that they stay in sync (not so important now with meta >> mode). >>=20 >> bsd.libnames.mk can then have >>=20 >> DPLIBS_libfoo +=3D ${LIBGOO} >> DPLIBS_libgoo +=3D ${LIBZOO} >>=20 >> All of which is processed by dpadd.mk which you can find in >> contrib/bmake/mk >> Though dpadd.mk ignores DPLIBS_libgoo +=3D ${LIBZOO} if LIBZOO has = already >> been added. >>=20 > I'am about to add something based on the following principle: > https://people.freebsd.org/~bapt/plop.diff >=20 > With a bit more changes >=20 > The version I have now (a bit different from the patch now :)) allows = multiple > things: >=20 > 1/ simplify the Makefile for users: > LIBADD=3D m archive util > instead of > DPADD=3D ${LIBM} ${LIBARCHIVE} ${LIBUTIL} > LDADD=3D -lm -larchive -lutil >=20 > 2/ ensure dependencies are automatically tracked > For example -lucl needs -lm adding LIBADD=3D ucl does the magic by = itself >=20 > 3/ allow to build any single binary statically so far I'm able to = build > everything is bin sbin usr.bin and usr.sbin statically (which wasn't = doable > before) >=20 > 3/ hides the private/internal lib from the final user > Do more need to say USEPRIVATELIB because I do use a libunbound it is = automatic Generally I like this. One issue though about dependencies: Is there a tool to manage them? How = do we know if things are wrong? Will a simple buildworld always detect that, or do we need to do a = buildworld with static linking? Warner --Apple-Mail=_212DDC0F-7FF5-4146-A5C7-DC090AE62788 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUW4ckAAoJEGwc0Sh9sBEA2ngP/Rq8V09YhmYXAsUkQxal+3k1 nb3Ci3WELWatZtfJNMbQkheQGylmiJBf1PDBJkR8Cqmr7rX3/3nPrNpf/YQAX8E/ 34BmHCJ6F1QImrdZnEbjdgh8mDhwdSPsMlOuGepAqeeXZMU/ws3H38FcjfdAXu23 er2AAAHcATEFuO6fZKafug5ILae2mWQ75NvE1bOY9fUNm3ESJ7mT9bEF15//1SGl G8df1ae/Y2NSTZIpEY6PxkA0iMilP8b8L5gX7eqlSnuraCv0/HSUuJLqIc5r1Yfb dIyUtoADrzu42PeE9jTR7qwO00nLL8+hfA2mlGZaV4T/0d+errxjWaql6q6FS9J8 XaJRdIZfT0w5pG665LzTL3WEyNjv3ro8kx9EN7uqbTlz+Z9uPjGfTCuWs76d3u8R oujxo5wuTID+JltqRzLB/gGQ2HpU/FKjKXOnjC9dIJrzuUqNuUOhE7kdS/2Jyoi3 vUmjnQ9IVACdxx/lJqaTqt4GyiDgu7dtIpnFdpyZeSI7e7wmP3TSrZuRbrQ4mcAi QeOwy8n28qWqxB/bldxM8DJXEdKUn5xNzGXRV0ogK6OBAvIV4kGKMU6GU15w4ofh 5IBB+AUOG0l3GRr+YznNwHf+1MrX5pwCp19XAA0nvCJGPqmZhTPkIMqx5+iqFVJX X+2+ebG9IP30c9iomYdV =ZAJ8 -----END PGP SIGNATURE----- --Apple-Mail=_212DDC0F-7FF5-4146-A5C7-DC090AE62788--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0A3B2AAE-91A7-4F79-BC3C-2463E3AF6C68>