include/LibreOfficeKit/LibreOfficeKitInit.h    |   18 +++++++++---------
 solenv/gbuild/extensions/pre_MergedLibsList.mk |    4 +++-
 2 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 8102adc10fff4c43a0ccc55b1a5c9dd7d40649a6
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Mon Jul 14 21:02:29 2025 +0300
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Dec 2 09:56:37 2025 +0100

    Don't even try to load a clearly bogus sofficeapp library
    
    If it is smaller than 1000 bytes it can't be real, it must be the
    dummy text file in the --enable-mergelibs case.
    
    Change-Id: Ib3a913830bf34dc1e17955626576e72f5f7cd2d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194592
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h 
b/include/LibreOfficeKit/LibreOfficeKitInit.h
index 5fae1e012ec7..4ee1f8e5a97d 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -217,15 +217,13 @@ static void *lok_dlopen( const char *install_path, char 
** _imp_lib )
     imp_lib[partial_length++] = SEPARATOR;
     strncpy(imp_lib + partial_length, TARGET_LIB, imp_lib_size - 
partial_length);
 
-    dlhandle = lok_loadlib(imp_lib);
-    if (!dlhandle)
+    struct stat st;
+    // If TARGET_LUB exists but is ridiculously small, it is the
+    // one-line text stub as in the --enable-mergedlib case.
+    if (stat(imp_lib, &st) == 0 && st.st_size > 1000)
     {
-        // If TARGET_LIB exists, and likely is a real library (not a
-        // small one-line text stub as in the --enable-mergedlib
-        // case), but dlopen failed for some reason, don't try
-        // TARGET_MERGED_LIB.
-        struct stat st;
-        if (stat(imp_lib, &st) == 0 && st.st_size > 100)
+        dlhandle = lok_loadlib(imp_lib);
+        if (!dlhandle)
         {
             char *pErrMessage = lok_dlerror();
             fprintf(stderr, "failed to open library '%s': %s
",
@@ -234,7 +232,9 @@ static void *lok_dlopen( const char *install_path, char ** 
_imp_lib )
             free(imp_lib);
             return NULL;
         }
-
+    }
+    else
+    {
         strncpy(imp_lib + partial_length, TARGET_MERGED_LIB, imp_lib_size - 
partial_length);
 
         dlhandle = lok_loadlib(imp_lib);
commit 74fe24a7064d13c7c277d254a0ba35ac82001514
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Mon Jul 14 11:31:05 2025 +0300
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Dec 2 09:56:27 2025 +0100

    Make avmediawin conditional on AVMEDIA
    
    Change-Id: I2cdec861d840d5987a70c26fd1b61ba1f39f0a30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194591
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk 
b/solenv/gbuild/extensions/pre_MergedLibsList.mk
index 8f1d4a2df777..568bfa9e64d8 100644
--- a/solenv/gbuild/extensions/pre_MergedLibsList.mk
+++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk
@@ -10,7 +10,9 @@
 # we link all object files from these libraries into one, merged library
 gb_MERGE_LIBRARY_LIST := \
        avmedia \
-       $(if $(filter WNT,$(OS)),avmediawin) \
+       $(call gb_Helper_optional,AVMEDIA, \
+               $(if $(filter WNT,$(OS)),avmediawin) \
+       ) \
        $(call gb_Helper_optional,SCRIPTING, \
                basctl \
                basprov \

Reply via email to