summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-13 01:41:33 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-10-13 11:07:25 +0200
commitccf5162e448b4dc6b930ce0354a60253ff70fbc2 (patch)
tree387a8e883984e2ffe49e4d1ca1bcf45feaf26d77 /external
parentuse -flto=auto for gcc if no $PARALLELISM is set (diff)
downloadcore-ccf5162e448b4dc6b930ce0354a60253ff70fbc2.tar.gz
core-ccf5162e448b4dc6b930ce0354a60253ff70fbc2.zip
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 <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/hunspell/ExternalProject_hunspell.mk10
1 files changed, 9 insertions, 1 deletions
diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk
index 91fd5c431ef8..51b693b06e08 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -21,6 +21,13 @@ hunspell_CPPFLAGS+=-D_GLIBCXX_DEBUG
endif
endif
+hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \
+ $(gb_EMSCRIPTEN_CPPFLAGS) \
+ $(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 +35,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) $(gb_EMSCRIPTEN_CPPFLAGS) $(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)