From owner-dev-commits-ports-main@freebsd.org Mon Oct 4 13:31:11 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D85D867F082; Mon, 4 Oct 2021 13:31:11 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HNM735kMGz4mrY; Mon, 4 Oct 2021 13:31:11 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from mail.j.mat.cc (owncloud.cube.mat.cc [IPv6:2a01:678:4:1::228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.mat.cc", Issuer "R3" (verified OK)) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 900CA24DBB; Mon, 4 Oct 2021 13:31:11 +0000 (UTC) (envelope-from mat@freebsd.org) Received: from aching.in.mat.cc (unknown [IPv6:2a01:678:42:0:bdf4:2e83:8ff:e8ad]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mat@mat.cc) by mail.j.mat.cc (Postfix) with ESMTPSA id 31D61942D81; Mon, 4 Oct 2021 13:31:07 +0000 (UTC) Date: Mon, 4 Oct 2021 15:30:56 +0200 From: Mathieu Arnold To: Piotr Kubaj Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: fb5f03a87cf4 - main - Mk/bsd.lto.mk: add global LTO support for ports Message-ID: <20211004133056.z7e2iyrhlwprvvvp@aching.in.mat.cc> References: <202109301834.18UIYKrL013410@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xhizztom6vhxchs6" Content-Disposition: inline In-Reply-To: <202109301834.18UIYKrL013410@gitrepo.freebsd.org> X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2021 13:31:11 -0000 --xhizztom6vhxchs6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2021 at 06:34:20PM +0000, Piotr Kubaj wrote: > The branch main has been updated by pkubaj: >=20 > URL: https://cgit.FreeBSD.org/ports/commit/?id=3Dfb5f03a87cf432751fae1f0a= e7f29c9d4fc65917 >=20 > commit fb5f03a87cf432751fae1f0ae7f29c9d4fc65917 > Author: Piotr Kubaj > AuthorDate: 2021-09-30 18:27:50 +0000 > Commit: Piotr Kubaj > CommitDate: 2021-09-30 18:27:50 +0000 >=20 > Mk/bsd.lto.mk: add global LTO support for ports > =20 > It's well known that LTO provides both performance and size benefits = for > binaries. > =20 > Add preliminary, opt-in support for global LTO enforcement to ports. = Ports that > provide LTO option on their own and the ones that don't work with LTO= will need > to set LTO_UNSAFE in the future. > =20 > PR: 258536 Not to be picky about approval and all, but this was added to the framework, and the framework is maintained by portmgr. When you want to add something to it, you must consult with portmgr before anything gets committed. In that case, we would have told you not to do it this way, but to make this a Mk/Uses/lto.mk. So please, turn this into a USES=3Dlto. > --- > Mk/bsd.lto.mk | 10 ++++++++++ > Mk/bsd.port.mk | 4 ++++ > 2 files changed, 14 insertions(+) >=20 > diff --git a/Mk/bsd.lto.mk b/Mk/bsd.lto.mk > new file mode 100644 > index 000000000000..c2a079ea28bb > --- /dev/null > +++ b/Mk/bsd.lto.mk > @@ -0,0 +1,10 @@ > +# LTO Support > + > +LTO_Include_MAINTAINER=3D pkubaj@FreeBSD.org > + > +.if !defined(LTO_UNSAFE) > +# Overridable as a user may want to use -flto > +LTO_CFLAGS?=3D -flto=3Dthin > +CFLAGS+=3D ${LTO_CFLAGS} > +CXXFLAGS+=3D ${LTO_CFLAGS} > +.endif > diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk > index 337d3f6be6a6..493b15a59fff 100644 > --- a/Mk/bsd.port.mk > +++ b/Mk/bsd.port.mk > @@ -1799,6 +1799,10 @@ INSTALL_TARGET:=3D ${INSTALL_TARGET:S/^install-str= ip$/install/g} > .endif > .endif > =20 > +.if defined(USE_LTO) > +.include "${PORTSDIR}/Mk/bsd.lto.mk" > +.endif > + > .if !defined(WITHOUT_SSP) > .include "${PORTSDIR}/Mk/bsd.ssp.mk" > .endif >=20 --=20 Mathieu Arnold --xhizztom6vhxchs6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEVhwchfRfuV0unqO5KesJApEdfgIFAmFbAgFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDU2 MUMxQzg1RjQ1RkI5NUQyRTlFQTNCOTI5RUIwOTAyOTExRDdFMDIACgkQKesJApEd fgKPhg//VcrjnQxv5SM0lyID8P0JkXHf6ZZAadfPPX5h6TvlaYDguRm2/K+5Fes+ YO7QQvXna1q4caOH+zoR+uUKyFsB/aiH193VFqg6Qw1tlG8sX5RnW+jtBdignSh/ HWvRNPWYxeMgdN8uTMv8vQwcYdB4XOZw2dEDcsiimAH19Kp5FOWG6izZY5JzDh2d REzPt58SYb/utOFUywc7lRZHI/DQBiRts1zYs9qOvAu5NQprXPVXpWQyrFA7J+f8 MUnFN5jCVDXAK42rk0YLB9TgHaa+47QrdSn7VSppFbHYvbvY9f576g7xzLPLXDxy pbwlGgUEdhqHIAEXst6TvyTHdxQLvzQzXVcSR7D5yc9h0TWdA7jlO0Hou86t0TnW L618d73P1aCHB+aDeQ+V6LzNCv0vAR/1Y8p8SP+gD+C2UnOU63yplbkyxJwBIeBo TGodKtcmk9hYVNQXOA5gA3dBYz515oSy3N3uwPRJ4gghlKYiiJ3urzkqdPwyUY46 e2aUcB7DBXzpkbGAQu7WoV97L4RkJyeTy+KW2kC4MGoSzTHexuwlgZSl9gz12MX0 c6Al3MZcYNLIYi2n0Pprclb2+dUEp3uMf8NoZ987SuDNGDopnxOUc+KpiOre/pQP nV6EFWFVYwF4qC1+6bKtzA/clq5+z23+beq0cFAkxnbPvWIsiO8= =Zwkz -----END PGP SIGNATURE----- --xhizztom6vhxchs6--