[Libreoffice-commits] .: 21 commits - android/Bootstrap android/experimental configure.in cppuhelper/source distro-configs/LibreOfficeAndroid.conf distro-configs/LibreOfficeAndroidX86.conf sal/android sal/inc sal/Package_inc.mk solenv/gbuild solenv/inc starmath/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Oct 11 00:16:41 PDT 2012
android/Bootstrap/Makefile.shared | 3
android/Bootstrap/src/org/libreoffice/android/Bootstrap.java | 64
android/experimental/DocumentLoader/Makefile | 110 -
android/experimental/DocumentLoader/native-code.cxx | 100 +
android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java | 11
android/experimental/LibreOffice4Android/Makefile | 123 -
android/experimental/LibreOffice4Android/native-code.cxx | 100 +
android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java | 6
android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java | 5
configure.in | 6
cppuhelper/source/shlib.cxx | 21
distro-configs/LibreOfficeAndroid.conf | 1
distro-configs/LibreOfficeAndroidX86.conf | 1
sal/Package_inc.mk | 1
sal/android/lo-bootstrap.c | 760 ----------
sal/inc/osl/detail/android-bootstrap.h | 17
sal/inc/osl/detail/component-mapping.h | 62
sal/inc/osl/detail/ios-bootstrap.h | 14
solenv/gbuild/platform/android.mk | 66
solenv/inc/unxand.mk | 2
starmath/source/accessibility.cxx | 2
21 files changed, 457 insertions(+), 1018 deletions(-)
New commits:
commit 82bba1a2b3b8274f8282c8c8b4ab31857a1e60b6
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 17:59:24 2012 +0300
Drop confusing comment
Change-Id: Ic702abecf1bd21893bd5d4dee532d2e342985e6e
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 28ecce6..d9e7c88 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -183,7 +183,6 @@ uninstall:
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
run:
-# /data/local/tmp/sample-document.odt
adb shell am start -n org.libreoffice.android.examples/.DocumentLoader -e input /assets/test1.odt
commit b9bef032ce65ac392a9d73e6d548496719869f32
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 17:59:10 2012 +0300
COPYSO should not be used with DISABLE_DYNLOADING
Change-Id: I0e04cd8fe35a487b85cd3abd420d24ab2a55821a
diff --git a/android/Bootstrap/Makefile.shared b/android/Bootstrap/Makefile.shared
index f1a7aa9..e0bd143 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -15,8 +15,7 @@ SODEST=libs/$(ANDROID_APP_ABI)
OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
define COPYSO
-cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
-cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
+ $(error COPYSO should not be used now with DISABLE_DYNLOADING)
endef
define COPYJAR
commit 5476c14de5701478b2c36ca170ec4d713be18612
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 17:45:27 2012 +0300
Adapt to disable-dynloading style
No need to load any native libraries here any more.
For now, using the same native-code.cxx as over in ../DocumentLoader
works. In other words, we end up with the same code in
liblo-native-code.so. This will obviously change if/when the UNO APIs
that are called start to differ.
Change-Id: Ia47ce833c5a290a93986005f92e981c89f63bf71
diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile
index 3f0be60..f81e814 100644
--- a/android/experimental/LibreOffice4Android/Makefile
+++ b/android/experimental/LibreOffice4Android/Makefile
@@ -1,102 +1,36 @@
include ../../../config_host.mk
-include ../../Bootstrap/Makefile.shared
-# The package of this app
-APP_PACKAGE=org.libreoffice
+LIBS = \
+ -Wl,--start-group \
+ $(wildcard $(OUTDIR)/lib/lib*.a) \
+ -Wl,--end-group
+
+WHOLELIBS = \
+ -Wl,--whole-archive \
+ $(addprefix -l,$(strip \
+ juh \
+ )) \
+ -Wl,--no-whole-archive
# The default target just builds.
all: build-ant
+include ../../Bootstrap/Makefile.shared
+
+# The package of this app
+APP_PACKAGE=org.libreoffice
+
+link-so:
+# Build the single .so for this app
+ mkdir -p $(OBJLOCAL)
+ $(CXX) -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz
+ mkdir -p $(SODEST)
+ cp $(OBJLOCAL)/liblo-native-code.so $(SODEST)
+ $(STRIP) --strip-debug $(SODEST)/liblo-native-code.so
+
copy-stuff:
-# First always clean
- rm -rf libs $(OBJLOCAL)
- mkdir -p $(SODEST) $(OBJLOCAL)
-#
-# Copy shared libraries (including UNO components) we need to
-# libs/$(ANDROID_APP_ABI) so that ant will include them in the .apk.
-#
-# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
-# them.
-#
- for F in $(strip \
- basegfxlo \
- bootstrap.uno \
- chartcontrollerlo \
- chartcorelo \
- comphelpgcc3 \
- dbaxmllo \
- dbtoolslo \
- expwrap.uno \
- frmlo \
- gcc3_uno \
- i18nisolang1gcc3 \
- icudatalo \
- icui18nlo \
- iculelo \
- icuuclo \
- introspection.uno \
- java_uno \
- juh \
- juhx \
- jvmaccessgcc3 \
- jvmfwk \
- libotouchlo \
- lo-bootstrap \
- localedata_en \
- localedata_es \
- localedata_euro \
- localedata_others \
- lwpftlo \
- mergedlo \
- msfilterlo \
- mswordlo \
- ooxlo \
- reflection.uno \
- reg \
- sclo \
- sclo \
- scdlo \
- scfiltlo \
- sdlo \
- sddlo \
- smdlo \
- stocservices.uno \
- store \
- svgfilterlo \
- swdlo \
- swlo \
- swdlo \
- t602filterlo \
- textinstream.uno \
- tllo \
- ucbhelper4gcc3 \
- ucppkg1 \
- uno_cppu \
- uno_cppuhelpergcc3 \
- uno_sal \
- uno_salhelpergcc3 \
- uno_cppuhelpergcc3 \
- unordflo \
- unoxmllo \
- vbahelperlo \
- vbaswobj.uno \
- wpftdrawlo \
- wpftwriterlo \
- xml2 \
- xmlfdlo \
- xmlreader \
- xmlsecurity \
- xoflo \
- xslt \
- ); do \
- $(call COPYSO,$(OUTDIR)/lib/lib$${F}.so); \
- done
-#
-# Then the shared GNU C++ library
- $(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ANDROID_APP_ABI)/libgnustl_shared.so)
-#
-# Then other "assets". Let the directory structure under assets mimic
+# Then "assets". Let the directory structure under assets mimic
# that under solver for now.
#
# Please note that I have no idea what all of this is really necessary and for
@@ -195,10 +129,11 @@ copy-stuff:
#
# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
#
+ mkdir -p $(SODEST)
cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
-build-ant: copy-stuff properties
+build-ant: copy-stuff link-so properties
echo sdk.dir=$(ANDROID_SDK_HOME) >../../abs-lib/local.properties
# ActionBarSherlock uses the v4 support library, apparently one needs to copy
# it like this for it to be found
@@ -221,6 +156,4 @@ build-ant: copy-stuff properties
unset JAVA_HOME && $(ANT) debug
run:
-# /data/local/tmp/sample-document.odt
-# add -e lo-strace to strace
- adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e lo-strace -e input /assets/test1.odt
+ adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e input /assets/test1.odt
diff --git a/android/experimental/LibreOffice4Android/native-code.cxx b/android/experimental/LibreOffice4Android/native-code.cxx
new file mode 100644
index 0000000..d4ef4b0
--- /dev/null
+++ b/android/experimental/LibreOffice4Android/native-code.cxx
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "osl/detail/android-bootstrap.h"
+
+extern "C"
+{
+ extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * evtatt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fileacc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * frm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fsstorage_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * hyphen_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lng_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lnth_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sb_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * smd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+}
+
+extern "C"
+__attribute__ ((visibility("default")))
+const lib_to_component_mapping *
+lo_get_libmap(void)
+{
+ static lib_to_component_mapping map[] = {
+ { "libavmedialo.a", avmedia_component_getFactory },
+ { "libdbaxmllo.a", dbaxml_component_getFactory },
+ { "libevtattlo.a", evtatt_component_getFactory },
+ { "libfileacc.a", fileacc_component_getFactory },
+ { "libfrmlo.a", frm_component_getFactory },
+ { "libfsstorage.uno.a", fsstorage_component_getFactory },
+ { "libfwklo.a", fwk_component_getFactory },
+ { "libfwllo.a", fwl_component_getFactory },
+ { "libfwmlo.a", fwm_component_getFactory },
+ { "libhwplo.a", hwp_component_getFactory },
+ { "libhyphenlo.a", hyphen_component_getFactory },
+ { "liblnglo.a", lng_component_getFactory },
+ { "liblnthlo.a", lnth_component_getFactory },
+ { "liblwpftlo.a", lotuswordpro_component_getFactory },
+ { "libooxlo.a", oox_component_getFactory },
+ { "libscdlo.a", scd_component_getFactory },
+ { "libscfiltlo.a", scfilt_component_getFactory },
+ { "libsblo.a", sb_component_getFactory },
+ { "libsclo.a", sc_component_getFactory },
+ { "libsddlo.a", sdd_component_getFactory },
+ { "libsdlo.a", sd_component_getFactory },
+ { "libsmdlo.a", smd_component_getFactory },
+ { "libsmlo.a", sm_component_getFactory },
+ { "libsvgfilterlo.a", svgfilter_component_getFactory },
+ { "libswdlo.a", swd_component_getFactory },
+ { "libswlo.a", sw_component_getFactory },
+ { "libt602filterlo.a", t602filter_component_getFactory },
+ { "libtextfdlo.a", textfd_component_getFactory },
+ { "libunordflo.a", unordf_component_getFactory },
+ { "libunoxmllo.a", unoxml_component_getFactory },
+ { "libwpftdrawlo.a", wpftdraw_component_getFactory },
+ { "libwpftwriterlo.a", wpftwriter_component_getFactory },
+ { "libxmlfdlo.a", xmlfd_component_getFactory },
+ { "libxmlsecurity.a", xmlsecurity_component_getFactory },
+ { "libxoflo.a", xof_component_getFactory },
+ { "libxolo.a", xo_component_getFactory },
+ { NULL, NULL }
+ };
+
+ return map;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java
index 5fc3fad..601e583 100644
--- a/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java
+++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/android/DocumentLoader.java
@@ -961,12 +961,6 @@ public class DocumentLoader
// Avoid all the old style OSL_TRACE calls especially in vcl
Bootstrap.putenv("SAL_LOG=+WARN+INFO-INFO.legacy.osl");
- // Load a lot of shlibs here explicitly in advance because that
- // makes debugging work better, sigh
- Bootstrap.dlopen("libmergedlo.so");
- Bootstrap.dlopen("libswdlo.so");
- Bootstrap.dlopen("libswlo.so");
-
// Log.i(TAG, "Sleeping NOW");
// Thread.sleep(20000);
diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index 70ca6f6..d47d255 100644
--- a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -139,11 +139,6 @@ public class LibreOfficeUIActivity extends SherlockActivity implements ActionBar
Bootstrap.putenv("SAL_LOG=yes");
- // Load a lot of shlibs here explicitly in advance because that
- // makes debugging work better, sigh
- Bootstrap.dlopen("libmergedlo.so");
- Bootstrap.dlopen("libswdlo.so");
- Bootstrap.dlopen("libswlo.so");
}
public void createUI(){
commit 3a5d6a9ac395a0fa86d1ef0965ecba573513f19b
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 14:42:06 2012 +0300
Just use the wildcard function to list all the libs
It doesn't seem to be any slower. (Note that we are *not* using
-Wl,--whole-archive around these libs so it won't link in them in
total, but only what's needed.)
Change-Id: I2cc090562fc910d3375c6293f1f4358c68a6f9f3
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 42a1c1e..28ecce6 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -25,193 +25,7 @@ endef
LIBS = \
-Wl,--start-group \
- $(addprefix -l,$(strip \
- acclo \
- ascii_expat_xmlparse \
- avmedialo \
- basctllo \
- basebmp \
- basegfxlo \
- bootstrap.uno \
- canvastoolslo \
- cdrlib \
- collator_data \
- comphelpgcc3 \
- configmgr.uno \
- cppcanvaslo \
- crypto \
- cuilo \
- dbalo \
- dbaxmllo \
- dbtoolslo \
- dbulo \
- deploymentmisclo \
- dict_ja \
- dict_zh \
- drawinglayerlo \
- editenglo \
- egilo \
- emelo \
- epblo \
- epglo \
- epplo \
- epslo \
- eptlo \
- eralo \
- etilo \
- evtattlo \
- expat_xmlparse \
- expat_xmltok \
- explo \
- expwrap.uno \
- fastsax.uno \
- fileacc \
- filterconfiglo \
- fontconfig \
- forlo \
- foruilo \
- freetype \
- frmlo \
- fsstorage.uno \
- fwelo \
- fwilo \
- fwklo \
- fwllo \
- fwmlo \
- gcc3_uno \
- hunspell-1.3 \
- hwplo \
- hyphen \
- hyphenlo \
- i18nisolang1gcc3 \
- i18npool.uno \
- i18nregexplo \
- i18nsearch.uno \
- i18nutilgcc3 \
- icdlo \
- icglo \
- icudata \
- icui18n \
- icule \
- icutu \
- icuuc \
- idxlo \
- imelo \
- index_data \
- introspection.uno \
- ipblo \
- ipdlo \
- ipslo \
- iptlo \
- ipxlo \
- iralo \
- itglo \
- itilo \
- java_uno \
- jpeg \
- jvmaccessgcc3 \
- jvmfwk \
- lcms2 \
- libotouchlo \
- lnglo \
- lnthlo \
- lo-bootstrap \
- localebe1.uno \
- localedata_en \
- localedata_es \
- localedata_euro \
- localedata_others \
- loglo \
- log_uno_uno \
- lpsolve55 \
- lwpftlo \
- msfilterlo \
- mspublib \
- mswordlo \
- mythes-1.2 \
- ooxlo \
- orcus \
- package2 \
- raptor \
- rasqal \
- rdf \
- reflection.uno \
- reg \
- saxlo \
- sax_shared \
- sblo \
- sclo \
- scdlo \
- scfiltlo \
- scuilo \
- sddlo \
- sdfiltlo \
- sdlo \
- sduilo \
- sfxlo \
- smdlo \
- smlo \
- sotlo \
- spelllo \
- spllo \
- stocservices.uno \
- store \
- sunjavaplugin \
- svgfilterlo \
- svllo \
- svtlo \
- svxcorelo \
- svxlo \
- swdlo \
- swlo \
- swuilo \
- t602filterlo \
- textconv_dict \
- textconversiondlgslo \
- textfdlo \
- textinstream.uno \
- textoutstream.uno \
- tklo \
- tllo \
- ucb1 \
- ucbhelper4gcc3 \
- ucpfile1 \
- ucppkg1 \
- ulingu \
- uno_cppu \
- uno_cppuhelpergcc3 \
- uno_sal \
- uno_salhelpergcc3 \
- uno_cppuhelpergcc3 \
- unordflo \
- unoxmllo \
- utllo \
- uuilo \
- vbahelperlo \
- vbaswobj.uno \
- vcllo \
- visiolib \
- wpdlib \
- wpftdrawlo \
- wpftwriterlo \
- wpglib \
- wpslib \
- writerfilterlo \
- writerperfect \
- xml2 \
- xmlfalo \
- xmlfdlo \
- xmlreader \
- xmlscriptlo \
- xmlsecurity \
- xoflo \
- xolo \
- xsec_fw \
- xslt \
- xsltdlglo \
- xsltfilterlo \
- xstor \
- )) \
+ $(wildcard $(OUTDIR)/lib/lib*.a) \
-Wl,--end-group
WHOLELIBS = \
commit cc61d191cbdc673b218a29fc158826d6cc9bfa0d
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 13:10:20 2012 +0300
Merge (manually) change from master
Factor out the common part from the ANDROID_*_GCC.mk files into an anrdoid.mk.
Make the DISABLE_DYNLOADING-specific bits conditional.
Change-Id: If41065fbc096dfae01819ac8fabf4b21e95545ca
diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk
index 58e7029..4b88864 100644
--- a/solenv/gbuild/platform/android.mk
+++ b/solenv/gbuild/platform/android.mk
@@ -7,10 +7,22 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+# Link with -lgnustl_static
+gb_STDLIBS := \
+ gnustl_static
+
+gb_Library_PLAINLIBS_NONE := \
+ android \
+ gnustl_static \
+
+else
# Link almost everything with -lgnustl_shared
gb_STDLIBS := \
-lgnustl_shared \
+endif
+
# No unit testing can be run
gb_CppunitTest_CPPTESTPRECOMMAND := :
@@ -45,6 +57,28 @@ $(call gb_Helper_abbreviate_dirs,\
-o $(1))
endef
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+
+# Library class
+
+gb_Library_DEFS :=
+gb_Library_SYSPRE := lib
+gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
+gb_Library_PLAINEXT := .a
+gb_Library_DLLEXT := .a
+gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
+
+gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+
+gb_Library_PLAINLIBS_NONE += \
+ jpeg \
+ m \
+ pthread \
+ z \
+
+endif
+
# Prefix UNO library filenames with "lib"
gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
@@ -58,6 +92,38 @@ gb_Library_FILENAMES := \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ifeq ($(DISABLE_DYNLOADING),TRUE)
+
+gb_Library_FILENAMES += \
+ $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+
+gb_Library_LAYER := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \
+ $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \
+
+define gb_Library_Library_platform
+$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1))
+
+endef
+
+# CppunitTest class
+
+gb_CppunitTest_EXT := .a
+
+define gb_LinkTarget__command
+$(call gb_Output_announce,$(2),$(true),LNK,4)
+$(call gb_LinkTarget__command_staticlink,$(1))
+endef
+
+endif
+
# No DT_RPATH or DT_RUNPATH support in the Bionic dynamic linker so
# don't bother generating such.
commit 96ee8e4dce03d56b9133d91fd9f178bae479ec21
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 12:27:22 2012 +0300
More libraries
Now the DocumentLoader test app seems to work like it does with all
the separate DSOs, knock on wood. The only "attempting to load unknown
library" message I see in logcat is for libspelllo.a, and I
deliberately don't have a mapping for that. A viewer application
presumably has no use for spell checking. (I do link in the
hyphenation stuff, that affects rendering, and we want the rendering
to match LO on the desktop.)
Change-Id: I1ad9eedf352eb0af1187bdfdc71f8f1754912600
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 3c1ebbd..42a1c1e 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -59,11 +59,13 @@ LIBS = \
eptlo \
eralo \
etilo \
+ evtattlo \
expat_xmlparse \
expat_xmltok \
explo \
expwrap.uno \
fastsax.uno \
+ fileacc \
filterconfiglo \
fontconfig \
forlo \
@@ -77,7 +79,10 @@ LIBS = \
fwllo \
fwmlo \
gcc3_uno \
+ hunspell-1.3 \
hwplo \
+ hyphen \
+ hyphenlo \
i18nisolang1gcc3 \
i18npool.uno \
i18nregexplo \
@@ -109,6 +114,7 @@ LIBS = \
lcms2 \
libotouchlo \
lnglo \
+ lnthlo \
lo-bootstrap \
localebe1.uno \
localedata_en \
@@ -122,6 +128,7 @@ LIBS = \
msfilterlo \
mspublib \
mswordlo \
+ mythes-1.2 \
ooxlo \
orcus \
package2 \
@@ -145,6 +152,7 @@ LIBS = \
smdlo \
smlo \
sotlo \
+ spelllo \
spllo \
stocservices.uno \
store \
@@ -169,6 +177,7 @@ LIBS = \
ucbhelper4gcc3 \
ucpfile1 \
ucppkg1 \
+ ulingu \
uno_cppu \
uno_cppuhelpergcc3 \
uno_sal \
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index cae7b52..d4ef4b0 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -13,12 +13,20 @@ extern "C"
{
extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * evtatt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fileacc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * frm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fsstorage_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * hyphen_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lng_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lnth_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sb_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -49,14 +57,22 @@ lo_get_libmap(void)
static lib_to_component_mapping map[] = {
{ "libavmedialo.a", avmedia_component_getFactory },
{ "libdbaxmllo.a", dbaxml_component_getFactory },
+ { "libevtattlo.a", evtatt_component_getFactory },
+ { "libfileacc.a", fileacc_component_getFactory },
+ { "libfrmlo.a", frm_component_getFactory },
+ { "libfsstorage.uno.a", fsstorage_component_getFactory },
{ "libfwklo.a", fwk_component_getFactory },
{ "libfwllo.a", fwl_component_getFactory },
{ "libfwmlo.a", fwm_component_getFactory },
{ "libhwplo.a", hwp_component_getFactory },
+ { "libhyphenlo.a", hyphen_component_getFactory },
+ { "liblnglo.a", lng_component_getFactory },
+ { "liblnthlo.a", lnth_component_getFactory },
{ "liblwpftlo.a", lotuswordpro_component_getFactory },
{ "libooxlo.a", oox_component_getFactory },
{ "libscdlo.a", scd_component_getFactory },
{ "libscfiltlo.a", scfilt_component_getFactory },
+ { "libsblo.a", sb_component_getFactory },
{ "libsclo.a", sc_component_getFactory },
{ "libsddlo.a", sdd_component_getFactory },
{ "libsdlo.a", sd_component_getFactory },
commit 6848bcf6e4c19bfbd790e52c76f0b204734238f1
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 9 09:28:46 2012 +0300
More libs
Change-Id: I7921ac41a31f545a74ec2981dda9c30f40d4b4d9
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 2e65f1d..3c1ebbd 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -29,6 +29,7 @@ LIBS = \
acclo \
ascii_expat_xmlparse \
avmedialo \
+ basctllo \
basebmp \
basegfxlo \
bootstrap.uno \
@@ -39,6 +40,7 @@ LIBS = \
configmgr.uno \
cppcanvaslo \
crypto \
+ cuilo \
dbalo \
dbaxmllo \
dbtoolslo \
@@ -51,6 +53,7 @@ LIBS = \
egilo \
emelo \
epblo \
+ epglo \
epplo \
epslo \
eptlo \
@@ -145,6 +148,7 @@ LIBS = \
spllo \
stocservices.uno \
store \
+ sunjavaplugin \
svgfilterlo \
svllo \
svtlo \
@@ -152,6 +156,7 @@ LIBS = \
svxlo \
swdlo \
swlo \
+ swuilo \
t602filterlo \
textconv_dict \
textconversiondlgslo \
commit 5b195fbcf7a441aeb193f6abd08b877e580938e0
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Oct 8 12:00:31 2012 +0300
Even more libs
Change-Id: I055b3d1a3105475883283c32a46141c38ed350fa
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 5addd20..2e65f1d 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -26,6 +26,7 @@ endef
LIBS = \
-Wl,--start-group \
$(addprefix -l,$(strip \
+ acclo \
ascii_expat_xmlparse \
avmedialo \
basebmp \
@@ -47,8 +48,17 @@ LIBS = \
dict_zh \
drawinglayerlo \
editenglo \
+ egilo \
+ emelo \
+ epblo \
+ epplo \
+ epslo \
+ eptlo \
+ eralo \
+ etilo \
expat_xmlparse \
expat_xmltok \
+ explo \
expwrap.uno \
fastsax.uno \
filterconfiglo \
@@ -70,13 +80,25 @@ LIBS = \
i18nregexplo \
i18nsearch.uno \
i18nutilgcc3 \
+ icdlo \
+ icglo \
icudata \
icui18n \
icule \
icutu \
icuuc \
+ idxlo \
+ imelo \
index_data \
introspection.uno \
+ ipblo \
+ ipdlo \
+ ipslo \
+ iptlo \
+ ipxlo \
+ iralo \
+ itglo \
+ itilo \
java_uno \
jpeg \
jvmaccessgcc3 \
@@ -111,9 +133,11 @@ LIBS = \
sclo \
scdlo \
scfiltlo \
+ scuilo \
sddlo \
sdfiltlo \
sdlo \
+ sduilo \
sfxlo \
smdlo \
smlo \
commit 93bff92a58a252d7def0c0964dbb6e8441aac27f
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Oct 7 10:14:08 2012 +0300
Unset HAVE_THREADSAFE_STATICS for Android too, for now
The code generated by cppumaker in the comprehensive case is in fact
broken, says sberg, and this is a way around it until it is fixed.
Change-Id: I0a3950d28e39a83f293f04fad9e0be80e131e3e9
diff --git a/configure.in b/configure.in
index ce0b498..c717881 100644
--- a/configure.in
+++ b/configure.in
@@ -5310,7 +5310,7 @@ if test "$GCC" = "yes"; then
dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
dnl difference there. Conservative advice from Jakub Jelinek is to assume
dnl it working in GCC >= 4.3:
- if test "$_os" = "Darwin" -o "${GCCVER?}" -lt 040300; then
+ if test "$_os" = "Darwin" -o $_os = Android -o "${GCCVER?}" -lt 040300; then
AC_MSG_RESULT([broken (i.e., no)])
else
HAVE_THREADSAFE_STATICS=TRUE
commit d1006596f24dca0186192904200b422d4df15777
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Oct 7 10:13:28 2012 +0300
Update library names for DISABLE_DYNLOADING
Change-Id: I2b5e4abdceea25180c9caafabc49c22077016a05
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 9163b7d..9bbdb8c 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -460,6 +460,7 @@ extern "C"
extern void * filterconfig1_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwk_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * introspection_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * localebe1_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * package2_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * reflection_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sfx_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -532,18 +533,26 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
// First test library names that aren't app-specific.
static lib_to_component_mapping non_app_specific_map[] = {
+ // Sigh, the name under which the bootstrap component is looked for
+ // varies a lot? Or then I just have been confused by some mixed-up
+ // incremental build.
{ "bootstrap.uno" SAL_DLLEXTENSION, bootstrap_component_getFactory },
{ "bootstrap.uno.a", bootstrap_component_getFactory },
- { "configmgr.uno.a", configmgr_component_getFactory },
- { "i18npool.uno.a", i18npool_component_getFactory },
- { "introspection.uno.a", introspection_component_getFactory },
+ { "libbootstrap.uno.a", bootstrap_component_getFactory },
+ // The rest seems to consistently have a "lib" prefix now
+ { "libconfigmgr.uno.a", configmgr_component_getFactory },
{ "libcomphelp" CPPU_STRINGIFY(CPPU_ENV) ".a", comphelp_component_getFactory },
{ "libexpwrap.uno.a", expwrap_component_getFactory },
{ "libfastsax.uno.a", fastsax_component_getFactory },
{ "libfilterconfiglo.a", filterconfig1_component_getFactory },
{ "libfwklo.a", fwk_component_getFactory },
+ { "libi18npool.uno.a", i18npool_component_getFactory },
+ { "libintrospection.uno.a", introspection_component_getFactory },
+ { "liblocalebe1.uno.a", localebe1_component_getFactory },
{ "libpackage2.a", package2_component_getFactory },
+ { "libreflection.uno.a", reflection_component_getFactory },
{ "libsfxlo.a", sfx_component_getFactory },
+ { "libstocservices.uno.a", stocservices_component_getFactory },
{ "libsvllo.a", svl_component_getFactory },
{ "libtklo.a", tk_component_getFactory },
{ "libucb1.a", ucb_component_getFactory },
@@ -551,8 +560,6 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
{ "libutllo.a", utl_component_getFactory },
{ "libvcllo.a", vcl_component_getFactory },
{ "libxstor.a", xstor_component_getFactory },
- { "reflection.uno.a", reflection_component_getFactory },
- { "stocservices.uno.a", stocservices_component_getFactory },
{ NULL, NULL }
};
for (int i = 0; pSym == NULL && non_app_specific_map[i].lib != NULL; ++i)
commit 89372ae703dbebd1140c816a23dd6881eb4861b7
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Oct 7 10:12:32 2012 +0300
More libs
Change-Id: I4f717cfdf8e13044931e6820cc9fe6f74fc8aa7f
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 3919144..5addd20 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -85,6 +85,7 @@ LIBS = \
libotouchlo \
lnglo \
lo-bootstrap \
+ localebe1.uno \
localedata_en \
localedata_es \
localedata_euro \
@@ -99,6 +100,9 @@ LIBS = \
ooxlo \
orcus \
package2 \
+ raptor \
+ rasqal \
+ rdf \
reflection.uno \
reg \
saxlo \
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index 48b0727..cae7b52 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -32,9 +32,11 @@ extern "C"
extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * unordf_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xmlsecurity_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
}
@@ -65,10 +67,12 @@ lo_get_libmap(void)
{ "libswlo.a", sw_component_getFactory },
{ "libt602filterlo.a", t602filter_component_getFactory },
{ "libtextfdlo.a", textfd_component_getFactory },
+ { "libunordflo.a", unordf_component_getFactory },
{ "libunoxmllo.a", unoxml_component_getFactory },
{ "libwpftdrawlo.a", wpftdraw_component_getFactory },
{ "libwpftwriterlo.a", wpftwriter_component_getFactory },
{ "libxmlfdlo.a", xmlfd_component_getFactory },
+ { "libxmlsecurity.a", xmlsecurity_component_getFactory },
{ "libxoflo.a", xof_component_getFactory },
{ "libxolo.a", xo_component_getFactory },
{ NULL, NULL }
commit 8ede8ee2ce73a2495b011075a2c7281f3739268e
Author: Tor Lillqvist <tml at iki.fi>
Date: Sun Oct 7 10:12:22 2012 +0300
Some more logging
Change-Id: Ib901de4a10cb18ce8e1f5d0293c61ab0eed2a4e8
diff --git a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
index 894fdab..e1e7506 100644
--- a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
+++ b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
@@ -597,6 +597,7 @@ public class DocumentLoader
final int level,
final int location)
{
+ Log.i(TAG, "renderPage(" + number + ", " + level + ", " + location + ")");
try {
// Use dummySmallDevice with no scale or offset just to find out
// the paper size of this page.
@@ -727,6 +728,8 @@ public class DocumentLoader
{
int number = params[0];
+ Log.i(TAG, "doInBackground(" + number + ")");
+
if (number >= pageCount)
return -1;
commit c11a906a673762e5a3657d56d119361a9134794d
Author: Tor Lillqvist <tml at iki.fi>
Date: Tue Oct 2 13:35:39 2012 +0300
More libs
Change-Id: I83214fffadf68c6d92e129fd8f89f671fd9bc1c2
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 90d640a..3919144 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -38,8 +38,10 @@ LIBS = \
configmgr.uno \
cppcanvaslo \
crypto \
+ dbalo \
dbaxmllo \
dbtoolslo \
+ dbulo \
deploymentmisclo \
dict_ja \
dict_zh \
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index d859f44..48b0727 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -12,16 +12,20 @@
extern "C"
{
extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * dbaxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * oox_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * smd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -42,16 +46,20 @@ lo_get_libmap(void)
{
static lib_to_component_mapping map[] = {
{ "libavmedialo.a", avmedia_component_getFactory },
+ { "libdbaxmllo.a", dbaxml_component_getFactory },
{ "libfwklo.a", fwk_component_getFactory },
{ "libfwllo.a", fwl_component_getFactory },
{ "libfwmlo.a", fwm_component_getFactory },
{ "libhwplo.a", hwp_component_getFactory },
{ "liblwpftlo.a", lotuswordpro_component_getFactory },
+ { "libooxlo.a", oox_component_getFactory },
{ "libscdlo.a", scd_component_getFactory },
{ "libscfiltlo.a", scfilt_component_getFactory },
{ "libsclo.a", sc_component_getFactory },
{ "libsddlo.a", sdd_component_getFactory },
{ "libsdlo.a", sd_component_getFactory },
+ { "libsmdlo.a", smd_component_getFactory },
+ { "libsmlo.a", sm_component_getFactory },
{ "libsvgfilterlo.a", svgfilter_component_getFactory },
{ "libswdlo.a", swd_component_getFactory },
{ "libswlo.a", sw_component_getFactory },
commit 1c84d69b18abebb141119810f4f3e47378765753
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Oct 1 16:41:50 2012 +0300
Make a function static for deduplication in the DISABLE_DYNLOADING case
Change-Id: Ib05f7b3b9b66f9e1c0b619e6a8b14e253d1adbb7
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 39c5d3a..331790a 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1123,7 +1123,7 @@ void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16)
{
}
-sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
+static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich )
{
std::vector<EECharAttrib> aAttribs;
commit 925b118a263885fc35ba7036c6d4cb3c0f18fae0
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Oct 1 15:52:31 2012 +0300
More libs
Change-Id: I2ea26d46f22620d567a23412d7780a95e2715af2
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 6e12d8b..90d640a 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -59,6 +59,8 @@ LIBS = \
fwelo \
fwilo \
fwklo \
+ fwllo \
+ fwmlo \
gcc3_uno \
hwplo \
i18nisolang1gcc3 \
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index 8c5152b..d859f44 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -11,6 +11,10 @@
extern "C"
{
+ extern void * avmedia_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwk_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwl_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * fwm_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -22,6 +26,7 @@ extern "C"
extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * textfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -36,6 +41,10 @@ const lib_to_component_mapping *
lo_get_libmap(void)
{
static lib_to_component_mapping map[] = {
+ { "libavmedialo.a", avmedia_component_getFactory },
+ { "libfwklo.a", fwk_component_getFactory },
+ { "libfwllo.a", fwl_component_getFactory },
+ { "libfwmlo.a", fwm_component_getFactory },
{ "libhwplo.a", hwp_component_getFactory },
{ "liblwpftlo.a", lotuswordpro_component_getFactory },
{ "libscdlo.a", scd_component_getFactory },
@@ -47,6 +56,7 @@ lo_get_libmap(void)
{ "libswdlo.a", swd_component_getFactory },
{ "libswlo.a", sw_component_getFactory },
{ "libt602filterlo.a", t602filter_component_getFactory },
+ { "libtextfdlo.a", textfd_component_getFactory },
{ "libunoxmllo.a", unoxml_component_getFactory },
{ "libwpftdrawlo.a", wpftdraw_component_getFactory },
{ "libwpftwriterlo.a", wpftwriter_component_getFactory },
commit 602f93da371efc727aabe051cc1b67e8e0f88157
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Oct 1 11:01:38 2012 +0300
Link in more libs
Change-Id: I5e016a061ea4206966757cda2d6681617b45b550
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 95251be..6e12d8b 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -32,6 +32,7 @@ LIBS = \
basegfxlo \
bootstrap.uno \
canvastoolslo \
+ cdrlib \
collator_data \
comphelpgcc3 \
configmgr.uno \
@@ -89,6 +90,7 @@ LIBS = \
lpsolve55 \
lwpftlo \
msfilterlo \
+ mspublib \
mswordlo \
ooxlo \
orcus \
@@ -187,7 +189,7 @@ properties:
link-so:
# Build the single .so for this app
mkdir -p $(OBJLOCAL)
- $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz
+ $(CXX) -Wl,--stats -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz
mkdir -p $(SODEST)
cp $(OBJLOCAL)/liblo-native-code.so $(SODEST)
$(STRIP) --strip-debug $(SODEST)/liblo-native-code.so
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index c85fc3c..8c5152b 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -12,11 +12,16 @@
extern "C"
{
extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * lotuswordpro_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sdd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * svgfilter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * t602filter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -32,11 +37,16 @@ lo_get_libmap(void)
{
static lib_to_component_mapping map[] = {
{ "libhwplo.a", hwp_component_getFactory },
+ { "liblwpftlo.a", lotuswordpro_component_getFactory },
{ "libscdlo.a", scd_component_getFactory },
{ "libscfiltlo.a", scfilt_component_getFactory },
{ "libsclo.a", sc_component_getFactory },
+ { "libsddlo.a", sdd_component_getFactory },
+ { "libsdlo.a", sd_component_getFactory },
+ { "libsvgfilterlo.a", svgfilter_component_getFactory },
{ "libswdlo.a", swd_component_getFactory },
{ "libswlo.a", sw_component_getFactory },
+ { "libt602filterlo.a", t602filter_component_getFactory },
{ "libunoxmllo.a", unoxml_component_getFactory },
{ "libwpftdrawlo.a", wpftdraw_component_getFactory },
{ "libwpftwriterlo.a", wpftwriter_component_getFactory },
commit 8ab89346ba711a3b18ed63ae5e8f61b0451ff9a2
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Sep 24 16:35:50 2012 +0300
Add some more components/libraries
Change-Id: I2dba9bceee4c68b551ed8ed9239e93ea9ae93117
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index a357e6b..95251be 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -142,8 +142,14 @@ LIBS = \
vbahelperlo \
vbaswobj.uno \
vcllo \
+ visiolib \
+ wpdlib \
wpftdrawlo \
wpftwriterlo \
+ wpglib \
+ wpslib \
+ writerfilterlo \
+ writerperfect \
xml2 \
xmlfalo \
xmlfdlo \
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
index 415c673..c85fc3c 100644
--- a/android/experimental/DocumentLoader/native-code.cxx
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -18,6 +18,8 @@ extern "C"
extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * wpftdraw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * wpftwriter_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
@@ -36,6 +38,8 @@ lo_get_libmap(void)
{ "libswdlo.a", swd_component_getFactory },
{ "libswlo.a", sw_component_getFactory },
{ "libunoxmllo.a", unoxml_component_getFactory },
+ { "libwpftdrawlo.a", wpftdraw_component_getFactory },
+ { "libwpftwriterlo.a", wpftwriter_component_getFactory },
{ "libxmlfdlo.a", xmlfd_component_getFactory },
{ "libxoflo.a", xof_component_getFactory },
{ "libxolo.a", xo_component_getFactory },
commit 4b7e701024219be48b7f8154a508c79cb0a6fdc1
Author: Tor Lillqvist <tml at iki.fi>
Date: Mon Sep 24 10:38:43 2012 +0300
Use DISABLE_DYNLOADING on Android
IN this branch these changes are not conditional. Unclear yet whether
this is what we finally will want to use or not. Maybe should make
these changes conditional and do this stuff in master instead?
Change-Id: I379d570a0e00648d295c675fd90eba6594ba3182
diff --git a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
index b97adfb..2c8d2e7 100644
--- a/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
+++ b/android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
@@ -62,21 +62,9 @@ public class Bootstrap extends NativeActivity
String apkFile,
String[] ld_library_path);
- public static native boolean setup(int lo_main_ptr,
- Object lo_main_argument,
+ public static native boolean setup(Object lo_main_argument,
int lo_main_delay);
- // This is not just a wrapper for the C library dlopen(), but also
- // loads recursively dependent libraries.
- public static native int dlopen(String library);
-
- // This is just a wrapper for the C library dlsym().
- public static native int dlsym(int handle, String symbol);
-
- // To be called after you are sure libgnustl_shared.so
- // has been loaded
- static native void patch_libgnustl_shared();
-
// Extracts files in the .apk that need to be extraced into the app's tree
static native void extract_files();
@@ -148,11 +136,6 @@ public class Bootstrap extends NativeActivity
if (!setup(dataDir, activity.getApplication().getPackageResourcePath(), llpa))
return;
- // We build LO code against the shared GNU C++ library
- dlopen("libgnustl_shared.so");
- // and need to patch it.
- patch_libgnustl_shared();
-
// Extract files from the .apk that can't be used mmapped directly from it
extract_files();
@@ -224,35 +207,8 @@ public class Bootstrap extends NativeActivity
System.arraycopy(argv, 0, newargv, 1, argv.length);
argv = newargv;
- // Load the LO "program" here and look up lo_main
- int loLib = dlopen(mainLibrary);
-
- if (loLib == 0) {
- Log.i(TAG, String.format("Error: could not load %s", mainLibrary));
- mainLibrary = "libmergedlo.so";
- loLib = dlopen(mainLibrary);
- if (loLib == 0) {
- Log.i(TAG, String.format("Error: could not load fallback %s", mainLibrary));
- return;
- }
- }
-
- int lo_main = dlsym(loLib, "lo_main");
- if (lo_main == 0) {
- Log.i(TAG, String.format("No lo_main in %s", mainLibrary));
- return;
- }
-
- // Get extra libraries to load early, so that it's easier to debug
- // them even with a buggy ndk-gdb that doesn't grok debugging
- // information from libraries loaded after it has been attached to the
- // process.
- String extraLibs = getIntent().getStringExtra("lo-extra-libs");
- if (extraLibs != null) {
- for (String lib : extraLibs.split(":")) {
- dlopen(lib);
- }
- }
+ // Load the LO "program" here
+ System.loadLibrary(mainLibrary);
// Start a strace on ourself if requested.
@@ -272,7 +228,7 @@ public class Bootstrap extends NativeActivity
delay = Integer.parseInt(sdelay);
// Tell lo-bootstrap.c the stuff it needs to know
- if (!setup(lo_main, argv, delay))
+ if (!setup(argv, delay))
return;
// Finally, call our super-class, NativeActivity's onCreate(),
@@ -286,14 +242,12 @@ public class Bootstrap extends NativeActivity
super.onCreate(savedInstanceState);
}
- // This is used to load the 'lo-bootstrap' library on application
- // startup. The library has already been unpacked into
- // /data/data/<app name>/lib/liblo-bootstrap.so at installation
- // time by the package manager.
+ // Now with static loading we always have all native code in one native
+ // library which we always call liblo-native-code.so, regardless of the
+ // app. The library has already been unpacked into /data/data/<app
+ // name>/lib at installation time by the package manager.
static {
- System.loadLibrary("lo-bootstrap");
- System.loadLibrary("gnustl_shared");
- System.loadLibrary("libotouchlo");
+ System.loadLibrary("lo-native-code");
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index d450409..a357e6b 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -19,15 +19,154 @@ APP_DATA_PATH=/data/data/$(APP_PACKAGE)
SODEST=libs/$(ANDROID_APP_ABI)
OBJLOCAL=obj/local/$(ANDROID_APP_ABI)
-define COPYSO
-cp $(1) $(SODEST)$(if $(2),/$(2)) && $(STRIP) --strip-debug $(SODEST)$(if $(2),/$(2),/$(notdir $(1))) && \
-cp $(1) $(OBJLOCAL)$(if $(2),/$(2))
-endef
-
define COPYJAR
cp $(1) libs
endef
+LIBS = \
+ -Wl,--start-group \
+ $(addprefix -l,$(strip \
+ ascii_expat_xmlparse \
+ avmedialo \
+ basebmp \
+ basegfxlo \
+ bootstrap.uno \
+ canvastoolslo \
+ collator_data \
+ comphelpgcc3 \
+ configmgr.uno \
+ cppcanvaslo \
+ crypto \
+ dbaxmllo \
+ dbtoolslo \
+ deploymentmisclo \
+ dict_ja \
+ dict_zh \
+ drawinglayerlo \
+ editenglo \
+ expat_xmlparse \
+ expat_xmltok \
+ expwrap.uno \
+ fastsax.uno \
+ filterconfiglo \
+ fontconfig \
+ forlo \
+ foruilo \
+ freetype \
+ frmlo \
+ fsstorage.uno \
+ fwelo \
+ fwilo \
+ fwklo \
+ gcc3_uno \
+ hwplo \
+ i18nisolang1gcc3 \
+ i18npool.uno \
+ i18nregexplo \
+ i18nsearch.uno \
+ i18nutilgcc3 \
+ icudata \
+ icui18n \
+ icule \
+ icutu \
+ icuuc \
+ index_data \
+ introspection.uno \
+ java_uno \
+ jpeg \
+ jvmaccessgcc3 \
+ jvmfwk \
+ lcms2 \
+ libotouchlo \
+ lnglo \
+ lo-bootstrap \
+ localedata_en \
+ localedata_es \
+ localedata_euro \
+ localedata_others \
+ loglo \
+ log_uno_uno \
+ lpsolve55 \
+ lwpftlo \
+ msfilterlo \
+ mswordlo \
+ ooxlo \
+ orcus \
+ package2 \
+ reflection.uno \
+ reg \
+ saxlo \
+ sax_shared \
+ sblo \
+ sclo \
+ scdlo \
+ scfiltlo \
+ sddlo \
+ sdfiltlo \
+ sdlo \
+ sfxlo \
+ smdlo \
+ smlo \
+ sotlo \
+ spllo \
+ stocservices.uno \
+ store \
+ svgfilterlo \
+ svllo \
+ svtlo \
+ svxcorelo \
+ svxlo \
+ swdlo \
+ swlo \
+ t602filterlo \
+ textconv_dict \
+ textconversiondlgslo \
+ textfdlo \
+ textinstream.uno \
+ textoutstream.uno \
+ tklo \
+ tllo \
+ ucb1 \
+ ucbhelper4gcc3 \
+ ucpfile1 \
+ ucppkg1 \
+ uno_cppu \
+ uno_cppuhelpergcc3 \
+ uno_sal \
+ uno_salhelpergcc3 \
+ uno_cppuhelpergcc3 \
+ unordflo \
+ unoxmllo \
+ utllo \
+ uuilo \
+ vbahelperlo \
+ vbaswobj.uno \
+ vcllo \
+ wpftdrawlo \
+ wpftwriterlo \
+ xml2 \
+ xmlfalo \
+ xmlfdlo \
+ xmlreader \
+ xmlscriptlo \
+ xmlsecurity \
+ xoflo \
+ xolo \
+ xsec_fw \
+ xslt \
+ xsltdlglo \
+ xsltfilterlo \
+ xstor \
+ )) \
+ -Wl,--end-group
+
+WHOLELIBS = \
+ -Wl,--whole-archive \
+ $(addprefix -l,$(strip \
+ juh \
+ )) \
+ -Wl,--no-whole-archive
+
# The default target just builds.
all: build-ant
@@ -39,87 +178,16 @@ properties:
echo "APP_ABI := $(ANDROID_APP_ABI)" >>jni/Application.mk
echo "APP_PLATFORM := android-14" >>jni/Application.mk
+link-so:
+# Build the single .so for this app
+ mkdir -p $(OBJLOCAL)
+ $(CXX) -Wl,-Map,liblo-native-code.map -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -o $(OBJLOCAL)/liblo-native-code.so -I$(OUTDIR)/inc native-code.cxx -L$(OUTDIR)/lib $(WHOLELIBS) $(LIBS) -lgnustl_static -landroid -llog -lz
+ mkdir -p $(SODEST)
+ cp $(OBJLOCAL)/liblo-native-code.so $(SODEST)
+ $(STRIP) --strip-debug $(SODEST)/liblo-native-code.so
+
copy-stuff:
-# First always clean
- rm -rf libs $(OBJLOCAL)
- mkdir -p $(SODEST) $(OBJLOCAL)
-#
-# Copy shared libraries (including UNO components) we need to
-# libs/$(ANDROID_APP_ABI) so that ant will include them in the .apk.
-#
-# Copy them to obj/local/$(ANDROID_APP_ABI), too, where gdb will look for
-# them.
-#
- for F in $(strip \
- basegfxlo \
- bootstrap.uno \
- comphelpgcc3 \
- dbaxmllo \
- dbtoolslo \
- expwrap.uno \
- frmlo \
- gcc3_uno \
- i18nisolang1gcc3 \
- icudatalo \
- icui18nlo \
- iculelo \
- icuuclo \
- introspection.uno \
- java_uno \
- juh \
- juhx \
- jvmaccessgcc3 \
- jvmfwk \
- libotouchlo \
- lo-bootstrap \
- localedata_en \
- localedata_others \
- lwpftlo \
- mergedlo \
- msfilterlo \
- mswordlo \
- ooxlo \
- reflection.uno \
- reg \
- sclo \
- scdlo \
- scfiltlo \
- sddlo \
- smdlo \
- stocservices.uno \
- store \
- svgfilterlo \
- swdlo \
- swlo \
- t602filterlo \
- textinstream.uno \
- tllo \
- ucbhelper4gcc3 \
- ucppkg1 \
- uno_cppu \
- uno_cppuhelpergcc3 \
- uno_sal \
- uno_salhelpergcc3 \
- uno_cppuhelpergcc3 \
- unordflo \
- unoxmllo \
- vbahelperlo \
- vbaswobj.uno \
- wpftdrawlo \
- wpftwriterlo \
- xml2 \
- xmlfdlo \
- xmlreader \
- xmlsecurity \
- xslt \
- ); do \
- $(call COPYSO,$(OUTDIR)/lib/lib$${F}.so); \
- done
-#
-# Then the shared GNU C++ library
- $(call COPYSO,$(ANDROID_NDK_HOME)/sources/cxx-stl/gnu-libstdc++/$(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)libs/$(ANDROID_APP_ABI)/libgnustl_shared.so)
-#
-# Then other "assets". Let the directory structure under assets mimic
+# Then "assets". Let the directory structure under assets mimic
# that under solver for now.
#
# Please note that I have no idea what all of this is really necessary and for
@@ -216,10 +284,11 @@ copy-stuff:
#
# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
#
+ mkdir -p $(SODEST)
cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
echo set solib-search-path ./obj/local/$(ANDROID_APP_ABI) >$(SODEST)/gdb.setup
-build-ant: copy-stuff properties
+build-ant: copy-stuff link-so properties
#
# Copy jar files we need
#
diff --git a/android/experimental/DocumentLoader/native-code.cxx b/android/experimental/DocumentLoader/native-code.cxx
new file mode 100644
index 0000000..415c673
--- /dev/null
+++ b/android/experimental/DocumentLoader/native-code.cxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "osl/detail/android-bootstrap.h"
+
+extern "C"
+{
+ extern void * hwp_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sc_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * scd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * scfilt_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * sw_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * swd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * unoxml_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xmlfd_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xo_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+ extern void * xof_component_getFactory( const char * pImplName, void * pServiceManager, void * pRegistryKey );
+}
+
+extern "C"
+__attribute__ ((visibility("default")))
+const lib_to_component_mapping *
+lo_get_libmap(void)
+{
+ static lib_to_component_mapping map[] = {
+ { "libhwplo.a", hwp_component_getFactory },
+ { "libscdlo.a", scd_component_getFactory },
+ { "libscfiltlo.a", scfilt_component_getFactory },
+ { "libsclo.a", sc_component_getFactory },
+ { "libswdlo.a", swd_component_getFactory },
+ { "libswlo.a", sw_component_getFactory },
+ { "libunoxmllo.a", unoxml_component_getFactory },
+ { "libxmlfdlo.a", xmlfd_component_getFactory },
+ { "libxoflo.a", xof_component_getFactory },
+ { "libxolo.a", xo_component_getFactory },
+ { NULL, NULL }
+ };
+
+ return map;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
index 638c9b9..894fdab 100644
--- a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
+++ b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
@@ -929,13 +929,7 @@ public class DocumentLoader
Bootstrap.setup(this);
// Avoid all the old style OSL_TRACE calls especially in vcl
- Bootstrap.putenv("SAL_LOG=+WARN+INFO-INFO.legacy.osl");
-
- // Load a lot of shlibs here explicitly in advance because that
- // makes debugging work better, sigh
- Bootstrap.dlopen("libmergedlo.so");
- Bootstrap.dlopen("libswdlo.so");
- Bootstrap.dlopen("libswlo.so");
+ Bootstrap.putenv("SAL_LOG=+WARN+INFO");
// Log.i(TAG, "Sleeping NOW");
// Thread.sleep(20000);
diff --git a/configure.in b/configure.in
index 29e4d92..ce0b498 100644
--- a/configure.in
+++ b/configure.in
@@ -2422,8 +2422,8 @@ else
fi
AC_SUBST(DISABLE_SCRIPTING)
-if test $_os = iOS; then
- # Disable dynamic_loading always for iOS
+if test $_os = iOS -o $_os = Android; then
+ # Disable dynamic_loading always for iOS and Android
enable_dynamic_loading=no
elif test -z "$enable_dynamic_loading"; then
# Otherwise enable it unless speficically disabled
diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf
index 01f11ca..70ecdcc 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -17,7 +17,6 @@
--disable-randr
--disable-randr-link
--disable-systray
---enable-mergelibs
--without-junit
--without-ppds
--without-stlport
diff --git a/distro-configs/LibreOfficeAndroidX86.conf b/distro-configs/LibreOfficeAndroidX86.conf
index a3662d6..f4ae136 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -18,7 +18,6 @@
--disable-randr
--disable-randr-link
--disable-systray
---enable-mergelibs
--without-junit
--without-ppds
--without-stlport
diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk
index c253de7..7ed1a9b 100644
--- a/sal/Package_inc.mk
+++ b/sal/Package_inc.mk
@@ -67,6 +67,7 @@ $(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/file.h,osl/detail/file.
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android_native_app_glue.h,osl/detail/android_native_app_glue.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android-bootstrap.h,osl/detail/android-bootstrap.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/ios-bootstrap.h,osl/detail/ios-bootstrap.h))
+$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/component-mapping.h,osl/detail/component-mapping.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/allocator.hxx,rtl/allocator.hxx))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/alloc.h,rtl/alloc.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/bootstrap.h,rtl/bootstrap.h))
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index f149869..b29fb7d 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -43,8 +43,6 @@
#include <jni.h>
-#include <linux/elf.h>
-
#include <android/log.h>
#include "uthash.h"
@@ -299,40 +297,8 @@ engine_handle_cmd(struct android_app* state,
}
}
-static char *
-read_section(int fd,
- Elf32_Shdr *shdr)
-{
- char *result;
-
- result = malloc(shdr->sh_size);
- if (lseek(fd, shdr->sh_offset, SEEK_SET) < 0) {
- close(fd);
- free(result);
- return NULL;
- }
- if (read(fd, result, shdr->sh_size) < (int) shdr->sh_size) {
- close(fd);
- free(result);
- return NULL;
- }
-
- return result;
-}
-
-static void
-free_ptrarray(void **pa)
-{
- void **rover = pa;
-
- while (*rover != NULL)
- free(*rover++);
-
- free(pa);
-}
-
-/* The lo-bootstrap shared library is always loaded from Java, so
- * this is always called by JNI first.
+/* The lo-native-code shared library is always loaded from Java, so this is
+ * always called by JNI first.
*/
__attribute__ ((visibility("default")))
jint
@@ -345,133 +311,6 @@ JNI_OnLoad(JavaVM* vm, void* reserved)
return JNI_VERSION_1_2;
}
-__attribute__ ((visibility("default")))
-jobjectArray
-Java_org_libreoffice_android_Bootstrap_dlneeds(JNIEnv* env,
- jobject clazz,
- jstring library)
-{
- char **needed;
- int n_needed;
- const char *libName;
- jclass String;
- jobjectArray result;
-
- (void) clazz;
-
- libName = (*env)->GetStringUTFChars(env, library, NULL);
-
- needed = lo_dlneeds(libName);
-
- (*env)->ReleaseStringUTFChars(env, library, libName);
-
- if (needed == NULL)
- return NULL;
-
- n_needed = 0;
- while (needed[n_needed] != NULL)
- n_needed++;
-
- /* Allocate return value */
-
- String = (*env)->FindClass(env, "java/lang/String");
- if (String == NULL) {
- LOGE("Could not find the String class");
- free_ptrarray((void **) needed);
- return NULL;
- }
-
- result = (*env)->NewObjectArray(env, n_needed, String, NULL);
- if (result == NULL) {
- LOGE("Could not create the String array");
- free_ptrarray((void **) needed);
- return NULL;
- }
-
- for (n_needed = 0; needed[n_needed] != NULL; n_needed++)
- (*env)->SetObjectArrayElement(env, result, n_needed, (*env)->NewStringUTF(env, needed[n_needed]));
-
- free_ptrarray((void **) needed);
-
- return result;
-}
-
-__attribute__ ((visibility("default")))
-jint
-Java_org_libreoffice_android_Bootstrap_dlopen(JNIEnv* env,
- jobject clazz,
- jstring library)
-{
- const char *libName;
- void *p;
-
- (void) clazz;
-
- libName = (*env)->GetStringUTFChars(env, library, NULL);
- p = lo_dlopen (libName);
- (*env)->ReleaseStringUTFChars(env, library, libName);
-
- return (jint) p;
-}
-
-__attribute__ ((visibility("default")))
-jint
-Java_org_libreoffice_android_Bootstrap_dlsym(JNIEnv* env,
- jobject clazz,
- jint handle,
- jstring symbol)
-{
- const char *symName;
- void *p;
-
- (void) clazz;
-
- symName = (*env)->GetStringUTFChars(env, symbol, NULL);
- p = lo_dlsym ((void *) handle, symName);
- (*env)->ReleaseStringUTFChars(env, symbol, symName);
-
- return (jint) p;
-}
-
-__attribute__ ((visibility("default")))
-jint
-Java_org_libreoffice_android_Bootstrap_dlcall(JNIEnv* env,
- jobject clazz,
- jint function,
- jobject argument)
-{
- jclass StringArray;
-
- (void) clazz;
-
- StringArray = (*env)->FindClass(env, "[Ljava/lang/String;");
- if (StringArray == NULL) {
- LOGE("Could not find String[] class");
- return 0;
- }
-
- if ((*env)->IsInstanceOf(env, argument, StringArray)) {
- int argc = (*env)->GetArrayLength(env, argument);
- const char **argv = malloc(sizeof(char *) * (argc+1));
- int i, result;
- for (i = 0; i < argc; i++) {
- argv[i] = (*env)->GetStringUTFChars(env, (*env)->GetObjectArrayElement(env, argument, i), NULL);
- /* LOGI("argv[%d] = %s", i, argv[i]); */
- }
- argv[argc] = NULL;
-
- result = lo_dlcall_argc_argv((void *) function, argc, argv);
-
- for (i = 0; i < argc; i++)
- (*env)->ReleaseStringUTFChars(env, (*env)->GetObjectArrayElement(env, argument, i), argv[i]);
-
- free(argv);
- return result;
- }
-
- return 0;
-}
-
// public static native boolean setup(String dataDir,
// String apkFile,
// String[] ld_library_path);
@@ -591,22 +430,18 @@ get_jni_string_array(JNIEnv *env,
}
-// public static native boolean setup(int lo_main_ptr,
-// Object lo_main_argument,
+// public static native boolean setup(Object lo_main_argument,
// int lo_main_delay);
__attribute__ ((visibility("default")))
jboolean
-Java_org_libreoffice_android_Bootstrap_setup__ILjava_lang_Object_2I(JNIEnv* env,
+Java_org_libreoffice_android_Bootstrap_setup__Ljava_lang_Object_2I(JNIEnv* env,
jobject clazz,
- void *lo_main_ptr,
jobject lo_main_argument,
jint lo_main_delay)
{
(void) clazz;
- lo_main = lo_main_ptr;
-
if (!get_jni_string_array(env, "setup: lo_main_argument", lo_main_argument, &lo_main_argc, &lo_main_argv))
return JNI_FALSE;
@@ -668,344 +503,16 @@ Java_org_libreoffice_android_Bootstrap_putenv(JNIEnv* env,
putenv(s);
- (*env)->ReleaseStringUTFChars(env, string, s);
-}
-
-__attribute__ ((visibility("default")))
-char **
-lo_dlneeds(const char *library)
-{
- int i, fd;
- int n_needed;
- char **result;
- char *shstrtab;
- char *dynstr = NULL;
- Elf32_Ehdr hdr;
- Elf32_Shdr shdr;
- Elf32_Dyn dyn;
-
- /* Open library and read ELF header */
-
- fd = open(library, O_RDONLY);
-
- if (fd == -1) {
- LOGE("lo_dlneeds: Could not open library %s: %s", library, strerror(errno));
- return NULL;
- }
-
- if (read(fd, &hdr, sizeof(hdr)) < (int) sizeof(hdr)) {
- LOGE("lo_dlneeds: Could not read ELF header of %s", library);
- close(fd);
- return NULL;
- }
-
- /* Read in .shstrtab */
-
- if (lseek(fd, hdr.e_shoff + hdr.e_shstrndx * sizeof(shdr), SEEK_SET) < 0) {
- LOGE("lo_dlneeds: Could not seek to .shstrtab section header of %s", library);
- close(fd);
- return NULL;
- }
- if (read(fd, &shdr, sizeof(shdr)) < (int) sizeof(shdr)) {
- LOGE("lo_dlneeds: Could not read section header of %s", library);
- close(fd);
- return NULL;
- }
-
- shstrtab = read_section(fd, &shdr);
- if (shstrtab == NULL)
- return NULL;
-
- /* Read section headers, looking for .dynstr section */
-
- if (lseek(fd, hdr.e_shoff, SEEK_SET) < 0) {
- LOGE("lo_dlneeds: Could not seek to section headers of %s", library);
- close(fd);
- return NULL;
- }
- for (i = 0; i < hdr.e_shnum; i++) {
- if (read(fd, &shdr, sizeof(shdr)) < (int) sizeof(shdr)) {
- LOGE("lo_dlneeds: Could not read section header of %s", library);
- close(fd);
- return NULL;
- }
- if (shdr.sh_type == SHT_STRTAB &&
- strcmp(shstrtab + shdr.sh_name, ".dynstr") == 0) {
- dynstr = read_section(fd, &shdr);
- if (dynstr == NULL) {
- free(shstrtab);
- return NULL;
- }
- break;
- }
- }
-
- if (i == hdr.e_shnum) {
- LOGE("lo_dlneeds: No .dynstr section in %s", library);
- close(fd);
- return NULL;
- }
-
- /* Read section headers, looking for .dynamic section */
-
- if (lseek(fd, hdr.e_shoff, SEEK_SET) < 0) {
- LOGE("lo_dlneeds: Could not seek to section headers of %s", library);
- close(fd);
- return NULL;
- }
- for (i = 0; i < hdr.e_shnum; i++) {
- if (read(fd, &shdr, sizeof(shdr)) < (int) sizeof(shdr)) {
- LOGE("lo_dlneeds: Could not read section header of %s", library);
- close(fd);
- return NULL;
- }
- if (shdr.sh_type == SHT_DYNAMIC) {
- size_t dynoff;
-
- /* Count number of DT_NEEDED entries */
- n_needed = 0;
- if (lseek(fd, shdr.sh_offset, SEEK_SET) < 0) {
- LOGE("lo_dlneeds: Could not seek to .dynamic section of %s", library);
- close(fd);
- return NULL;
- }
- for (dynoff = 0; dynoff < shdr.sh_size; dynoff += sizeof(dyn)) {
- if (read(fd, &dyn, sizeof(dyn)) < (int) sizeof(dyn)) {
- LOGE("lo_dlneeds: Could not read .dynamic entry of %s", library);
- close(fd);
- return NULL;
- }
- if (dyn.d_tag == DT_NEEDED)
- n_needed++;
- }
-
- /* LOGI("Found %d DT_NEEDED libs", n_needed); */
-
- result = malloc((n_needed+1) * sizeof(char *));
-
- n_needed = 0;
- if (lseek(fd, shdr.sh_offset, SEEK_SET) < 0) {
- LOGE("lo_dlneeds: Could not seek to .dynamic section of %s", library);
- close(fd);
- free(result);
- return NULL;
- }
- for (dynoff = 0; dynoff < shdr.sh_size; dynoff += sizeof(dyn)) {
- if (read(fd, &dyn, sizeof(dyn)) < (int) sizeof(dyn)) {
- LOGE("lo_dlneeds: Could not read .dynamic entry in %s", library);
- close(fd);
- free(result);
- return NULL;
- }
- if (dyn.d_tag == DT_NEEDED) {
- /* LOGI("needs: %s\n", dynstr + dyn.d_un.d_val); */
- result[n_needed] = strdup(dynstr + dyn.d_un.d_val);
- n_needed++;
- }
- }
-
- close(fd);
- if (dynstr)
- free(dynstr);
- free(shstrtab);
- result[n_needed] = NULL;
- return result;
- }
- }
-
- LOGE("lo_dlneeds: Could not find .dynamic section in %s", library);
- close(fd);
- return NULL;
-}
-
-__attribute__ ((visibility("default")))
-void *
-lo_dlopen(const char *library)
-{
- /*
- * We should *not* try to just dlopen() the bare library name
- * first, as the stupid dynamic linker remembers for each library
- * basename if loading it has failed. Thus if you try loading it
- * once, and it fails because of missing needed libraries, and
- * your load those, and then try again, it fails with an
- * infuriating message "failed to load previously" in the log.
- *
- * We *must* first dlopen() all needed libraries, recursively. It
- * shouldn't matter if we dlopen() a library that already is
- * loaded, dlopen() just returns the same value then.
- */
-
- typedef struct loadedLib {
- const char *name;
- void *handle;
- struct loadedLib *next;
- } *loadedLib;
- static loadedLib loaded_libraries = NULL;
-
- loadedLib rover;
- loadedLib new_loaded_lib;
-
- struct stat st;
- void *p;
- char *full_name;
- char **needed;
- int i;
- int found;
-
- struct timeval tv0, tv1, tvdiff;
-
- rover = loaded_libraries;
- while (rover != NULL &&
- strcmp(rover->name, library) != 0)
- rover = rover->next;
-
- if (rover != NULL)
- return rover->handle;
-
- /* LOGI("lo_dlopen(%s)", library); */
-
- found = 0;
- if (library[0] == '/') {
- full_name = strdup(library);
-
- if (stat(full_name, &st) == 0 &&
- S_ISREG(st.st_mode))
- found = 1;
- else
- free(full_name);
- } else {
- for (i = 0; !found && library_locations[i] != NULL; i++) {
- full_name = malloc(strlen(library_locations[i]) + 1 + strlen(library) + 1);
- strcpy(full_name, library_locations[i]);
- strcat(full_name, "/");
- strcat(full_name, library);
-
- if (stat(full_name, &st) == 0 &&
- S_ISREG(st.st_mode))
- found = 1;
- else
- free(full_name);
- }
- }
-
- if (!found) {
- LOGE("lo_dlopen: Library %s not found", library);
- return NULL;
- }
-
- needed = lo_dlneeds(full_name);
- if (needed == NULL) {
- free(full_name);
- return NULL;
- }
-
- for (i = 0; needed[i] != NULL; i++) {
- if (lo_dlopen(needed[i]) == NULL) {
- free_ptrarray((void **) needed);
- free(full_name);
- return NULL;
- }
- }
- free_ptrarray((void **) needed);
-
- gettimeofday(&tv0, NULL);
- p = dlopen(full_name, RTLD_LOCAL);
- gettimeofday(&tv1, NULL);
- timersub(&tv1, &tv0, &tvdiff);
- LOGI("dlopen(%s) = %p, %ld.%03lds",
- full_name, p,
- (long) tvdiff.tv_sec, (long) tvdiff.tv_usec / 1000);
- free(full_name);
- if (p == NULL)
- LOGE("lo_dlopen: Error from dlopen(%s): %s", library, dlerror());
-
- new_loaded_lib = malloc(sizeof(*new_loaded_lib));
- new_loaded_lib->name = strdup(library);
- new_loaded_lib->handle = p;
-
- new_loaded_lib->next = loaded_libraries;
- loaded_libraries = new_loaded_lib;
-
- return p;
-}
-
-__attribute__ ((visibility("default")))
-void *
-lo_dlsym(void *handle,
- const char *symbol)
-{
- void *p = dlsym(handle, symbol);
- /* LOGI("dlsym(%p, %s) = %p", handle, symbol, p); */
- if (p == NULL)
- LOGE("lo_dlsym: %s", dlerror());
- return p;
-}
-
-__attribute__ ((visibility("default")))
-int
-lo_dladdr(void *addr,
- Dl_info *info)
-{
- FILE *maps;
- char line[200];
- int result;
- int found;
-
- result = dladdr(addr, info);
- if (result == 0) {
- /* LOGI("dladdr(%p) = 0", addr); */
- return 0;
- }
-
- maps = fopen("/proc/self/maps", "r");
- if (maps == NULL) {
- LOGE("lo_dladdr: Could not open /proc/self/maps: %s", strerror(errno));
- return 0;
- }
-
- found = 0;
- while (fgets(line, sizeof(line), maps) != NULL &&
- line[strlen(line)-1] == '\n') {
- void *lo, *hi;
- char file[sizeof(line)];
- file[0] = '\0';
- if (sscanf(line, "%x-%x %*s %*x %*x:%*x %*d %[^\n]", (unsigned *) &lo, (unsigned *) &hi, file) == 3) {
- /* LOGI("got %p-%p: %s", lo, hi, file); */
- if (addr >= lo && addr < hi) {
- if (info->dli_fbase != lo) {
- LOGE("lo_dladdr: Base for %s in /proc/self/maps %p doesn't match what dladdr() said", file, lo);
- fclose(maps);
- return 0;
- }
- /* LOGI("dladdr(%p) = { %s:%p, %s:%p }: %s",
- addr,
- info->dli_fname, info->dli_fbase,
- info->dli_sname ? info->dli_sname : "(none)", info->dli_saddr,
- file); */
- info->dli_fname = strdup(file);
- found = 1;
- break;
- }
+ {
+ static int beenhere=0;
+ if (!beenhere) {
+ LOGI("lo-bootstrap: Sleeping for 20 seconds, start ndk-gdb NOW if that is your intention");
+ sleep(20);
+ beenhere = 1;
}
}
- if (!found)
- LOGE("lo_dladdr: Did not find %p in /proc/self/maps", addr);
- fclose(maps);
-
- return result;
-}
-
-__attribute__ ((visibility("default")))
-int
-lo_dlclose(void *handle)
-{
- /* As we don't know when the reference count for a dlopened shared
- * object drops to zero, we wouldn't know when to remove it from
- * our list, so we can't call dlclose().
- */
- LOGI("lo_dlclose(%p)", handle);
- return 0;
+ (*env)->ReleaseStringUTFChars(env, string, s);
}
__attribute__ ((visibility("default")))
@@ -1235,195 +742,6 @@ lo_dlcall_argc_argv(void *function,
return result;
}
-#ifdef ARM
-
-/* There is a bug in std::type_info::operator== and
- * std::type_info::before() in libgnustl_shared.so in NDK r7 at
- * least. They compare the type name pointers instead of comparing the
- * type name strings. See
- * http://code.google.com/p/android/issues/detail?id=22165 . So patch
- * that, poke in jumps to our own code snippets below instead.
- */
-
-/* Replacement std::type_info::operator== */
-
-__asm(" .arm\n"
- " .global replacement_operator_equals_arm\n"
- "replacement_operator_equals_arm:\n"
- " push {lr}\n"
-
- /* Load name pointers into r0 and r1 */
- " ldr r0, [r0, #4]\n"
- " ldr r1, [r1, #4]\n"
-
- /* First compare pointers */
- " cmp r0, r1\n"
-
- /* If equal, return true */
- " beq .L.equals.1\n"
-
- /* Otherwise call strcmp */
- " bl strcmp\n"
-
- /* And return true or false */
- " cmp r0, #0\n"
- " moveq r0, #1\n"
- " movne r0, #0\n"
- " b .L.equals.9\n"
-
- ".L.equals.1:\n"
- " mov r0, #1\n"
-
- ".L.equals.9:\n"
- " pop {pc}\n"
- );
-
-extern unsigned int replacement_operator_equals_arm;
-
-/* The ARM (not Thumb) code of the operator== in NDK r7 */
-static unsigned int expected_operator_equals_r7_code[] = {
- 0xe5903004, /* ldr r3, [r0, #4] */
- 0xe5910004, /* ldr r0, [r1, #4] */
- 0xe1530000, /* cmp r3, r0 */
- 0x13a00000, /* movne, #0 */
- 0x03a00001, /* moveq r0, #1 */
- 0xe12fff1e /* bx lr */
-};
-
-/* Ditto for std::type_info::before() */
-
-__asm(" .arm\n"
- " .global replacement_method_before_arm\n"
- "replacement_method_before_arm:\n"
- " push {lr}\n"
-
- /* Load name pointers into r0 and r1 */
- " ldr r0, [r0, #4]\n"
- " ldr r1, [r1, #4]\n"
-
- /* First compare pointers */
- " cmp r0, r1\n"
-
- /* If equal, return false */
- " beq .L.before.1\n"
-
- /* Otherwise call strcmp */
- " bl strcmp\n"
-
- /* And return true or false */
- " cmp r0, #0\n"
- " movlt r0, #1\n"
- " movge r0, #0\n"
- " b .L.before.9\n"
-
- ".L.before.1:\n"
- " mov r0, #0\n"
-
- ".L.before.9:\n"
- " pop {pc}\n"
- );
-
-extern unsigned int replacement_method_before_arm;
-
-static unsigned int expected_method_before_r7_code[] = {
- 0xe5903004, /* ldr r3, [r0, #4] */
- 0xe5910004, /* ldr r0, [r1, #4] */
- 0xe1530000, /* cmp r3, r0 */
- 0x23a00000, /* movcs r0, #0 */
- 0x33a00001, /* movcc r0, #1 */
- 0xe12fff1e /* bx lr */
-};
-
-static void
-patch(const char *symbol,
- const char *plaintext,
- unsigned *expected_code,
- size_t expected_code_size,
- unsigned *replacement_code)
-{
-
- void *libgnustl_shared;
- void *code;
-
- void *base;
- size_t size;
-
- /* libgnustl_shared.so should be already loaded as we build
- * all LO code against it, so as we have loaded the .so
- * containing lo_main() already, libgnustl_shared.so will have
- * been brought in, too.
- */
- libgnustl_shared = dlopen("libgnustl_shared.so", RTLD_LOCAL);
- if (libgnustl_shared == NULL) {
- LOGF("android_main: libgnustl_shared.so not mapped??");
- exit(0);
- }
-
- code = dlsym(libgnustl_shared, symbol);
- if (code == NULL) {
- LOGF("android_main: %s not found!?", plaintext);
- exit(0);
- }
- /* LOGI("%s is at %p", plaintext, operator_equals); */
-
- if ((((unsigned) code) & 0x03) != 0) {
- LOGE("android_main: Address of %s is not at word boundary, huh?", plaintext);
- return;
- }
-
- if ((((unsigned) &replacement_code) & 0x03) != 0) {
- LOGE("android_main: Address of replacement %s is not at word boundary, huh?", plaintext);
- return;
- }
-
- if (memcmp(code, expected_code, expected_code_size) != 0) {
- LOGI("android_main: Code for %s does not match that in NDK r7; not patching it", plaintext);
- return;
- }
-
- base = ROUND_DOWN(code, getpagesize());
- size = code + sizeof(expected_code_size) - ROUND_DOWN(code, getpagesize());
- if (mprotect(base, size, PROT_READ|PROT_WRITE|PROT_EXEC) == -1) {
- LOGE("android_main: mprotect() failed: %s", strerror(errno));
- return;
- }
-
- /* Poke in a jump to replacement_code instead */
- ((unsigned *) code)[0] = 0xe51ff004; /* ldr pc, [pc, #-4] */
- ((unsigned *) code)[1] = (unsigned) replacement_code;
-}
-
-static void
-patch_libgnustl_shared(void)
-{
- patch("_ZNKSt9type_infoeqERKS_",
- "std::type_info::operator==",
- expected_operator_equals_r7_code,
- sizeof(expected_operator_equals_r7_code),
- &replacement_operator_equals_arm);
-
- patch("_ZNKSt9type_info6beforeERKS_",
- "std::type_info::before()",
- expected_method_before_r7_code,
- sizeof(expected_method_before_r7_code),
- &replacement_method_before_arm);
-}
-#endif // ARM
-
-// static native void patch_libgnustl_shared();
-__attribute__ ((visibility("default")))
-void
-Java_org_libreoffice_android_Bootstrap_patch_1libgnustl_1shared(JNIEnv* env,
- jobject clazz)
-{
- (void) env;
- (void) clazz;
-
-#ifdef ARM
- patch_libgnustl_shared();
-#endif
-}
-
#define UNPACK_TREE "/assets/unpack"
static int
@@ -1551,34 +869,30 @@ Java_org_libreoffice_android_Bootstrap_extract_1files(JNIEnv* env,
}
/* Android's JNI works only to libraries loaded through Java's
- * System.loadLibrary(), it seems. Not to functions loaded by a dlopen() call
- * in native code. For instance, to call a function in libvcllo.so, we need to
- * have its JNI wrapper here, and then call the VCL function from it. Oh well,
- * one could say it's clean to have all the Android-specific JNI functions
- * here in this file.
+ * System.loadLibrary(), it seems. But now with just one big app-specific .so
+ * on Android, that would not be a problem, but for historical reasons, we
+ * have JNI wrappers here, and then call the VCL etc function from them. Oh
+ * well, one could say it's clean to have all the Android-specific JNI
+ * functions here in this file.
*/
// public static native void initVCL();
+extern void InitVCLWrapper(void);
+
__attribute__ ((visibility("default")))
void
Java_org_libreoffice_android_Bootstrap_initVCL(JNIEnv* env,
jobject clazz)
{
- void (*InitVCLWrapper)(void);
(void) env;
(void) clazz;
- /* This obviously should be called only after libvcllo.so has been loaded */
-
- InitVCLWrapper = dlsym(RTLD_DEFAULT, "InitVCLWrapper");
- if (InitVCLWrapper == NULL) {
- LOGE("InitVCL: InitVCLWrapper not found");
- return;
- }
- (*InitVCLWrapper)();
+ InitVCLWrapper();
}
+extern void osl_setCommandArgs(int, char **);
+
__attribute__ ((visibility("default")))
void
Java_org_libreoffice_android_Bootstrap_setCommandArgs(JNIEnv* env,
@@ -1588,14 +902,13 @@ Java_org_libreoffice_android_Bootstrap_setCommandArgs(JNIEnv* env,
char **c_argv;
int c_argc;
Dl_info lo_bootstrap_info;
- void (*osl_setCommandArgs)(int, char **);
(void) clazz;
if (!get_jni_string_array(env, "setCommandArgs :argv", argv, &c_argc, (const char ***) &c_argv))
return;
- if (lo_dladdr(Java_org_libreoffice_android_Bootstrap_setCommandArgs, &lo_bootstrap_info) != 0) {
+ if (dladdr(Java_org_libreoffice_android_Bootstrap_setCommandArgs, &lo_bootstrap_info) != 0) {
char *new_argv0 = malloc(strlen(lo_bootstrap_info.dli_fname) + strlen(c_argv[0]));
char *slash;
strcpy(new_argv0, lo_bootstrap_info.dli_fname);
@@ -1611,30 +924,20 @@ Java_org_libreoffice_android_Bootstrap_setCommandArgs(JNIEnv* env,
c_argv[0] = new_argv0;
}
- osl_setCommandArgs = dlsym(RTLD_DEFAULT, "osl_setCommandArgs");
- if (osl_setCommandArgs == NULL) {
- LOGE("setCommandArgs: osl_setCommandArgs not found");
- return;
- }
- (*osl_setCommandArgs)(c_argc, c_argv);
+ osl_setCommandArgs(c_argc, c_argv);
}
+extern int createWindowFoo(void);
+
__attribute__ ((visibility("default")))
jint
Java_org_libreoffice_android_Bootstrap_createWindowFoo(JNIEnv* env,
jobject clazz)
{
- int (*createWindowFoo)(void);
(void) env;
(void) clazz;
- lo_dlopen("libvcllo.so");
- createWindowFoo = dlsym(RTLD_DEFAULT, "createWindowFoo");
- if (createWindowFoo == NULL) {
- LOGE("createWindowFoo: createWindowFoo not found");
- return 0;
- }
- return (*createWindowFoo)();
+ return createWindowFoo();
}
@@ -1956,6 +1259,10 @@ lo_get_app(void)
return app;
}
+/* Note that android_main() is used only in NativeActivity-based apps. Only
+ * the android/qa/sc unit test app is such, and it is unclear whether there is
+ * any reason to continue maintaining that buildable.
+ */
__attribute__ ((visibility("default")))
void
android_main(struct android_app* state)
@@ -1986,7 +1293,12 @@ android_main(struct android_app* state)
state->userData = &engine;
state->onAppCmd = engine_handle_cmd;
- if (lo_dladdr(lo_main, &lo_main_info) != 0) {
+ /* Look up lo_main() dynamically even if it is in the same .so as this code,
+ * but that is only in the case for code built to be used in a NativeActivity-based app.
+ */
+ lo_main = dlsym(RTLD_DEFAULT, "lo_main");
+
+ if (dladdr(lo_main, &lo_main_info) != 0) {
lo_main_argv[0] = lo_main_info.dli_fname;
}
diff --git a/sal/inc/osl/detail/android-bootstrap.h b/sal/inc/osl/detail/android-bootstrap.h
index bd453b3..333d14b 100644
--- a/sal/inc/osl/detail/android-bootstrap.h
+++ b/sal/inc/osl/detail/android-bootstrap.h
@@ -29,29 +29,19 @@
#ifndef ANDROID_BOOSTRAP_H
#define ANDROID_BOOSTRAP_H
+
#if defined(ANDROID)
#include <jni.h>
-#include <dlfcn.h>
#include <dirent.h>
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct lo_apk_dir lo_apk_dir;
-
-char **lo_dlneeds(const char *library);
-
-void *lo_dlopen(const char *library);
+#include <osl/detail/component-mapping.h>
-void *lo_dlsym(void *handle,
- const char *symbol);
-
-int lo_dladdr(void *addr,
- Dl_info *info);
-
-int lo_dlclose(void *handle);
+typedef struct lo_apk_dir lo_apk_dir;
void *lo_apkentry(const char *filename,
size_t *size);
@@ -77,6 +67,7 @@ struct android_app *lo_get_app(void);
#endif
#endif // ANDROID
+
#endif // ANDROID_BOOTSTRAP_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/osl/detail/component-mapping.h b/sal/inc/osl/detail/component-mapping.h
new file mode 100644
index 0000000..e085fbd
--- /dev/null
+++ b/sal/inc/osl/detail/component-mapping.h
@@ -0,0 +1,62 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http: *www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Tor Lillqvist <tml at iki.fi> (initial developer)
+ * Copyright (C) 2011 SUSE Linux http://suse.com (initial developer's employer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef COMPONENT_MAPPING_H
+#define COMPONENT_MAPPING_H
+
+#ifdef DISABLE_DYNLOADING
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* On iOS and perhaps Android static linking of the LO code into one
+ * executable (on Android, into one shared library) is used. In order to get
+ * the needed UNO coponent linked in, the "main" code for an app needs to
+ * implement the lo_get_libmap() function to map UNO component library names
+ * as produced in a build for iOS (like configmgr.uno.a or libsclo.a) to the
+ * corresponding component_getFactory functions.
+ */
+
+typedef struct {
+ const char *lib;
+ void * (*component_getFactory_function)(const char *, void *, void *);
+} lib_to_component_mapping;
+
+const lib_to_component_mapping *lo_get_libmap(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DISABLE_DYNLOADING */
+
+#endif /* COMPONENT_MAPPING_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/osl/detail/ios-bootstrap.h b/sal/inc/osl/detail/ios-bootstrap.h
index ac8ccf6..5e4ced7 100644
--- a/sal/inc/osl/detail/ios-bootstrap.h
+++ b/sal/inc/osl/detail/ios-bootstrap.h
@@ -36,19 +36,7 @@
extern "C" {
#endif
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list