[Libreoffice-commits] .: 4 commits - icu/icu4c-android.patch icu/makefile.mk sal/osl solenv/gbuild

Tor Lillqvist tml at kemper.freedesktop.org
Sun Nov 20 15:51:48 PST 2011


 icu/icu4c-android.patch                   |   11 +++++++++
 icu/makefile.mk                           |    5 ++++
 sal/osl/android/Makefile                  |   35 ++++++++++++++++++++++--------
 sal/osl/unx/file.cxx                      |   21 ++++++++++--------
 solenv/gbuild/platform/ANDROID_ARM_GCC.mk |   13 +++++++++++
 5 files changed, 67 insertions(+), 18 deletions(-)

New commits:
commit c249a509424f8fdce781ad359da6c407e54b9cad
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Mon Nov 21 01:44:24 2011 +0200

    Enforce lib prefix for UNO components here, too

diff --git a/solenv/gbuild/platform/ANDROID_ARM_GCC.mk b/solenv/gbuild/platform/ANDROID_ARM_GCC.mk
index 7fc6a51..cbcd3e6 100644
--- a/solenv/gbuild/platform/ANDROID_ARM_GCC.mk
+++ b/solenv/gbuild/platform/ANDROID_ARM_GCC.mk
@@ -65,4 +65,17 @@ $(call gb_Helper_abbreviate_dirs,\
 		-o $(1))
 endef
 
