summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2019-09-05 16:43:14 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2019-09-23 12:57:08 +0200
commit6d09dcf0d8a8fd3b63ad583befaf2c47f85b16b7 (patch)
tree916a8b8851ff7a5dcd5df4e21801663c3a83fc47
parent29ad26ace6cef4655c89902a7ec2c999cc4551e6 (diff)
android: add support for 64bit build
Change-Id: Id8aae84308f6128351ae2f93c8fbc8941a0c7fc6 Reviewed-on: https://gerrit.libreoffice.org/79085 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--bridges/Library_cpp_uno.mk2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx10
-rw-r--r--configure.ac12
-rw-r--r--distro-configs/LibreOfficeAndroidX86_64.conf10
-rw-r--r--external/nss/ExternalProject_nss.mk2
-rw-r--r--external/nss/nss-android.patch.13
-rw-r--r--solenv/gbuild/platform/ANDROID_X86_64_GCC.mk15
7 files changed, 51 insertions, 3 deletions
diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
index f8efb498a4b1..0ca679e4b216 100644
--- a/bridges/Library_cpp_uno.mk
+++ b/bridges/Library_cpp_uno.mk
@@ -159,7 +159,7 @@ bridge_exception_objects := except
else ifeq ($(CPUNAME),X86_64)
-ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
+ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
bridges_SELECTED_BRIDGE := gcc3_linux_x86-64
bridge_asm_objects := call
bridge_noncallexception_noopt_objects := callvirtualmethod
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
index faf45a8b0590..2e11b6eb42bc 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
@@ -80,7 +80,9 @@ class RTTI
std::vector<OString> m_rttiNames;
std::unordered_map<OUString, std::unique_ptr<Generated>> m_generatedRttis;
+#if !defined ANDROID
void * m_hApp;
+#endif
public:
RTTI();
@@ -90,13 +92,17 @@ public:
};
RTTI::RTTI()
+#if !defined ANDROID
: m_hApp( dlopen( nullptr, RTLD_LAZY ) )
+#endif
{
}
RTTI::~RTTI()
{
+#if !defined ANDROID
dlclose( m_hApp );
+#endif
}
std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr)
@@ -124,7 +130,11 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr)
buf.append( 'E' );
OString symName( buf.makeStringAndClear() );
+#if !defined ANDROID
rtti = static_cast<std::type_info *>(dlsym( m_hApp, symName.getStr() ));
+#else
+ rtti = static_cast<std::type_info *>(dlsym( RTLD_DEFAULT, symName.getStr() ));
+#endif
if (rtti)
{
diff --git a/configure.ac b/configure.ac
index f27b041ee0c4..51767f9c537a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,6 +436,13 @@ if test -n "$with_android_ndk"; then
# minimum android version that supports aarch64
ANDROID_API_LEVEL=21
ANDROID_APP_ABI=arm64-v8a
+ elif test $host_cpu = x86_64; then
+ android_platform_prefix=x86_64-linux-android
+ android_gnu_prefix=$android_platform_prefix
+ LLVM_TRIPLE=$android_platform_prefix
+ # minimum android version that supports x86_64
+ ANDROID_API_LEVEL=21
+ ANDROID_APP_ABI=x86_64
else
# host_cpu is something like "i386" or "i686" I guess, NDK uses
# "x86" in some contexts
@@ -4472,6 +4479,11 @@ linux-android*)
RTL_ARCH=x86
PLATFORMID=android_x86
;;
+ x86_64)
+ CPUNAME=X86_64
+ RTL_ARCH=X86_64
+ PLATFORMID=android_x86_64
+ ;;
*)
AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
;;
diff --git a/distro-configs/LibreOfficeAndroidX86_64.conf b/distro-configs/LibreOfficeAndroidX86_64.conf
new file mode 100644
index 000000000000..efbbdbb1e945
--- /dev/null
+++ b/distro-configs/LibreOfficeAndroidX86_64.conf
@@ -0,0 +1,10 @@
+--host=x86_64-linux-android
+--disable-cairo-canvas
+--disable-cups
+--disable-gstreamer-1-0
+--disable-randr
+--without-export-validation
+--without-helppack-integration
+--without-junit
+--disable-largefile
+--with-theme=colibre
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index e97756aca831..2e93d7000c3a 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -33,7 +33,7 @@ else # OS!=WNT
# OTOH specify e.g. CC and NSINSTALL as arguments (after make command), so they will overrule nss makefile values
$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python)
$(call gb_ExternalProject_run,build,\
- $(if $(filter FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \
+ $(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \
$(if $(filter iOS,$(OS)),\
$(if $(filter arm64,$(CC)),USE_64=1)) \
$(if $(filter MACOSX,$(OS)),\
diff --git a/external/nss/nss-android.patch.1 b/external/nss/nss-android.patch.1
index 50c549303604..f8b4cdaf3753 100644
--- a/external/nss/nss-android.patch.1
+++ b/external/nss/nss-android.patch.1
@@ -1,12 +1,13 @@
diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.sub
--- nss.org/nspr/build/autoconf/config.sub 2017-09-07 15:29:45.031246453 +0200
+++ nss/nspr/build/autoconf/config.sub 2017-09-07 15:32:13.087235423 +0200
-@@ -111,6 +111,9 @@
+@@ -111,6 +111,10 @@
exit 1;;
esac
+if test $1 = "arm-unknown-linux-androideabi"; then echo $1; exit; fi
+if test $1 = "i686-pc-linux-android"; then echo $1; exit; fi
++if test $1 = "x86_64-pc-linux-android"; then echo $1; exit; fi
+
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
diff --git a/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk b/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk
new file mode 100644
index 000000000000..bb57e8ae0dde
--- /dev/null
+++ b/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk
@@ -0,0 +1,15 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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/.
+#
+
+# please make generic modifications to unxgcc.mk or android.mk
+
+include $(GBUILDDIR)/platform/unxgcc.mk
+include $(GBUILDDIR)/platform/android.mk
+
+# vim: set noet sw=4: