solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |    2 ++
 solenv/gbuild/platform/unxgcc.mk               |   10 ++++++----
 solenv/gbuild/static.mk                        |    2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 7a80b68cb0b279a1b43f769169aaf2a2659dc150
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Nov 14 20:16:41 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 28 16:23:06 2022 +0100

    WASM gbuild: write link dependencies into a file $@.linkdeps
    
    The static build was added in commit
    dc9ccf3d8f294cd7ae9d5bece7b6c16c3b22f6a5 and commit
    b04be559ddf4a7f0a5cdc0b9abc2bcfc4aae25cc and there are several files
    written to workdir/LinkTarget/*/*.d.{libraries,externals,statics}
    that list all the (recursive) dependencies of a LinkTarget.
    
    Unfortunately the content of these files requires gbuild to interpret,
    because it's using the Library names which may not map 1:1 to file
    names, not to mention "externals"; this is all resolved by calls to
    gb_LinkTarget_use_* anyway.
    
    To get a command line that's usable outside of gbuild, write another
    file $@.linkdeps as a side effect of gb_LinkTarget__command_dynamiclink.
    
    Change-Id: I94f31142413561dcdb56fa722a4517f84fcd7d61
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143393
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 61424f72c44f..35a136b2f38d 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -64,6 +64,7 @@ gb_COMPILERNOOPTFLAGS := -O1 -fstrict-aliasing 
-fstrict-overflow
 # cleanup addition JS and wasm files for binaries
 define gb_Executable_Executable_platform
 $(call gb_LinkTarget_add_auxtargets,$(2),\
+        $(patsubst %.lib,%.linkdeps,$(3)) \
         $(patsubst %.lib,%.wasm,$(3)) \
         $(patsubst %.lib,%.js,$(3)) \
         $(patsubst %.lib,%.worker.js,$(3)) \
@@ -75,6 +76,7 @@ endef
 
 define gb_CppunitTest_CppunitTest_platform
 $(call gb_LinkTarget_add_auxtargets,$(2),\
+        $(patsubst %.lib,%.linkdeps,$(3)) \
         $(patsubst %.lib,%.wasm,$(3)) \
         $(patsubst %.lib,%.js,$(3)) \
         $(patsubst %.lib,%.worker.js,$(3)) \
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index cc377a5b4309..5e971bd8944c 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -152,10 +152,12 @@ $(call gb_Helper_abbreviate_dirs,\
                $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat 
$(extraobjectlist)`) \
                $(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
                    -Wl$(COMMA)--start-group \
-                   $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst 
%.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call 
gb_Library_get_filename,$(lib)))))) \
-                   $(foreach lib,$(LINKED_STATIC_LIBS),$(call 
gb_StaticLibrary_get_target,$(lib))) \
-                   $(patsubst $(gb_LinkTarget__syslib),%,$(T_LIBS)) \
-                   $(if $(call 
gb_LinkTarget__NeedsCxxLinker),$(T_STDLIBS_CXX)) \
+                       $(shell echo -n \
+                               $(patsubst lib%.a,-l%,$(patsubst 
lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach 
lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \
+                               $(foreach lib,$(LINKED_STATIC_LIBS),$(call 
gb_StaticLibrary_get_target,$(lib))) \
+                               $(patsubst 
$(gb_LinkTarget__syslib),%,$(T_LIBS)) \
+                               $(if $(call 
gb_LinkTarget__NeedsCxxLinker),$(T_STDLIBS_CXX)) \
+                               | tee $@.linkdeps) \
                    -Wl$(COMMA)--end-group \
                , \
                    -Wl$(COMMA)--start-group \
diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk
index faa9a73db516..9b98ec99c593 100644
--- a/solenv/gbuild/static.mk
+++ b/solenv/gbuild/static.mk
@@ -51,7 +51,7 @@
 # doesn't seem to happen in any breaking way and it works to link multiple 
Executable
 # with large and small expanded dependency lists.
 #
-# Then there is the special static "components" library, which simply depends 
on all build
+# Then there is the special static "components" library, which simply depends 
on all built
 # components. In theory these could be limited per-module (Writer, Calc, 
etc.), but currently
 # this is not implemented and instead solenv/bin/native-code.py is used, so 
actually
 # everything is build and "cleaned up" at link time, which is especially 
expensive for WASM.

Reply via email to