+# Prefix UNO library filenames with "lib"
+gb_Library_FILENAMES := \
+	$(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+	$(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+	$(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+	$(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+	$(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+	$(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+	$(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_UNOEXT)) \
+	$(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_UNOEXT)) \
+	$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+
+
 # vim: set noet sw=4:
commit 789bbd9219201644420b4fb7f53e830810b83148
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Mon Nov 21 01:38:26 2011 +0200

    Include more stuff in the .apk needed by test_i18npool_test_breakiterator
    
    Now it runs until a crash caused by ICU library mixup between our ones
    and the system ones, they have the same names but aren't
    compatible... (see 7ee03666d7cfc27453315e1682e3c32d39a031b6).

diff --git a/sal/osl/android/Makefile b/sal/osl/android/Makefile
index a607d93..f772b84 100644
--- a/sal/osl/android/Makefile
+++ b/sal/osl/android/Makefile
@@ -43,11 +43,11 @@ ndk-build:
 # and ones from other modules. Note that depending on when you try
 # this, these might not have been built yet.
 #
-	-for F in $(SRC_ROOT)/cppu/$(INPATH)/lib/qa_*.so; do \
+	for F in $(SRC_ROOT)/cppu/$(INPATH)/lib/qa_*.so; do \
 	    $(call CONDCOPY,$${F},`basename $${F}`); \
 	done
 #
-	-for F in i18npool_test_breakiterator; do \
+	for F in i18npool_test_breakiterator; do \
 	    $(call CONDCOPY,$(WORKDIR)/LinkTarget/CppunitTest/libtest_$${F}.so); \
 	done
 
@@ -57,28 +57,45 @@ ndk-build:
 #
 # Libs and UNO components that the tests from other modules need.
 #
-	-for F in gcc3_uno \
+	for F in $(strip \
+		  comphelpgcc3 \
+		  gcc3_uno \
+		  i18nisolang1gcc3 \
+		  i18nutilgcc3 \
+		  icudata \
+		  icui18n \
+		  icuuc \
 		  reg \
 		  store \
+		  ucbhelper4gcc3 \
 		  uno_cppu \
 		  uno_salhelpergcc3 \
 	          uno_cppuhelpergcc3 \
 		  unoexceptionprotector \
 		  xml2 \
 		  xmlreader \
-		  bootstrap.uno; do \
+		  bootstrap.uno \
+		  i18npool.uno); do \
 	    $(call CONDCOPY,$(OUTDIR)/lib/lib$${F}.so); \
 	done
 #
 # Then the shared GNU C++ library
 	$(call COPY,$(NDK_HOME)/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/libgnustl_shared.so)
+#
+# Then other "assets". Let the directory structure under assets mimic
+# that under solver for now.
+	mkdir -p assets/bin assets/xml/ure assets/ComponentTarget/i18npool/util
+	cp $(OUTDIR)/bin/udkapi.rdb assets/bin
+	cp $(OUTDIR)/bin/types.rdb assets/bin
+	cp $(OUTDIR)/xml/ure/services.rdb assets/xml/ure
+	cp $(WORKDIR)/ComponentTarget/i18npool/util/i18npool.component assets/ComponentTarget/i18npool/util
 
 install: ndk-build
 	unset JAVA_HOME && ant debug install
 
 run: install
-# Note: this is of course just an example. The full path the the test
-# .so needs to be supplied, unfortunately, I guess cppunittester
-# checks its existance using the pathname instead of just
-# osl_loadModule'ing it.
-	adb shell am start -n org.libreoffice.android/.Bootstrap -e lo-main-library libcppunittester -e lo-main-cmdline "/data/data/org.libreoffice.android/lib/libqa_sal_types.so"
+# Note: these are just examples. The full path the the app's directory
+# needs to be supplied in a couple of places, unfortunately.
+
+#	adb shell am start -n org.libreoffice.android/.Bootstrap -e lo-main-library libcppunittester -e lo-main-cmdline "/data/data/org.libreoffice.android/lib/libqa_sal_types.so"
+#	adb shell am start -n org.libreoffice.android/.Bootstrap -e lo-main-library libcppunittester -e lo-main-cmdline "/data/data/org.libreoffice.android/lib/libtest_i18npool_test_breakiterator.so --protector libunoexceptionprotector.so unoexceptionprotector '-env:UNO_TYPES=file:///assets/bin/udkapi.rdb file:///assets/bin/types.rdb'  '-env:UNO_SERVICES=file:///assets/xml/ure/services.rdb  file:///assets/ComponentTarget/i18npool/util/i18npool.component' -env:LO_LIB_DIR=file:///data/data/org.libreoffice.android/lib" 
commit 0e867a88602fc5bb8e318edcb82b9c940ade41c4
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Mon Nov 21 01:38:11 2011 +0200

    Fix crash in the "memory" FileHandle_Impl

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index b6b4600..62d6aa0 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -106,7 +106,7 @@ struct FileHandle_Impl
     size_t       m_bufsiz;
     sal_uInt8 *  m_buffer;
 
-    explicit FileHandle_Impl (int fd, char const * path = "<anon>");
+    explicit FileHandle_Impl (int fd, Kind kind = KIND_FD, char const * path = "<anon>");
     ~FileHandle_Impl();
 
     static void* operator new (size_t n);
@@ -245,10 +245,10 @@ FileHandle_Impl::Guard::~Guard()
     (void) pthread_mutex_unlock (m_mutex);
 }
 
-FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
+FileHandle_Impl::FileHandle_Impl (int fd, enum Kind kind, char const * path)
     : m_strFilePath (0),
       m_fd      (fd),
-      m_kind    (KIND_FD),
+      m_kind    (kind),
       m_state   (STATE_SEEKABLE | STATE_READABLE),
       m_size    (0),
       m_offset  (0),
@@ -260,13 +260,16 @@ FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
 {
     (void) pthread_mutex_init(&m_mutex, 0);
     rtl_string_newFromStr (&m_strFilePath, path);
-    Allocator::get().allocate (&m_buffer, &m_bufsiz);
-    if (0 != m_buffer)
-        memset (m_buffer, 0, m_bufsiz);
+    if (m_kind == KIND_FD) {
+        Allocator::get().allocate (&m_buffer, &m_bufsiz);
+        if (0 != m_buffer)
+            memset (m_buffer, 0, m_bufsiz);
+    }
 }
 FileHandle_Impl::~FileHandle_Impl()
 {
-    Allocator::get().deallocate (m_buffer), m_buffer = 0;
+    if (m_kind == KIND_FD)
+        Allocator::get().deallocate (m_buffer), m_buffer = 0;
     rtl_string_release (m_strFilePath), m_strFilePath = 0;
     (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ...
 }
@@ -856,7 +859,7 @@ static oslFileError
 SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle )
 {
     oslFileError eRet;
-    FileHandle_Impl * pImpl = new FileHandle_Impl (-1, "");
+    FileHandle_Impl * pImpl = new FileHandle_Impl (-1, FileHandle_Impl::KIND_MEM);
     if (!pImpl)
     {
         eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM);
@@ -1017,7 +1020,7 @@ SAL_CALL osl_openFile( rtl_uString* ustrFileURL, oslFileHandle* pHandle, sal_uIn
     }
 
     /* allocate memory for impl structure */
-    FileHandle_Impl * pImpl = new FileHandle_Impl (fd, buffer);
+    FileHandle_Impl * pImpl = new FileHandle_Impl (fd, FileHandle_Impl::KIND_FD, buffer);
     if (!pImpl)
     {
         eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM);
commit 190ddfcdb2ffe445be00285a10df6af22a99d6a4
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Mon Nov 21 01:28:32 2011 +0200

    Don't use any major version soname suffix for Android
    
    But... the names our ICU libraries get built as clash exactly with
    Android's system ICU library names, predictably leading to chaos. I
    will have to come up with a non-clashing names for our ICU libraries
    on Android.
    
    (But isn't it stupid to include an own build of ICU if there is one in
    the system already? Sure, but on the other hand the NDK doesn't
    include ICU headers or libraries, so clearly Google doesn't consider
    it part of the documented API. No guarantee of version stability
    etc. Indeed best to avoid them then.)

diff --git a/icu/icu4c-android.patch b/icu/icu4c-android.patch
new file mode 100644
index 0000000..f5b016e
--- /dev/null
+++ b/icu/icu4c-android.patch
@@ -0,0 +1,11 @@
+--- misc/icu/source/config/mh-linux
++++ misc/build/icu/source/config/mh-linux
+@@ -30,7 +30,7 @@
+ 
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+-	LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
++#	LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
+ #SH# # We can't depend on MIDDLE_SO_TARGET being set.
+ #SH# LD_SONAME=
+ 
diff --git a/icu/makefile.mk b/icu/makefile.mk
index 4db60c0..f0e9dfa 100644
--- a/icu/makefile.mk
+++ b/icu/makefile.mk
@@ -54,6 +54,11 @@ PATCH_FILES=\
     icu4c-escapespace.patch \
     icu4c-strict-c.patch
 
+.IF "$(OS)"=="ANDROID"
+PATCH_FILES+=\
+    icu4c-android.patch
+.ENDIF
+
 .IF "$(GUI)"=="UNX"
 
 .IF "$(SYSBASE)"!=""


More information about the Libreoffice-commits mailing list