[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 3 commits - android/Bootstrap bridges/source desktop/source include/osl sal/android

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 9 08:38:04 UTC 2019


 android/Bootstrap/Makefile.shared                |    2 +-
 android/Bootstrap/version.map                    |    2 ++
 bridges/source/cpp_uno/gcc3_linux_arm/except.cxx |    3 ---
 desktop/source/lib/init.cxx                      |    4 ++--
 include/osl/detail/android-bootstrap.h           |    4 ++++
 sal/android/lo-bootstrap.c                       |    7 +++++++
 6 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit 875a1fb46293cd9209bd557b4a4f154bf091d9cb
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Mon Feb 18 13:25:40 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Oct 9 10:37:13 2019 +0200

    android: Expose setting of the JavaVM.
    
    Needed when we use the liblo-native-code as a library.
    
    Change-Id: Ia4d1d72f2203a96d1196d015b521201919bbb165
    Reviewed-on: https://gerrit.libreoffice.org/67965
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/80268
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/osl/detail/android-bootstrap.h b/include/osl/detail/android-bootstrap.h
index 5a5c7fcbd82d..169f3efaf282 100644
--- a/include/osl/detail/android-bootstrap.h
+++ b/include/osl/detail/android-bootstrap.h
@@ -35,6 +35,10 @@ int lo_apk_closedir(lo_apk_dir *dirp);
 
 int lo_apk_lstat(const char *path, struct stat *statp);
 
+/// "libreofficekit_" prefix, because it is exported from the .so, when we are
+/// initializing the JNI externally.
+void libreofficekit_set_javavm(JavaVM *vm);
+
 JavaVM *lo_get_javavm(void);
 
 const char *lo_get_app_data_dir(void);
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index d1ecd810ab19..0af8cfbb4cd3 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -898,6 +898,13 @@ Java_org_libreoffice_android_Bootstrap_address_1of_1direct_1byte_1buffer(JNIEnv
 }
 
 __attribute__ ((visibility("default")))
+void
+libreofficekit_set_javavm(JavaVM *vm)
+{
+    the_java_vm = vm;
+}
+
+__attribute__ ((visibility("default")))
 JavaVM *
 lo_get_javavm(void)
 {
commit daab05979f275c87b036571a4b42ffbfd3b35f63
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Feb 14 14:54:02 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Oct 9 10:36:53 2019 +0200

    android: Generate liblo-native-code.so so that it can be linked against.
    
    And used for LibreOfficeKit directly, without a JNI wrapper.
    
    Change-Id: If4231f53b579417b6c9c90b39541193bf2e8f27c
    Reviewed-on: https://gerrit.libreoffice.org/67874
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/80267

diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index f77679853d39..942f5f8179ee 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -59,7 +59,7 @@ WHOLELIBS = \
 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
 	@echo "Linking $@"
 	mkdir -p $(OBJLOCAL)
-	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi -landroid_support $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
+	$(CXX) -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -Wl,-soname,liblo-native-code.so -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi -landroid_support $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
 
 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
 	mkdir -p $(SODEST)
diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map
index 067785410a7a..de561bfc296b 100644
--- a/android/Bootstrap/version.map
+++ b/android/Bootstrap/version.map
@@ -3,6 +3,7 @@ dummy {
         Java_*;
         JNI_OnLoad;
         _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
+        libreofficekit_hook*;
     local:
         *;
 };
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index cf59037fcb3f..5fafd6c2a25a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5624,7 +5624,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
     return bInitialized;
 }
 
-SAL_DLLPUBLIC_EXPORT
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_url)
 {
     if (!gImpl)
@@ -5640,7 +5640,7 @@ LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user
     return static_cast<LibreOfficeKit*>(gImpl);
 }
 
-SAL_DLLPUBLIC_EXPORT
+SAL_JNI_EXPORT
 LibreOfficeKit *libreofficekit_hook(const char* install_path)
 {
     return libreofficekit_hook_2(install_path, nullptr);
commit 3c92b4d430e02eb7784166a69dcec029d4d8c026
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 11 14:33:18 2018 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Oct 9 10:36:32 2019 +0200

    Export RTTI symbols from liblo-native-code.so, for binary UNO bridge
    
    This will become important when switching armeabi-v7a to
    libc++/libc++abi/libunwind (coming soon) which uses address instead of string
    comparison when checking for type equality, so that exceptions thrown from the
    binary UNO bridge will need to use the exact same RTTI objects as referenced
    from the compiled catch clauses.
    
    Change-Id: If8bcb39212b5f5e154aee215cb5f471fe2dc4a7b
    Reviewed-on: https://gerrit.libreoffice.org/64965
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/80266
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/Bootstrap/version.map b/android/Bootstrap/version.map
index e12d9985e78f..067785410a7a 100644
--- a/android/Bootstrap/version.map
+++ b/android/Bootstrap/version.map
@@ -2,6 +2,7 @@ dummy {
      global:
         Java_*;
         JNI_OnLoad;
+        _ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions
     local:
         *;
 };
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index 9de606a8c6bf..251fbe09857f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -148,9 +148,6 @@ namespace CPPU_CURRENT_NAMESPACE
             rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
 #else
             rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
-            // Unfortunately dlsym for weak symbols doesn't work in
-            // Android 4.0 at least, sigh, so we will always take the
-            // else branch below.
 #endif
 
             if (rtti)


More information about the Libreoffice-commits mailing list