summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-09-29 21:04:36 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-09-30 08:19:00 +0200
commit499194508c8cf91fbbc21f882bcf4ace77e19eaa (patch)
treef5b3f6ba057fbe7bd30c95e4beabb50ac024d62f
parent13df3777e4b6ff7537692b396be67a5fd2b9b001 (diff)
allow linking mergedlib on win by removing duplicate libs from commandline
adding advapi 62 times, icuuc 24 times and libxml2 18 times (and others multiple times as well) is too much for cygwin to handle and breaks the build when trying to link mergedlo.dll with the not-very telling "/usr/bin/sh: -c: line 1: syntax error: unexpected end of file" (especially since the latter are added with $W/UnpackedTarball/whatever) uses the sideeffect of make's sort to remove the duplicates Change-Id: I9e92aafa0df9518520793a5827fb6cc157538f4b Reviewed-on: https://gerrit.libreoffice.org/42953 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index cd1bd0408ef0..b6f2c38d1cb5 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -148,6 +148,8 @@ else
MSC_SUBSYSTEM_VERSION=$(COMMA)5.01
endif
+# the sort on the libraries is used to filter out duplicates to keep commanline
+# length in check - otherwise the dupes easily hit the limit when linking mergedlib
define gb_LinkTarget__command
$(call gb_Output_announce,$(2),$(true),LNK,4)
$(call gb_Helper_abbreviate_dirs,\
@@ -176,10 +178,10 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x64)) \
$(T_LDFLAGS) \
@$${RESPONSEFILE} \
- $(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_ilibfilename,$(lib))) \
- $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_filename,$(lib))) \
+ $(foreach lib,$(sort $(LINKED_LIBS)),$(call gb_Library_get_ilibfilename,$(lib))) \
+ $(foreach lib,$(sort $(LINKED_STATIC_LIBS)),$(call gb_StaticLibrary_get_filename,$(lib))) \
$(if $(filter-out StaticLibrary,$(TARGETTYPE)),\
- $(T_LIBS) user32.lib \
+ $(sort $(T_LIBS)) user32.lib \
-manifestfile:$(WORKDIR)/LinkTarget/$(2).manifest \
-pdb:$(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/$(2))) \
$(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \