solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |    2 +-
 vcl/qt5/QtInstance.cxx                         |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 73c46041a4d0c2f7c3a0cd5d7819a6cd298e941b
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Thu Oct 17 14:11:13 2024 +0200
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Thu Oct 17 21:08:05 2024 +0200

    Adapt experimental Emscripten --enable-qt6 to recent Qt6 upstream
    
    At least when building against recent upstream dev branch, qtloader.js 
needs FS
    due to
    
<https://github.com/qt/qtbase/commit/64007c749703090ebf7f9b1b49b4267bb9993b99>
    "wasm: add 'preload' qtloader config property"
    
    Change-Id: Ie505d531670649635774152032123389b6d106ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175085
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 4df8414e919f2ff82429dfa302db9cd2d1261b26)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175043
    Tested-by: allotropia jenkins <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index 4951bb1cae03..b80471427940 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -27,7 +27,7 @@ gb_EMSCRIPTEN_LDFLAGS += -sSTACK_SIZE=131072 
-sDEFAULT_PTHREAD_STACK_SIZE=65536
 # To keep the link time (and memory) down, prevent all rewriting options from 
wasm-emscripten-finalize
 # See emscripten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
-gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s 
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
 $(ENABLE_QT6),$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
+gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s 
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","ccall","cwrap","addOnPreMain","addOnPostRun","registerType","throwBindingError"$(if
 $(ENABLE_QT6),$(COMMA)"FS"$(COMMA)"callMain"$(COMMA)"specialHTMLTargets")]
 gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS 
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
commit a394c36dc5c425b65964230ed5fb9844f34580f8
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Thu Oct 17 14:13:01 2024 +0200
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Thu Oct 17 21:07:53 2024 +0200

    Fix experimental Emscripten --enable-qt6 build resource issues
    
    ...where window decoration icons and menu text glyphs were missing
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175088
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 7be32268e086e122e64f7aa12566b6a092c63d20)
    Conflicts:
            vcl/qt5/QtInstance.cxx
    
    Change-Id: Iadff019a99fbe96442fc010df0d019ba5e2b98e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175046
    Tested-by: allotropia jenkins <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index d3ae92b82d78..2840e6e9d5d2 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -48,6 +48,7 @@
 #include <vclpluginapi.h>
 #include <tools/debug.hxx>
 #include <comphelper/flagguard.hxx>
+#include <config_vclplug.h>
 #include <dndhelper.hxx>
 #include <vcl/sysdata.hxx>
 #include <sal/log.hxx>
@@ -64,6 +65,9 @@
 #ifdef EMSCRIPTEN
 #include <QtCore/QtPlugin>
 Q_IMPORT_PLUGIN(QWasmIntegrationPlugin)
+#if defined DISABLE_DYNLOADING && ENABLE_QT6
+#include <QtCore/QtResource>
+#endif
 #endif
 
 namespace
@@ -764,9 +768,23 @@ void QtInstance::setActivePopup(QtFrame* pFrame)
     m_pActivePopup = pFrame;
 }
 
+static void initResources()
+{
+#if defined EMSCRIPTEN && defined DISABLE_DYNLOADING && ENABLE_QT6
+    // Make sure the resources from Qt6's plugins/platforms/libqwasm.a are not 
stripped out of a
+    // statically linked binary (and this code cannot be directly in extern 
"C" create_SalInstance,
+    // as the expansion of Q_INIT_RESOURCE contains extern function 
declarations that would then
+    // erroneously be C function declarations):
+    Q_INIT_RESOURCE(wasmfonts);
+    Q_INIT_RESOURCE(wasmwindow);
+#endif
+}
+
 extern "C" {
 VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance()
 {
+    initResources();
+
     std::unique_ptr<char* []> pFakeArgv;
     std::unique_ptr<int> pFakeArgc;
     std::vector<FreeableCStr> aFakeArgvFreeable;

Reply via email to