external/hunspell/ExternalProject_hunspell.mk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit f732e20b5704b1fe13d7247d208892c65e74847a
Author:     Luboš Luňák <[email protected]>
AuthorDate: Wed Oct 13 01:41:33 2021 +0200
Commit:     Luboš Luňák <[email protected]>
CommitDate: Sat Oct 23 18:39:03 2021 +0200

    use LTO to build hunspell if LTO is enabled
    
    Without this, LTO gcc build may fail while linking libmerged because
    of an undefined reference to `std::string::append(char const*)',
    which looks like a gcc bug because std::string should be a template,
    but whatever, this makes it build.
    
    Change-Id: I173cc0c773d5957a0c4a9cecc74c1ab33afad7db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123541
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124082
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index 43da1c254e34..e80475c9837b 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -21,6 +21,12 @@ hunspell_CPPFLAGS+=-D_GLIBCXX_DEBUG
 endif
 endif
 
+hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \
+       $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+       $(if $(debug),$(gb_DEBUGINFO_FLAGS))
+
+hunspell_LDFLAGS:=$(gb_LTOFLAGS)
+
 $(call gb_ExternalProject_get_state_target,hunspell,build):
        $(call gb_Trace_StartRange,hunspell,EXTERNAL)
        $(call gb_ExternalProject_run,build,\
@@ -28,7 +34,8 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
                        $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM))\
                        $(if $(filter 
AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
                        $(if 
$(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
-                       CXXFLAGS="$(CXXFLAGS) $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if 
$(debug),$(gb_DEBUGINFO_FLAGS))" \
+                       $(if 
$(hunspell_CXXFLAGS),CXXFLAGS='$(hunspell_CXXFLAGS)') \
+                       $(if $(hunspell_LDFLAGS),LDFLAGS='$(hunspell_LDFLAGS)') 
\
                && cd src/hunspell && $(MAKE) \
        )
        $(call gb_Trace_EndRange,hunspell,EXTERNAL)

Reply via email to