diff --git a/libreoffice.changes b/libreoffice.changes index f7a05b5..50bb9f2 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 17 09:26:37 UTC 2018 - tchvatal@suse.com + +- Do not enable LTO on older codestreams, too old toolchain + ------------------------------------------------------------------- Fri Apr 13 10:49:46 UTC 2018 - tchvatal@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index d92dcd6..125f9bc 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -24,6 +24,12 @@ %define external_url http://dev-www.libreoffice.org/src/ %define tarball_url http://download.documentfoundation.org/libreoffice/src/6.0.3 #%define tarball_url http://dev-builds.libreoffice.org/pre-releases/src/ +# LTO needs newer toolchain stack only +%if 0%{?suse_version} >= 1500 +%bcond_without lto +%else +%bcond_with lto +%endif # Enable the kde integration on openSUSE only %if 0%{?is_opensuse} %bcond_without kdeintegration @@ -929,9 +935,13 @@ echo "HTML_TIMESTAMP = NO" >> odk/docs/idl/Doxyfile source %{_sysconfdir}/profile.d/alljava.sh # use RPM_OPT_FLAGS, ... # remove big debugsymbols as we simply consume too much space +%if %{with lto} ARCH_FLAGS="`echo %{optflags} -flifetime-dse=1 | sed -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g$/ -g1/g'`" -CFLAGS="$ARCH_FLAGS -flifetime-dse=1" -CXXFLAGS="$ARCH_FLAGS -flifetime-dse=1" +%else +ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g$/ -g1/g'`" +%endif +CFLAGS="$ARCH_FLAGS" +CXXFLAGS="$ARCH_FLAGS" export ARCH_FLAGS CFLAGS CXXFLAGS # Colada does not have .pc file and configure creator was really lazy @@ -951,7 +961,9 @@ export NOCONFIGURE=yes %configure \ --with-parallelism=%{jobs} \ --enable-eot \ +%if %{with lto} --enable-lto \ +%endif --enable-mergelibs \ --docdir=%{_docdir}/%{name} \ --with-compat-oowrappers \