Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Feb 2021 11:02:21 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r566388 - head/editors/libreoffice
Message-ID:  <202102231102.11NB2LRf048580@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Tue Feb 23 11:02:21 2021
New Revision: 566388
URL: https://svnweb.freebsd.org/changeset/ports/566388

Log:
  editors/libreoffice: add LTO option
  
  LLD fails to link libreoffice, so ld.bfd needs to be used. Since LLVMgold.so (used for LTO with binutils) is not included in base, LLVM from ports needs to be used.
  
  PR:		253777
  Approved by:	fluffy (maintainer)

Modified:
  head/editors/libreoffice/Makefile

Modified: head/editors/libreoffice/Makefile
==============================================================================
--- head/editors/libreoffice/Makefile	Tue Feb 23 10:28:03 2021	(r566387)
+++ head/editors/libreoffice/Makefile	Tue Feb 23 11:02:21 2021	(r566388)
@@ -117,7 +117,7 @@ USE_OPENLDAP=	yes
 USE_PERL5=	build
 USE_XORG=	ice sm x11 xaw xcb xext xinerama xrandr xrender
 
-OPTIONS_DEFINE=	COINMP CUPS DOCS GNOME GTK3 JAVA KF5 MMEDIA PGSQL QT5 SDK TEST WEBDAV
+OPTIONS_DEFINE=	COINMP CUPS DOCS GNOME GTK3 JAVA KF5 LTO MMEDIA PGSQL QT5 SDK TEST WEBDAV
 OPTIONS_DEFAULT=	CUPS MMEDIA QT5
 
 .if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mssl=*}
@@ -200,6 +200,8 @@ KF5_USE=	kde=config,coreaddons,i18n,kio,windowsystem
 KF5_USES=	kde:5
 KF5_IMPLIES=	QT5
 
+LTO_CONFIGURE_ENABLE=	lto
+
 MMEDIA_CONFIGURE_ENABLE=	gstreamer-1-0
 MMEDIA_USE=	GSTREAMER1=yes
 
@@ -285,6 +287,14 @@ EXTRA_PATCHES+=	${FILESDIR}/powerpc64
 
 .if ${ARCH} == powerpc || ${ARCH} == powerpcspe || ${ARCH} == powerpc64
 CONFIGURE_ARGS+=	--disable-skia
+.endif
+
+.if ${PORT_OPTIONS:MLTO} && ${CHOSEN_COMPILER_TYPE} == clang
+CPP=	${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT}
+CC=	${LOCALBASE}/bin/clang${LLVM_DEFAULT}
+CXX=	${LOCALBASE}/bin/clang++${LLVM_DEFAULT}
+BUILD_DEPENDS+=	${LOCALBASE}/bin/clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
+LLD_UNSAFE=	yes
 .endif
 
 .if ${CHOSEN_COMPILER_TYPE} == clang



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102231102.11NB2LRf048580>