From nobody Tue Oct 05 16:27:15 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8CCA212BFB93; Tue, 5 Oct 2021 16:27:29 +0000 (UTC) (envelope-from pkubaj@anongoth.pl) Received: from mail.anongoth.pl (mail.anongoth.pl [46.248.190.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X448 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anongoth.pl", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP30044J9z3N23; Tue, 5 Oct 2021 16:27:28 +0000 (UTC) (envelope-from pkubaj@anongoth.pl) Received: from anongoth.pl (unknown [192.168.1.15]) (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 did not present a certificate) (Authenticated sender: pkubaj@anongoth.pl) by mail.anongoth.pl (Postfix) with ESMTPSA id 8A651D68A1; Tue, 5 Oct 2021 18:27:17 +0200 (CEST) Date: Tue, 5 Oct 2021 18:27:15 +0200 From: Piotr Kubaj To: Mathieu Arnold 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: References: <202109301834.18UIYKrL013410@gitrepo.freebsd.org> <20211004133056.z7e2iyrhlwprvvvp@aching.in.mat.cc> List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iwM4d1D6ZNW0Gu9/" Content-Disposition: inline In-Reply-To: <20211004133056.z7e2iyrhlwprvvvp@aching.in.mat.cc> X-Rspamd-Queue-Id: 4HP30044J9z3N23 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=reject) header.from=anongoth.pl; spf=pass (mx1.freebsd.org: domain of pkubaj@anongoth.pl designates 46.248.190.61 as permitted sender) smtp.mailfrom=pkubaj@anongoth.pl X-Spamd-Result: default: False [-5.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[pkubaj]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip4:46.248.190.61]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[anongoth.pl,reject]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:47544, ipnet:46.248.160.0/19, country:PL]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N --iwM4d1D6ZNW0Gu9/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 21-10-04 15:30:56, Mathieu Arnold wrote: > 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=3Dfb5f03a87cf432751fae1f= 0ae7f29c9d4fc65917 > >=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 benefit= s for > > binaries. > > =20 > > Add preliminary, opt-in support for global LTO enforcement to ports= =2E Ports that > > provide LTO option on their own and the ones that don't work with L= TO will need > > to set LTO_UNSAFE in the future. > > =20 > > PR: 258536 >=20 > 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. >=20 > In that case, we would have told you not to do it this way, but to make > this a Mk/Uses/lto.mk. >=20 > So please, turn this into a USES=3Dlto. I did consult, but no one replied. IMO adding it to USES is not a good idea, since USES are supposed to be use= d per port and my idea was to force LTO for all ports, same way that SSP al= ready does. >=20 > > --- > > 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-s= trip$/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 > --=20 > Mathieu Arnold --iwM4d1D6ZNW0Gu9/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEycyIeNkkgohzsoorelmbhSCDnJ0FAmFcfOMACgkQelmbhSCD nJ2CKQ//XNcrghMilYBZczVgzxQG1nszGAHJu6QzxwEy328brKSjSlprpLwPr4fq WMCPvqhovKdiVYkQq5zjEA7/lnbYxhIzya2N6iw0vpplvBRv55H4n/dUGtErwZXx mFxd4ob7ytvVp4Pf81JsbdFtZcpFCxLXDSbLD7xpjMULc9h7k86ZC6whmD5p/X7D An6ttMieM7gg2SBV2czJtzG8FR9LxS4QH7kruVs3scodQRVuqvrZrwejVIpt+b1d eaL8jIRDn6SowoMkwJ1Gtjsuc6uESwWmz8avFpmLq3W6ZeMjGq8yLal/M7elN06v aTeAX0VUy01aSDwri8iLkAbj9Eu4ia0NsmZgV29MvBHwt1SXZgVr4OTZYRp2oCC0 WOOH794U9qTUm2EHgPBr8+WxoqBM35Zfavcl5yJb4wtJetk3dMdLU4W732hxlX/K IzEw8CB4h2BKNQ79eUMmHSDttyO6nxH9PKQACmhJcamtnWNX4uicKPGS0mUlkC82 UJcecGfhdPnpe3/4Dqb4+Vqnl7u0eqtZ+FRb6EMTSIPw7DyubUeOUU6kH6sFhwxL db7op9e0swY3atBpLP31fq4QFbyXuK1VOwp6KiKGpUqD+D4Wuvevo9jHcdNFlRqj 4/72hYf7nBdt3Sw8nCn/+JrKjfCTzGZu5caTO59FqcpRK93CkZs= =1a60 -----END PGP SIGNATURE----- --iwM4d1D6ZNW0Gu9/--