Skip to content

Commit

Permalink
allow linking mergedlib on win by removing duplicate libs from comman…
Browse files Browse the repository at this point in the history
…dline

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>
  • Loading branch information
cloph committed Sep 30, 2017
1 parent 13df377 commit 4991945
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions solenv/gbuild/platform/com_MSC_class.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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,\
Expand Down Expand Up @@ -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} \
Expand Down

0 comments on commit 4991945

Please sign in to comment.