RepositoryExternal.mk                          |    4 ++--
 solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |    2 ++
 solenv/gbuild/platform/unxgcc.mk               |   10 ++++++----
 solenv/gbuild/static.mk                        |    2 +-
 4 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit c5820f9b2dead3860d86a79a98210e7092e06af2
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 14 20:16:41 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.

diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 52ad474f086c..7b5f8e8af5b3 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 b0612aca4e4d..f436fea10ff6 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 1b7f0214900a..2e088d1bb06d 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.
commit 53780616744bd2b09daa4a6f0b81400f1a4c7f51
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Nov 14 20:08:33 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 14 20:15:15 2022 +0100

    WASM cairo: link static lib directly
    
    Because bundled cairo is only used on Android currently, and that does
    static linking, this doesn't make a difference for LO build.
    
    But it does improve the situation when linking the bundled cairo via
    libtool, because libtool unhelpfully finds libcairo.la via -lcairo,
    which contains an unhelpful dependency_libs that includes "-lz", which
    does not exist anywhere (LO's bundled one is called libzlib.a).
    
    Ideally GNU libtool could be told to ignore .la files, but i don't know
    how.

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 025909c36945..9a0eb56b1a7b 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1213,8 +1213,8 @@ $(call gb_LinkTarget_set_include,$(1),\
        $$(INCLUDE) \
 )
 $(call gb_LinkTarget_add_libs,$(1),\
-       -L$(call gb_UnpackedTarball_get_dir,cairo)/src/.libs -lcairo \
-               -L$(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs 
-lpixman-1 \
+       $(call gb_UnpackedTarball_get_dir,cairo)/src/.libs/libcairo.a \
+       $(call gb_UnpackedTarball_get_dir,pixman)/pixman/.libs/libpixman-1.a \
 )
 
 endef

Reply via email to