git: 501e1ed88f97 - main - x11/foot: enable LTO by default

Jan Beich jbeich at FreeBSD.org
Mon Aug 30 17:31:52 UTC 2021


The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=501e1ed88f97d99d1e367812ae99fb4e352eeb3c

commit 501e1ed88f97d99d1e367812ae99fb4e352eeb3c
Author:     Jan Beich <jbeich at FreeBSD.org>
AuthorDate: 2021-08-30 13:43:04 +0000
Commit:     Jan Beich <jbeich at FreeBSD.org>
CommitDate: 2021-08-30 17:31:16 +0000

    x11/foot: enable LTO by default
    
    7% faster at least with default config under Sway.
    
    Inspired by:    Arch Linux
---
 x11/foot/Makefile | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/x11/foot/Makefile b/x11/foot/Makefile
index 864946204c51..1dbbd33d5ce4 100644
--- a/x11/foot/Makefile
+++ b/x11/foot/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	foot
 DISTVERSION=	1.9.0
+PORTREVISION=	1
 CATEGORIES=	x11
 MASTER_SITES=	https://codeberg.org/dnkl/${PORTNAME}/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
 
@@ -22,12 +23,20 @@ USES=		compiler:c11 meson pkgconfig xorg
 USE_XORG=	pixman
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
-OPTIONS_DEFINE=	DOCS NOTIFY UTF8PROC XDG
-OPTIONS_DEFAULT=NOTIFY UTF8PROC XDG
+OPTIONS_DEFINE=	DOCS LTO NOTIFY UTF8PROC XDG
+OPTIONS_DEFAULT=LTO NOTIFY UTF8PROC XDG
+OPTIONS_EXCLUDE+=	${CC:T:Mgcc*:C/.+/LTO/} # undefined reference to `xstrdup'
+OPTIONS_EXCLUDE_powerpc64=	${"${/usr/bin/ld:L:tA}"==/usr/bin/ld.lld:?LTO:} # LLVM bug 47353
 
 DOCS_BUILD_DEPENDS=	scdoc:textproc/scdoc
 DOCS_MESON_ENABLED=	docs
 
+LTO_MESON_TRUE=		b_lto
+.if exists(/usr/bin/ld.lld) && ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
+# --plugin isn't supported by old GNU ld.bfd in base
+LTO_LDFLAGS=		-fuse-ld=lld
+.endif
+
 NOTIFY_RUN_DEPENDS=	notify-send:devel/libnotify
 
 UTF8PROC_DESC=		Grapheme clustering using libutf8proc


More information about the dev-commits-ports-main mailing list