summaryrefslogtreecommitdiff
path: root/solenv/gbuild/LinkTarget.mk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-11-29 08:32:42 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-12-02 07:39:52 +0100
commit45d93ea9273a59053f60471ee82bb9fbd2d46c97 (patch)
tree493f006d0266107a4ddaa93e42f71777d6016c27 /solenv/gbuild/LinkTarget.mk
parent6052d7b6e488250545653adcec541095a3d33300 (diff)
Fix clang-cl -Zc:dllexportInlines- build
That flag is only supported by clang-cl, not by MSVC, and c7c9f3f57a2feae5d3bc3c47104786883ed09e44 "use clang-cl's -Zc:dllexportInlines- for clang-cl builds" apparently naively assumed that it would work to build LO with clang-cl and that flag without actually trying it out, and 1040228c356d75c5228cde4d6103f9b446848e4b "My clang-cl build does not work with -Zc:dllexportInlines-" effectively disabled it completely. The way to avoid unresolved external symbols during linking of URE libraries (see the 1040228c356d75c5228cde4d6103f9b446848e4b commit message) is apparently to also build libraries that the URE libraries depend on with the flag, hence the change from gb_Library_set_is_ure_library to gb_Library_set_is_ure_library_or_dependency. For now, I only marked those additional libraries (unoil and xmlreader) that actually caused issues when linking the URE libraries. Change-Id: I3a85c73246250981cd86b7ee41f87b41f393a4b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126012 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'solenv/gbuild/LinkTarget.mk')
-rw-r--r--solenv/gbuild/LinkTarget.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index a5306eeb38b9..3b02bb635400 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -2099,8 +2099,12 @@ endef # gb_LinkTarget_use_vclmain
# Used by URE libraries that need to keep binary compatibility.
# Reset some flags that make sense for our internal libraries but might
# break public ABI.
-# call gb_LinkTarget_set_is_ure_library,linktarget,,linktargetmakefilename
-define gb_LinkTarget_set_is_ure_library
+# (clang-cl's -Zc:dllexportInlines- would not only be a problem for the URE libraries themselves but
+# also for any libraries they depend on. While that does not appear to be a problem for -Zc:inline
+# for neither MSVC nor clang-cl, it should not really hurt to also switch that off not only for the
+# URE libraries themselves but also for their dependencies.)
+# call gb_LinkTarget_set_is_ure_library_or_dependency,linktarget,,linktargetmakefilename
+define gb_LinkTarget_set_is_ure_library_or_dependency
$(call gb_LinkTarget_add_cxxflags,$(1),$(gb_CXXFLAGS_ZCINLINE_OFF))
ifeq ($(HAVE_DLLEXPORTINLINES),TRUE)
$(call gb_LinkTarget_add_cxxflags,$(1),-Zc:dllexportInlines)