[libreoffice] Resolves: rhbz#1098693 AArch64 port

sbergmann sbergmann at fedoraproject.org
Fri Aug 29 16:29:54 UTC 2014


commit c37f353cda486d579b0950c8931f1364d4ead935
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Aug 29 18:29:30 2014 +0200

    Resolves: rhbz#1098693 AArch64 port

 0001-Update-config.-guess-sub.patch |  951 ++++++++++++++++++++++
 0002-Linux-AArch64-port.patch       | 1497 +++++++++++++++++++++++++++++++++++
 libreoffice.spec                    |    7 +-
 3 files changed, 2454 insertions(+), 1 deletions(-)
---
diff --git a/0001-Update-config.-guess-sub.patch b/0001-Update-config.-guess-sub.patch
new file mode 100644
index 0000000..61c6e47
--- /dev/null
+++ b/0001-Update-config.-guess-sub.patch
@@ -0,0 +1,951 @@
+From c3ff94b04ab2508ea46c22677913ec61617c09b6 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at redhat.com>
+Date: Wed, 18 Jun 2014 10:22:21 +0200
+Subject: [PATCH 1/2] Update config.{guess,sub}
+
+...to latest versions from <http://git.savannah.gnu.org/gitweb/?p=config.git;
+a=blob_plain;f=config.guess;hb=HEAD> and <http://git.savannah.gnu.org/gitweb/?
+p=config.git;a=blob_plain;f=config.sub;hb=HEAD>, for aarch64 support.
+
+Change-Id: If4ed1a6ced85947ee5b1b923fd09b4d679140145
+(cherry picked from commit 3379a4d028a77de5a50e305175d80f65560d5688)
+---
+ config.guess | 360 ++++++++++++++++++++++-------------------------------------
+ config.sub   | 144 ++++++++++++++----------
+ 2 files changed, 218 insertions(+), 286 deletions(-)
+ mode change 100755 => 100644 config.guess
+ mode change 100755 => 100644 config.sub
+
+diff --git a/config.guess b/config.guess
+old mode 100755
+new mode 100644
+index f7dd69e..1f5c50c
+--- a/config.guess
++++ b/config.guess
+@@ -1,14 +1,12 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-#   2011 Free Software Foundation, Inc.
++#   Copyright 1992-2014 Free Software Foundation, Inc.
+ 
+-timestamp='2011-08-20'
++timestamp='2014-03-23'
+ 
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
++# the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -17,26 +15,22 @@ timestamp='2011-08-20'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
+-
+-
+-# Originally written by Per Bothner.  Please send patches (context
+-# diff format) to <config-patches at gnu.org> and include a ChangeLog
+-# entry.
++# the same distribution terms that you use for the rest of that
++# program.  This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
+ #
+-# This script attempts to guess a canonical system name similar to
+-# config.sub.  If it succeeds, it prints the system name on stdout, and
+-# exits with 0.  Otherwise, it exits with 1.
++# Originally written by Per Bothner.
+ #
+ # You can get the latest version of this script from:
+ # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
++#
++# Please send patches with a ChangeLog entry to config-patches at gnu.org.
++
+ 
+ me=`echo "$0" | sed -e 's,.*/,,'`
+ 
+@@ -56,9 +50,7 @@ version="\
+ GNU config.guess ($timestamp)
+ 
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+-Software Foundation, Inc.
++Copyright 1992-2014 Free Software Foundation, Inc.
+ 
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -140,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+ 
++case "${UNAME_SYSTEM}" in
++Linux|GNU|GNU/*)
++	# If the system lacks a compiler, then just pick glibc.
++	# We could probably try harder.
++	LIBC=gnu
++
++	eval $set_cc_for_build
++	cat <<-EOF > $dummy.c
++	#include <features.h>
++	#if defined(__UCLIBC__)
++	LIBC=uclibc
++	#elif defined(__dietlibc__)
++	LIBC=dietlibc
++	#else
++	LIBC=gnu
++	#endif
++	EOF
++	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
++	;;
++esac
++
+ # Note: order is significant - the case branches are not exclusive.
+ 
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+     *:NetBSD:*:*)
+ 	# NetBSD (nbsd) targets should (where applicable) match one or
+-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+ 	# switched to ELF, *-*-netbsd* would select the old
+ 	# object file format.  This provides both forward
+@@ -202,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ 	echo "${machine}-${os}${release}"
+ 	exit ;;
++    *:Bitrig:*:*)
++	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
++	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
++	exit ;;
+     *:OpenBSD:*:*)
+ 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+@@ -304,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ 	echo arm-acorn-riscix${UNAME_RELEASE}
+ 	exit ;;
+-    arm:riscos:*:*|arm:RISCOS:*:*)
++    arm*:riscos:*:*|arm*:RISCOS:*:*)
+ 	echo arm-unknown-riscos
+ 	exit ;;
+     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+@@ -803,9 +820,15 @@ EOF
+     i*:CYGWIN*:*)
+ 	echo ${UNAME_MACHINE}-pc-cygwin
+ 	exit ;;
++    *:MINGW64*:*)
++	echo ${UNAME_MACHINE}-pc-mingw64
++	exit ;;
+     *:MINGW*:*)
+ 	echo ${UNAME_MACHINE}-pc-mingw32
+ 	exit ;;
++    *:MSYS*:*)
++	echo ${UNAME_MACHINE}-pc-msys
++	exit ;;
+     i*:windows32*:*)
+ 	# uname -m includes "-pc" on this system.
+ 	echo ${UNAME_MACHINE}-mingw32
+@@ -851,15 +874,22 @@ EOF
+ 	exit ;;
+     *:GNU:*:*)
+ 	# the GNU system
+-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ 	exit ;;
+     *:GNU/*:*:*)
+ 	# other systems with GNU libc and userland
+-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ 	exit ;;
+     i*86:Minix:*:*)
+ 	echo ${UNAME_MACHINE}-pc-minix
+ 	exit ;;
++    aarch64:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    aarch64_be:Linux:*:*)
++	UNAME_MACHINE=aarch64_be
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
+     alpha:Linux:*:*)
+ 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ 	  EV5)   UNAME_MACHINE=alphaev5 ;;
+@@ -871,56 +901,54 @@ EOF
+ 	  EV68*) UNAME_MACHINE=alphaev68 ;;
+ 	esac
+ 	objdump --private-headers /bin/sh | grep -q ld.so.1
+-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    arc:Linux:*:* | arceb:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     arm*:Linux:*:*)
+ 	eval $set_cc_for_build
+ 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ 	    | grep -q __ARM_EABI__
+ 	then
+-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	else
+ 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ 		| grep -q __ARM_PCS_VFP
+ 	    then
+-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ 	    else
+-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
++		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ 	    fi
+ 	fi
+ 	exit ;;
+     avr32*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     cris:Linux:*:*)
+-	echo cris-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ 	exit ;;
+     crisv32:Linux:*:*)
+-	echo crisv32-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ 	exit ;;
+     frv:Linux:*:*)
+-	echo frv-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    hexagon:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     i*86:Linux:*:*)
+-	LIBC=gnu
+-	eval $set_cc_for_build
+-	sed 's/^	//' << EOF >$dummy.c
+-	#ifdef __dietlibc__
+-	LIBC=dietlibc
+-	#endif
+-EOF
+-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
++	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ 	exit ;;
+     ia64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m32r*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m68*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     mips:Linux:*:* | mips64:Linux:*:*)
+ 	eval $set_cc_for_build
+@@ -939,54 +967,63 @@ EOF
+ 	#endif
+ EOF
+ 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ 	;;
+-    or32:Linux:*:*)
+-	echo or32-unknown-linux-gnu
++    openrisc*:Linux:*:*)
++	echo or1k-unknown-linux-${LIBC}
++	exit ;;
++    or32:Linux:*:* | or1k*:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     padre:Linux:*:*)
+-	echo sparc-unknown-linux-gnu
++	echo sparc-unknown-linux-${LIBC}
+ 	exit ;;
+     parisc64:Linux:*:* | hppa64:Linux:*:*)
+-	echo hppa64-unknown-linux-gnu
++	echo hppa64-unknown-linux-${LIBC}
+ 	exit ;;
+     parisc:Linux:*:* | hppa:Linux:*:*)
+ 	# Look for CPU level
+ 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+-	  *)    echo hppa-unknown-linux-gnu ;;
++	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++	  *)    echo hppa-unknown-linux-${LIBC} ;;
+ 	esac
+ 	exit ;;
+     ppc64:Linux:*:*)
+-	echo powerpc64-unknown-linux-gnu
++	echo powerpc64-unknown-linux-${LIBC}
+ 	exit ;;
+     ppc:Linux:*:*)
+-	echo powerpc-unknown-linux-gnu
++	echo powerpc-unknown-linux-${LIBC}
++	exit ;;
++    ppc64le:Linux:*:*)
++	echo powerpc64le-unknown-linux-${LIBC}
++	exit ;;
++    ppcle:Linux:*:*)
++	echo powerpcle-unknown-linux-${LIBC}
+ 	exit ;;
+     s390:Linux:*:* | s390x:Linux:*:*)
+-	echo ${UNAME_MACHINE}-ibm-linux
++	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ 	exit ;;
+     sh64*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sh*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sparc:Linux:*:* | sparc64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     tile*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     vax:Linux:*:*)
+-	echo ${UNAME_MACHINE}-dec-linux-gnu
++	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ 	exit ;;
+     x86_64:Linux:*:*)
+-	echo x86_64-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     xtensa*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     i*86:DYNIX/ptx:4*:*)
+ 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+@@ -1190,6 +1227,9 @@ EOF
+     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+ 	echo i586-pc-haiku
+ 	exit ;;
++    x86_64:Haiku:*:*)
++	echo x86_64-unknown-haiku
++	exit ;;
+     SX-4:SUPER-UX:*:*)
+ 	echo sx4-nec-superux${UNAME_RELEASE}
+ 	exit ;;
+@@ -1216,19 +1256,31 @@ EOF
+ 	exit ;;
+     *:Darwin:*:*)
+ 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+-	case $UNAME_PROCESSOR in
+-	    i386)
+-		eval $set_cc_for_build
+-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+-		      grep IS_64BIT_ARCH >/dev/null
+-		  then
+-		      UNAME_PROCESSOR="x86_64"
+-		  fi
+-		fi ;;
+-	    unknown) UNAME_PROCESSOR=powerpc ;;
+-	esac
++	eval $set_cc_for_build
++	if test "$UNAME_PROCESSOR" = unknown ; then
++	    UNAME_PROCESSOR=powerpc
++	fi
++	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
++	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
++		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++		    grep IS_64BIT_ARCH >/dev/null
++		then
++		    case $UNAME_PROCESSOR in
++			i386) UNAME_PROCESSOR=x86_64 ;;
++			powerpc) UNAME_PROCESSOR=powerpc64 ;;
++		    esac
++		fi
++	    fi
++	elif test "$UNAME_PROCESSOR" = i386 ; then
++	    # Avoid executing cc on OS X 10.9, as it ships with a stub
++	    # that puts up a graphical alert prompting to install
++	    # developer tools.  Any system running Mac OS X 10.7 or
++	    # later (Darwin 11 and later) is required to have a 64-bit
++	    # processor. This is not true of the ARM version of Darwin
++	    # that Apple uses in portable devices.
++	    UNAME_PROCESSOR=x86_64
++	fi
+ 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ 	exit ;;
+     *:procnto*:*:* | *:QNX:[0123456789]*:*)
+@@ -1245,7 +1297,7 @@ EOF
+     NEO-?:NONSTOP_KERNEL:*:*)
+ 	echo neo-tandem-nsk${UNAME_RELEASE}
+ 	exit ;;
+-    NSE-?:NONSTOP_KERNEL:*:*)
++    NSE-*:NONSTOP_KERNEL:*:*)
+ 	echo nse-tandem-nsk${UNAME_RELEASE}
+ 	exit ;;
+     NSR-?:NONSTOP_KERNEL:*:*)
+@@ -1314,158 +1366,10 @@ EOF
+     i*86:AROS:*:*)
+ 	echo ${UNAME_MACHINE}-pc-aros
+ 	exit ;;
+-esac
+-
+-#echo '(No uname command or uname output not recognized.)' 1>&2
+-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+-
+-eval $set_cc_for_build
+-cat >$dummy.c <<EOF
+-#ifdef _SEQUENT_
+-# include <sys/types.h>
+-# include <sys/utsname.h>
+-#endif
+-main ()
+-{
+-#if defined (sony)
+-#if defined (MIPSEB)
+-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+-     I don't know....  */
+-  printf ("mips-sony-bsd\n"); exit (0);
+-#else
+-#include <sys/param.h>
+-  printf ("m68k-sony-newsos%s\n",
+-#ifdef NEWSOS4
+-	"4"
+-#else
+-	""
+-#endif
+-	); exit (0);
+-#endif
+-#endif
+-
+-#if defined (__arm) && defined (__acorn) && defined (__unix)
+-  printf ("arm-acorn-riscix\n"); exit (0);
+-#endif
+-
+-#if defined (hp300) && !defined (hpux)
+-  printf ("m68k-hp-bsd\n"); exit (0);
+-#endif
+-
+-#if defined (NeXT)
+-#if !defined (__ARCHITECTURE__)
+-#define __ARCHITECTURE__ "m68k"
+-#endif
+-  int version;
+-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+-  if (version < 4)
+-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+-  else
+-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+-  exit (0);
+-#endif
+-
+-#if defined (MULTIMAX) || defined (n16)
+-#if defined (UMAXV)
+-  printf ("ns32k-encore-sysv\n"); exit (0);
+-#else
+-#if defined (CMU)
+-  printf ("ns32k-encore-mach\n"); exit (0);
+-#else
+-  printf ("ns32k-encore-bsd\n"); exit (0);
+-#endif
+-#endif
+-#endif
+-
+-#if defined (__386BSD__)
+-  printf ("i386-pc-bsd\n"); exit (0);
+-#endif
+-
+-#if defined (sequent)
+-#if defined (i386)
+-  printf ("i386-sequent-dynix\n"); exit (0);
+-#endif
+-#if defined (ns32000)
+-  printf ("ns32k-sequent-dynix\n"); exit (0);
+-#endif
+-#endif
+-
+-#if defined (_SEQUENT_)
+-    struct utsname un;
+-
+-    uname(&un);
+-
+-    if (strncmp(un.version, "V2", 2) == 0) {
+-	printf ("i386-sequent-ptx2\n"); exit (0);
+-    }
+-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+-	printf ("i386-sequent-ptx1\n"); exit (0);
+-    }
+-    printf ("i386-sequent-ptx\n"); exit (0);
+-
+-#endif
+-
+-#if defined (vax)
+-# if !defined (ultrix)
+-#  include <sys/param.h>
+-#  if defined (BSD)
+-#   if BSD == 43
+-      printf ("vax-dec-bsd4.3\n"); exit (0);
+-#   else
+-#    if BSD == 199006
+-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+-#    else
+-      printf ("vax-dec-bsd\n"); exit (0);
+-#    endif
+-#   endif
+-#  else
+-    printf ("vax-dec-bsd\n"); exit (0);
+-#  endif
+-# else
+-    printf ("vax-dec-ultrix\n"); exit (0);
+-# endif
+-#endif
+-
+-#if defined (alliant) && defined (i860)
+-  printf ("i860-alliant-bsd\n"); exit (0);
+-#endif
+-
+-  exit (1);
+-}
+-EOF
+-
+-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+-	{ echo "$SYSTEM_NAME"; exit; }
+-
+-# Apollos put the system type in the environment.
+-
+-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+-
+-# Convex versions that predate uname can use getsysinfo(1)
+-
+-if [ -x /usr/convex/getsysinfo ]
+-then
+-    case `getsysinfo -f cpu_type` in
+-    c1*)
+-	echo c1-convex-bsd
+-	exit ;;
+-    c2*)
+-	if getsysinfo -f scalar_acc
+-	then echo c32-convex-bsd
+-	else echo c2-convex-bsd
+-	fi
+-	exit ;;
+-    c34*)
+-	echo c34-convex-bsd
++    x86_64:VMkernel:*:*)
++	echo ${UNAME_MACHINE}-unknown-esx
+ 	exit ;;
+-    c38*)
+-	echo c38-convex-bsd
+-	exit ;;
+-    c4*)
+-	echo c4-convex-bsd
+-	exit ;;
+-    esac
+-fi
++esac
+ 
+ cat >&2 <<EOF
+ $0: unable to guess system type
+diff --git a/config.sub b/config.sub
+old mode 100755
+new mode 100644
+index 0d2cddec..d654d03
+--- a/config.sub
++++ b/config.sub
+@@ -1,38 +1,31 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-#   2011 Free Software Foundation, Inc.
++#   Copyright 1992-2014 Free Software Foundation, Inc.
+ 
+-timestamp='2011-09-09'
++timestamp='2014-05-01'
+ 
+-# This file is (in principle) common to ALL GNU software.
+-# The presence of a machine in this file suggests that SOME GNU software
+-# can handle that machine.  It does not imply ALL GNU software can.
+-#
+-# This file is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
++# This file is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see <http://www.gnu.org/licenses/>.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
++# the same distribution terms that you use for the rest of that
++# program.  This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
+ 
+ 
+-# Please send patches to <config-patches at gnu.org>.  Submit a context
+-# diff and a properly formatted GNU ChangeLog entry.
++# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+ #
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+@@ -75,9 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
+ version="\
+ GNU config.sub ($timestamp)
+ 
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+-Software Foundation, Inc.
++Copyright 1992-2014 Free Software Foundation, Inc.
+ 
+ This is free software; see the source for copying conditions.  There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -125,13 +116,17 @@ esac
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
++  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+   knetbsd*-gnu* | netbsd*-gnu* | \
+   kopensolaris*-gnu* | \
+   storm-chaos* | os2-emx* | rtmk-nova*)
+     os=-$maybe_os
+     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+     ;;
++  android-linux)
++    os=-linux-android
++    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
++    ;;
+   *)
+     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+     if [ $basic_machine != $1 ]
+@@ -154,7 +149,7 @@ case $os in
+ 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+-	-apple | -axis | -knuth | -cray | -microblaze)
++	-apple | -axis | -knuth | -cray | -microblaze*)
+ 		os=
+ 		basic_machine=$1
+ 		;;
+@@ -223,6 +218,12 @@ case $os in
+ 	-isc*)
+ 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ 		;;
++	-lynx*178)
++		os=-lynxos178
++		;;
++	-lynx*5)
++		os=-lynxos5
++		;;
+ 	-lynx*)
+ 		os=-lynxos
+ 		;;
+@@ -247,23 +248,28 @@ case $basic_machine in
+ 	# Some are omitted here because they have special meanings below.
+ 	1750a | 580 \
+ 	| a29k \
++	| aarch64 | aarch64_be \
+ 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ 	| am33_2.0 \
+-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+-        | be32 | be64 \
++	| arc | arceb \
++	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
++	| avr | avr32 \
++	| be32 | be64 \
+ 	| bfin \
+-	| c4x | clipper \
++	| c4x | c8051 | clipper \
+ 	| d10v | d30v | dlx | dsp16xx \
++	| epiphany \
+ 	| fido | fr30 | frv \
+ 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ 	| hexagon \
+ 	| i370 | i860 | i960 | ia64 \
+ 	| ip2k | iq2000 \
++	| k1om \
+ 	| le32 | le64 \
+ 	| lm32 \
+ 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+-	| maxq | mb | microblaze | mcore | mep | metag \
++	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ 	| mips | mipsbe | mipseb | mipsel | mipsle \
+ 	| mips16 \
+ 	| mips64 | mips64el \
+@@ -277,24 +283,26 @@ case $basic_machine in
+ 	| mips64vr5900 | mips64vr5900el \
+ 	| mipsisa32 | mipsisa32el \
+ 	| mipsisa32r2 | mipsisa32r2el \
++	| mipsisa32r6 | mipsisa32r6el \
+ 	| mipsisa64 | mipsisa64el \
+ 	| mipsisa64r2 | mipsisa64r2el \
++	| mipsisa64r6 | mipsisa64r6el \
+ 	| mipsisa64sb1 | mipsisa64sb1el \
+ 	| mipsisa64sr71k | mipsisa64sr71kel \
++	| mipsr5900 | mipsr5900el \
+ 	| mipstx39 | mipstx39el \
+ 	| mn10200 | mn10300 \
+ 	| moxie \
+ 	| mt \
+ 	| msp430 \
+ 	| nds32 | nds32le | nds32be \
+-	| nios | nios2 \
++	| nios | nios2 | nios2eb | nios2el \
+ 	| ns16k | ns32k \
+-	| open8 \
+-	| or32 \
++	| open8 | or1k | or1knd | or32 \
+ 	| pdp10 | pdp11 | pj | pjl \
+ 	| powerpc | powerpc64 | powerpc64le | powerpcle \
+ 	| pyramid \
+-	| rx \
++	| rl78 | rx \
+ 	| score \
+ 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ 	| sh64 | sh64le \
+@@ -318,8 +326,7 @@ case $basic_machine in
+ 	c6x)
+ 		basic_machine=tic6x-unknown
+ 		;;
+-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+-		# Motorola 68HC11/12.
++	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ 		basic_machine=$basic_machine-unknown
+ 		os=-none
+ 		;;
+@@ -332,7 +339,10 @@ case $basic_machine in
+ 	strongarm | thumb | xscale)
+ 		basic_machine=arm-unknown
+ 		;;
+-
++	xgate)
++		basic_machine=$basic_machine-unknown
++		os=-none
++		;;
+ 	xscaleeb)
+ 		basic_machine=armeb-unknown
+ 		;;
+@@ -355,15 +365,16 @@ case $basic_machine in
+ 	# Recognize the basic CPU types with company name.
+ 	580-* \
+ 	| a29k-* \
++	| aarch64-* | aarch64_be-* \
+ 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+ 	| avr-* | avr32-* \
+ 	| be32-* | be64-* \
+ 	| bfin-* | bs2000-* \
+ 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+-	| clipper-* | craynv-* | cydra-* \
++	| c8051-* | clipper-* | craynv-* | cydra-* \
+ 	| d10v-* | d30v-* | dlx-* \
+ 	| elxsi-* \
+ 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+@@ -372,11 +383,13 @@ case $basic_machine in
+ 	| hexagon-* \
+ 	| i*86-* | i860-* | i960-* | ia64-* \
+ 	| ip2k-* | iq2000-* \
++	| k1om-* \
+ 	| le32-* | le64-* \
+ 	| lm32-* \
+ 	| m32c-* | m32r-* | m32rle-* \
+ 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
++	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
++	| microblaze-* | microblazeel-* \
+ 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ 	| mips16-* \
+ 	| mips64-* | mips64el-* \
+@@ -390,23 +403,27 @@ case $basic_machine in
+ 	| mips64vr5900-* | mips64vr5900el-* \
+ 	| mipsisa32-* | mipsisa32el-* \
+ 	| mipsisa32r2-* | mipsisa32r2el-* \
++	| mipsisa32r6-* | mipsisa32r6el-* \
+ 	| mipsisa64-* | mipsisa64el-* \
+ 	| mipsisa64r2-* | mipsisa64r2el-* \
++	| mipsisa64r6-* | mipsisa64r6el-* \
+ 	| mipsisa64sb1-* | mipsisa64sb1el-* \
+ 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
++	| mipsr5900-* | mipsr5900el-* \
+ 	| mipstx39-* | mipstx39el-* \
+ 	| mmix-* \
+ 	| mt-* \
+ 	| msp430-* \
+ 	| nds32-* | nds32le-* | nds32be-* \
+-	| nios-* | nios2-* \
++	| nios-* | nios2-* | nios2eb-* | nios2el-* \
+ 	| none-* | np1-* | ns16k-* | ns32k-* \
+ 	| open8-* \
++	| or1k*-* \
+ 	| orion-* \
+ 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ 	| pyramid-* \
+-	| romp-* | rs6000-* | rx-* \
++	| rl78-* | romp-* | rs6000-* | rx-* \
+ 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+@@ -718,7 +735,6 @@ case $basic_machine in
+ 	i370-ibm* | ibm*)
+ 		basic_machine=i370-ibm
+ 		;;
+-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+ 	i*86v32)
+ 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ 		os=-sysv32
+@@ -776,11 +792,15 @@ case $basic_machine in
+ 		basic_machine=ns32k-utek
+ 		os=-sysv
+ 		;;
+-	microblaze)
++	microblaze*)
+ 		basic_machine=microblaze-xilinx
+ 		;;
++	mingw64)
++		basic_machine=x86_64-pc
++		os=-mingw64
++		;;
+ 	mingw32)
+-		basic_machine=i386-pc
++		basic_machine=i686-pc
+ 		os=-mingw32
+ 		;;
+ 	mingw32ce)
+@@ -815,6 +835,10 @@ case $basic_machine in
+ 	ms1-*)
+ 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ 		;;
++	msys)
++		basic_machine=i686-pc
++		os=-msys
++		;;
+ 	mvs)
+ 		basic_machine=i370-ibm
+ 		os=-mvs
+@@ -1003,7 +1027,11 @@ case $basic_machine in
+ 		basic_machine=i586-unknown
+ 		os=-pw32
+ 		;;
+-	rdos)
++	rdos | rdos64)
++		basic_machine=x86_64-pc
++		os=-rdos
++		;;
++	rdos32)
+ 		basic_machine=i386-pc
+ 		os=-rdos
+ 		;;
+@@ -1330,21 +1358,21 @@ case $os in
+ 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+-	      | -sym* | -kopensolaris* \
++	      | -sym* | -kopensolaris* | -plan9* \
+ 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ 	      | -aos* | -aros* \
+ 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+-	      | -openbsd* | -solidbsd* \
++	      | -bitrig* | -openbsd* | -solidbsd* \
+ 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ 	      | -chorusos* | -chorusrdb* | -cegcc* \
+-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+-	      | -mingw32* | -linux-gnu* | -linux-android* \
+-	      | -linux-newlib* | -linux-uclibc* \
++	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
++	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ 	      | -uxpv* | -beos* | -mpeix* | -udk* \
+ 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+@@ -1352,7 +1380,7 @@ case $os in
+ 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
++	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ 	# Remember, each alternative MUST END IN *, to match a version number.
+ 		;;
+ 	-qnx*)
+@@ -1476,9 +1504,6 @@ case $os in
+ 	-aros*)
+ 		os=-aros
+ 		;;
+-	-kaos*)
+-		os=-kaos
+-		;;
+ 	-zvmoe)
+ 		os=-zvmoe
+ 		;;
+@@ -1527,6 +1552,12 @@ case $basic_machine in
+ 	c4x-* | tic4x-*)
+ 		os=-coff
+ 		;;
++	c8051-*)
++		os=-elf
++		;;
++	hexagon-*)
++		os=-elf
++		;;
+ 	tic54x-*)
+ 		os=-coff
+ 		;;
+@@ -1554,9 +1585,6 @@ case $basic_machine in
+ 		;;
+ 	m68000-sun)
+ 		os=-sunos3
+-		# This also exists in the configure program, but was not the
+-		# default.
+-		# os=-sunos4
+ 		;;
+ 	m68*-cisco)
+ 		os=-aout
+-- 
+1.9.3
+
diff --git a/0002-Linux-AArch64-port.patch b/0002-Linux-AArch64-port.patch
new file mode 100644
index 0000000..db7bfa6
--- /dev/null
+++ b/0002-Linux-AArch64-port.patch
@@ -0,0 +1,1497 @@
+From 09f49fc55104ee7b0fe18dbb5068a4cad7d9fc25 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at redhat.com>
+Date: Fri, 29 Aug 2014 17:17:42 +0200
+Subject: [PATCH 2/2] Linux AArch64 port
+
+(cherry picked from commit 235fa0334e0b45c736b636ba1689e2f8c7458697)
+Conflicts:
+        bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+        bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+        bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+	configure.ac
+
+Change-Id: I37044a37348b203944a8eb9d2204e619055f069d
+---
+ bridges/Library_cpp_uno.mk                         |   5 +
+ bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx  | 310 ++++++++++++++
+ bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx  |  87 ++++
+ .../gcc3_linux_aarch64/callvirtualfunction.cxx     |  66 +++
+ .../gcc3_linux_aarch64/callvirtualfunction.hxx     |  33 ++
+ .../source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx  | 464 +++++++++++++++++++++
+ .../source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx  | 376 +++++++++++++++++
+ configure.ac                                       |   6 +
+ desktop/source/deployment/misc/dp_platform.cxx     |   4 +-
+ jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx   |   2 +
+ solenv/gbuild/platform/LINUX_AARCH64_GCC.mk        |  14 +
+ 11 files changed, 1366 insertions(+), 1 deletion(-)
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+ create mode 100644 bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+ create mode 100644 solenv/gbuild/platform/LINUX_AARCH64_GCC.mk
+
+diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
+index c6ab9a0..0fcaf6b 100644
+--- a/bridges/Library_cpp_uno.mk
++++ b/bridges/Library_cpp_uno.mk
+@@ -35,6 +35,11 @@ $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,gcc3_uno)) : \
+ 	EXTRAOBJECTLISTS += $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist
+ endif
+ 
++else ifeq ($(OS)-$(CPUNAME),LINUX-AARCH64)
++
++bridges_SELECTED_BRIDGE := gcc3_linux_aarch64
++bridge_exception_objects := abi callvirtualfunction cpp2uno uno2cpp
++
+ else ifeq ($(OS)-$(CPUNAME),LINUX-AXP)
+ 
+ bridges_SELECTED_BRIDGE := gcc3_linux_alpha
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+new file mode 100644
+index 0000000..c177b22
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+@@ -0,0 +1,310 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#include <sal/config.h>
++
++#include <cassert>
++#include <cstddef>
++#include <cstring>
++#include <typeinfo>
++
++#include <cxxabi.h>
++#include <dlfcn.h>
++
++#include <boost/unordered_map.hpp>
++#include <com/sun/star/uno/RuntimeException.hpp>
++#include <com/sun/star/uno/genfunc.h>
++#include <rtl/strbuf.hxx>
++#include <rtl/ustrbuf.hxx>
++#include <rtl/ustring.hxx>
++#include <sal/types.h>
++#include <typelib/typeclass.h>
++#include <typelib/typedescription.h>
++#include <uno/any2.h>
++#include <uno/mapping.h>
++
++#include <abi.hxx>
++
++namespace {
++
++OUString toUnoName(char const * name) {
++    assert(name != 0);
++    OUStringBuffer b;
++    bool scoped = *name == 'N';
++    if (scoped) {
++        ++name;
++    }
++    for (;;) {
++        assert(*name >= '0' && *name <= '9');
++        std::size_t n = *name++ - '0';
++        while (*name >= '0' && *name <= '9') {
++            n = 10 * n + (*name++ - '0');
++        }
++        b.appendAscii(name, n);
++        name += n;
++        if (!scoped) {
++            assert(*name == 0);
++            break;
++        }
++        if (*name == 'E') {
++            assert(name[1] == 0);
++            break;
++        }
++        b.append('.');
++    }
++    return b.makeStringAndClear();
++}
++
++class Rtti {
++public:
++    Rtti(): app_(dlopen(0, RTLD_LAZY)) {}
++
++    ~Rtti() { dlclose(app_); }
++
++    std::type_info * getRtti(typelib_TypeDescription const & type);
++
++private:
++    typedef boost::unordered_map<OUString, std::type_info *, OUStringHash> Map;
++
++    void * app_;
++
++    osl::Mutex mutex_;
++    Map map_;
++};
++
++std::type_info * Rtti::getRtti(typelib_TypeDescription const & type) {
++    OUString unoName(type.pTypeName);
++    osl::MutexGuard g(mutex_);
++    Map::iterator i(map_.find(unoName));
++    if (i == map_.end()) {
++        OStringBuffer b;
++        b.append("_ZTIN");
++        for (sal_Int32 j = 0; j != -1;) {
++            OString t(
++                OUStringToOString(
++                    unoName.getToken(0, '.', j), RTL_TEXTENCODING_ASCII_US));
++            b.append(t.getLength());
++            b.append(t);
++        }
++        b.append('E');
++        OString sym(b.makeStringAndClear());
++        std::type_info * rtti = static_cast<std::type_info *>(
++            dlsym(app_, sym.getStr()));
++        if (rtti == 0) {
++            char const * rttiName = sym.getStr() + std::strlen("_ZTI");
++            assert(type.eTypeClass == typelib_TypeClass_EXCEPTION);
++            typelib_CompoundTypeDescription const & ctd
++                = reinterpret_cast<typelib_CompoundTypeDescription const &>(
++                    type);
++            if (ctd.pBaseTypeDescription == 0) {
++                rtti = new __cxxabiv1::__class_type_info(strdup(rttiName));
++            } else {
++                std::type_info * base = getRtti(
++                    ctd.pBaseTypeDescription->aBase);
++                rtti = new __cxxabiv1::__si_class_type_info(
++                    strdup(rttiName),
++                    static_cast<__cxxabiv1::__class_type_info *>(base));
++            }
++        }
++        i = map_.insert(Map::value_type(unoName, rtti)).first;
++    }
++    return i->second;
++}
++
++struct theRttiFactory: public rtl::Static<Rtti, theRttiFactory> {};
++
++std::type_info * getRtti(typelib_TypeDescription const & type) {
++    return theRttiFactory::get().getRtti(type);
++}
++
++extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) {
++    abi_aarch64::__cxa_exception * header =
++        static_cast<abi_aarch64::__cxa_exception *>(exception) - 1;
++    OUString unoName(toUnoName(header->exceptionType->name()));
++    typelib_TypeDescription * td = 0;
++    typelib_typedescription_getByName(&td, unoName.pData);
++    assert(td != 0);
++    uno_destructData(exception, td, &css::uno::cpp_release);
++    typelib_typedescription_release(td);
++}
++
++enum StructKind {
++    STRUCT_KIND_EMPTY, STRUCT_KIND_FLOAT, STRUCT_KIND_DOUBLE, STRUCT_KIND_POD,
++    STRUCT_KIND_DTOR
++};
++
++StructKind getStructKind(typelib_CompoundTypeDescription const * type) {
++    StructKind k = type->pBaseTypeDescription == 0
++        ? STRUCT_KIND_EMPTY : getStructKind(type->pBaseTypeDescription);
++    for (sal_Int32 i = 0; i != type->nMembers; ++i) {
++        StructKind k2 = StructKind();
++        switch (type->ppTypeRefs[i]->eTypeClass) {
++        case typelib_TypeClass_BOOLEAN:
++        case typelib_TypeClass_BYTE:
++        case typelib_TypeClass_SHORT:
++        case typelib_TypeClass_UNSIGNED_SHORT:
++        case typelib_TypeClass_LONG:
++        case typelib_TypeClass_UNSIGNED_LONG:
++        case typelib_TypeClass_HYPER:
++        case typelib_TypeClass_UNSIGNED_HYPER:
++        case typelib_TypeClass_CHAR:
++        case typelib_TypeClass_ENUM:
++            k2 = STRUCT_KIND_POD;
++            break;
++        case typelib_TypeClass_FLOAT:
++            k2 = STRUCT_KIND_FLOAT;
++            break;
++        case typelib_TypeClass_DOUBLE:
++            k2 = STRUCT_KIND_DOUBLE;
++            break;
++        case typelib_TypeClass_STRING:
++        case typelib_TypeClass_TYPE:
++        case typelib_TypeClass_ANY:
++        case typelib_TypeClass_SEQUENCE:
++        case typelib_TypeClass_INTERFACE:
++            k2 = STRUCT_KIND_DTOR;
++            break;
++        case typelib_TypeClass_STRUCT:
++            {
++                typelib_TypeDescription * td = 0;
++                TYPELIB_DANGER_GET(&td, type->ppTypeRefs[i]);
++                k2 = getStructKind(
++                    reinterpret_cast<typelib_CompoundTypeDescription const *>(
++                        td));
++                TYPELIB_DANGER_RELEASE(td);
++                break;
++            }
++        default:
++            assert(false);
++        }
++        switch (k2) {
++        case STRUCT_KIND_EMPTY:
++            // this means an empty sub-object, which nevertheless obtains a byte
++            // of storage (TODO: does it?), so the full object cannot be a
++            // homogenous collection of float or double
++        case STRUCT_KIND_POD:
++            assert(k != STRUCT_KIND_DTOR);
++            k = STRUCT_KIND_POD;
++            break;
++        case STRUCT_KIND_FLOAT:
++        case STRUCT_KIND_DOUBLE:
++            if (k == STRUCT_KIND_EMPTY) {
++                k = k2;
++            } else if (k != k2) {
++                assert(k != STRUCT_KIND_DTOR);
++                k = STRUCT_KIND_POD;
++            }
++            break;
++        case STRUCT_KIND_DTOR:
++            return STRUCT_KIND_DTOR;
++        }
++    }
++    return k;
++}
++
++}
++
++namespace abi_aarch64 {
++
++void mapException(
++    __cxa_exception * exception, uno_Any * any, uno_Mapping * mapping)
++{
++    assert(exception != 0);
++    OUString unoName(toUnoName(exception->exceptionType->name()));
++    typelib_TypeDescription * td = 0;
++    typelib_typedescription_getByName(&td, unoName.pData);
++    if (td == 0) {
++        css::uno::RuntimeException e(
++            "exception type not found: " + unoName,
++            css::uno::Reference<css::uno::XInterface>());
++        uno_type_any_constructAndConvert(
++            any, &e,
++            cppu::UnoType<css::uno::RuntimeException>::get().getTypeLibType(),
++            mapping);
++    } else {
++        uno_any_constructAndConvert(any, exception->adjustedPtr, td, mapping);
++        typelib_typedescription_release(td);
++    }
++}
++
++void raiseException(uno_Any * any, uno_Mapping * mapping) {
++    typelib_TypeDescription * td = 0;
++    TYPELIB_DANGER_GET(&td, any->pType);
++    if (td == 0) {
++        throw css::uno::RuntimeException(
++            "no typedescription for " + OUString(any->pType->pTypeName),
++            css::uno::Reference<css::uno::XInterface>());
++    }
++    void * exc = __cxxabiv1::__cxa_allocate_exception(td->nSize);
++    uno_copyAndConvertData(exc, any->pData, td, mapping);
++    uno_any_destruct(any, 0);
++    std::type_info * rtti = getRtti(*td);
++    TYPELIB_DANGER_RELEASE(td);
++    __cxxabiv1::__cxa_throw(exc, rtti, deleteException);
++}
++
++ReturnKind getReturnKind(typelib_TypeDescription const * type) {
++    switch (type->eTypeClass) {
++    default:
++        assert(false);
++        // fall through to avoid warnings
++    case typelib_TypeClass_VOID:
++    case typelib_TypeClass_BOOLEAN:
++    case typelib_TypeClass_BYTE:
++    case typelib_TypeClass_SHORT:
++    case typelib_TypeClass_UNSIGNED_SHORT:
++    case typelib_TypeClass_LONG:
++    case typelib_TypeClass_UNSIGNED_LONG:
++    case typelib_TypeClass_HYPER:
++    case typelib_TypeClass_UNSIGNED_HYPER:
++    case typelib_TypeClass_FLOAT:
++    case typelib_TypeClass_DOUBLE:
++    case typelib_TypeClass_CHAR:
++    case typelib_TypeClass_ENUM:
++        assert(type->nSize <= 16);
++        return RETURN_KIND_REG;
++    case typelib_TypeClass_STRING:
++    case typelib_TypeClass_TYPE:
++    case typelib_TypeClass_ANY:
++    case typelib_TypeClass_SEQUENCE:
++    case typelib_TypeClass_INTERFACE:
++        return RETURN_KIND_INDIRECT;
++    case typelib_TypeClass_STRUCT:
++        if (type->nSize > 16) {
++            return RETURN_KIND_INDIRECT;
++        }
++        switch (getStructKind(
++                    reinterpret_cast<typelib_CompoundTypeDescription const *>(
++                        type)))
++        {
++        case STRUCT_KIND_FLOAT:
++            return RETURN_KIND_HFA_FLOAT;
++        case STRUCT_KIND_DOUBLE:
++            return RETURN_KIND_HFA_DOUBLE;
++        case STRUCT_KIND_DTOR:
++            return RETURN_KIND_INDIRECT;
++        default:
++            return RETURN_KIND_REG;
++        }
++    }
++}
++
++}
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+new file mode 100644
+index 0000000..2e3ce61
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.hxx
+@@ -0,0 +1,87 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_ABI_HXX
++#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_ABI_HXX
++
++#include <sal/config.h>
++
++#include <exception>
++#include <typeinfo>
++
++#include <typelib/typedescription.h>
++#include <uno/any2.h>
++#include <uno/mapping.h>
++
++namespace abi_aarch64 {
++
++// Following declarations from libstdc++-v3/libsupc++/unwind-cxx.h and
++// lib/gcc/*-*-*/*/include/unwind.h:
++
++struct _Unwind_Exception
++{
++    unsigned exception_class __attribute__((__mode__(__DI__)));
++    void * exception_cleanup;
++    unsigned private_1 __attribute__((__mode__(__word__)));
++    unsigned private_2 __attribute__((__mode__(__word__)));
++} __attribute__((__aligned__));
++
++struct __cxa_exception
++{
++    std::type_info *exceptionType;
++    void (*exceptionDestructor)(void *);
++
++    std::unexpected_handler unexpectedHandler;
++    std::terminate_handler terminateHandler;
++
++    __cxa_exception *nextException;
++
++    int handlerCount;
++
++    int handlerSwitchValue;
++    const unsigned char *actionRecord;
++    const unsigned char *languageSpecificData;
++    void *catchTemp;
++    void *adjustedPtr;
++
++    _Unwind_Exception unwindHeader;
++};
++
++struct __cxa_eh_globals
++{
++    __cxa_exception *caughtExceptions;
++    unsigned int uncaughtExceptions;
++};
++
++void mapException(
++    __cxa_exception * exception, uno_Any * any, uno_Mapping * mapping);
++
++void raiseException(uno_Any * any, uno_Mapping * mapping);
++
++enum ReturnKind {
++    RETURN_KIND_REG, RETURN_KIND_HFA_FLOAT, RETURN_KIND_HFA_DOUBLE,
++    RETURN_KIND_INDIRECT };
++
++ReturnKind getReturnKind(typelib_TypeDescription const * type);
++
++}
++
++#endif
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
+new file mode 100644
+index 0000000..09f7696
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx
+@@ -0,0 +1,66 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#include <sal/config.h>
++
++#include <cstring>
++
++#include <sal/types.h>
++#include <sal/alloca.h>
++
++#include <callvirtualfunction.hxx>
++
++void callVirtualFunction(
++    unsigned long function, unsigned long * gpr, unsigned long * fpr,
++    unsigned long * stack, sal_Int32 sp, void * ret)
++{
++    void * stackargs;
++    if (sp != 0) {
++        stackargs = alloca(((sp + 1) >> 1) * 16);
++        std::memcpy(stackargs, stack, sp * 8);
++    }
++    asm volatile(
++        "ldp x0, x1, [%[gpr_]]\n\t"
++        "ldp x2, x3, [%[gpr_], #16]\n\t"
++        "ldp x4, x5, [%[gpr_], #32]\n\t"
++        "ldp x6, x7, [%[gpr_], #48]\n\t"
++        "ldr x8, %[ret_]\n\t"
++        "ldr x9, %[function_]\n\t"
++        "ldp d0, d1, [%[fpr_]]\n\t"
++        "ldp d2, d3, [%[fpr_], #16]\n\t"
++        "ldp d4, d5, [%[fpr_], #32]\n\t"
++        "ldp d6, d7, [%[fpr_], #48]\n\t"
++        "blr x9\n\t"
++        "stp x0, x1, [%[gpr_]]\n\t"
++        "stp d0, d1, [%[fpr_]]\n\t"
++        "stp d2, d3, [%[fpr_], #16]\n\t"
++        :: [gpr_]"r" (gpr), [fpr_]"r" (fpr), [function_]"m" (function),
++           [ret_]"m" (ret),
++           "m" (stackargs) // dummy input to prevent optimizing the alloca away
++        : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
++          "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18"/*TODO?*/, "v0",
++          "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11",
++          "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21",
++          "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31",
++          "memory"
++          // only the bottom 64 bits of v8--15 need to be preserved by callees
++    );
++}
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx
+new file mode 100644
+index 0000000..b1b003f
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.hxx
+@@ -0,0 +1,33 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_CALLVIRTUALFUNCTION_HXX
++#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_AARCH64_CALLVIRTUALFUNCTION_HXX
++
++#include <sal/config.h>
++
++#include <sal/types.h>
++
++void callVirtualFunction(
++    unsigned long function, unsigned long * gpr, unsigned long * fpr,
++    unsigned long * stack, sal_Int32 sp, void * ret);
++
++#endif
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+new file mode 100644
+index 0000000..a73d9be
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx
+@@ -0,0 +1,464 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#include <sal/config.h>
++
++#include <cassert>
++#include <cstdarg>
++#include <cstddef>
++#include <cstdlib>
++#include <cstring>
++
++#include <dlfcn.h>
++
++#include <com/sun/star/uno/XInterface.hpp>
++#include <com/sun/star/uno/genfunc.hxx>
++#include <sal/alloca.h>
++#include <sal/types.h>
++#include <typelib/typeclass.h>
++#include <typelib/typedescription.h>
++#include <typelib/typedescription.hxx>
++
++#include <bridges/cpp_uno/shared/bridge.hxx>
++#include <bridges/cpp_uno/shared/cppinterfaceproxy.hxx>
++#include <bridges/cpp_uno/shared/types.hxx>
++#include <bridges/cpp_uno/shared/vtablefactory.hxx>
++
++#include <abi.hxx>
++
++extern "C" void vtableSlotCall_();
++
++namespace {
++
++void call(
++    bridges::cpp_uno::shared::CppInterfaceProxy * proxy,
++    css::uno::TypeDescription const & description,
++    typelib_TypeDescriptionReference * returnType, sal_Int32 count,
++    typelib_MethodParameter * parameters, unsigned long * gpr,
++    unsigned long * fpr, unsigned long * stack, void * indirectRet)
++{
++    typelib_TypeDescription * rtd = 0;
++    if (returnType != 0) {
++        TYPELIB_DANGER_GET(&rtd, returnType);
++    }
++    abi_aarch64::ReturnKind retKind = rtd == 0
++        ? abi_aarch64::RETURN_KIND_REG : abi_aarch64::getReturnKind(rtd);
++    bool retConv = rtd != 0
++        && bridges::cpp_uno::shared::relatesToInterfaceType(rtd);
++    void * retin = retKind == abi_aarch64::RETURN_KIND_INDIRECT && !retConv
++        ? indirectRet : rtd == 0 ? 0 : alloca(rtd->nSize);
++    void ** args = static_cast< void ** >(alloca(count * sizeof (void *)));
++    void ** cppArgs = static_cast< void ** >(alloca(count * sizeof (void *)));
++    typelib_TypeDescription ** argtds = static_cast<typelib_TypeDescription **>(
++        alloca(count * sizeof (typelib_TypeDescription *)));
++    sal_Int32 ngpr = 1;
++    sal_Int32 nfpr = 0;
++    sal_Int32 sp = 0;
++    for (sal_Int32 i = 0; i != count; ++i) {
++        if (!parameters[i].bOut
++            && bridges::cpp_uno::shared::isSimpleType(parameters[i].pTypeRef))
++        {
++            switch (parameters[i].pTypeRef->eTypeClass) {
++            case typelib_TypeClass_BOOLEAN:
++            case typelib_TypeClass_BYTE:
++            case typelib_TypeClass_SHORT:
++            case typelib_TypeClass_UNSIGNED_SHORT:
++            case typelib_TypeClass_LONG:
++            case typelib_TypeClass_UNSIGNED_LONG:
++            case typelib_TypeClass_HYPER:
++            case typelib_TypeClass_UNSIGNED_HYPER:
++            case typelib_TypeClass_CHAR:
++            case typelib_TypeClass_ENUM:
++                args[i] = ngpr == 8 ? stack + sp++ : gpr + ngpr++;
++                break;
++            case typelib_TypeClass_FLOAT:
++            case typelib_TypeClass_DOUBLE:
++                args[i] = nfpr == 8 ? stack + sp++ : fpr + nfpr++;
++                break;
++            default:
++                assert(false);
++            }
++            argtds[i] = 0;
++        } else {
++            cppArgs[i] = reinterpret_cast<void *>(
++                ngpr == 8 ? stack[sp++] : gpr[ngpr++]);
++            typelib_TypeDescription * ptd = 0;
++            TYPELIB_DANGER_GET(&ptd, parameters[i].pTypeRef);
++            if (!parameters[i].bIn) {
++                args[i] = alloca(ptd->nSize);
++                argtds[i] = ptd;
++            } else if (bridges::cpp_uno::shared::relatesToInterfaceType(ptd)) {
++                args[i] = alloca(ptd->nSize);
++                uno_copyAndConvertData(
++                    args[i], cppArgs[i], ptd, proxy->getBridge()->getCpp2Uno());
++                argtds[i] = ptd;
++            } else {
++                args[i] = cppArgs[i];
++                argtds[i] = 0;
++                TYPELIB_DANGER_RELEASE(ptd);
++            }
++        }
++    }
++    uno_Any exc;
++    uno_Any * pexc = &exc;
++    proxy->getUnoI()->pDispatcher(
++        proxy->getUnoI(), description.get(), retin, args, &pexc);
++    if (pexc != 0) {
++        for (sal_Int32 i = 0; i != count; ++i) {
++            if (argtds[i] != 0) {
++                if (parameters[i].bIn) {
++                    uno_destructData(args[i], argtds[i], 0);
++                }
++                TYPELIB_DANGER_RELEASE(argtds[i]);
++            }
++        }
++        if (rtd != 0) {
++            TYPELIB_DANGER_RELEASE(rtd);
++        }
++        abi_aarch64::raiseException(&exc, proxy->getBridge()->getUno2Cpp());
++    }
++    for (sal_Int32 i = 0; i != count; ++i) {
++        if (argtds[i] != 0) {
++            if (parameters[i].bOut) {
++                uno_destructData(
++                    cppArgs[i], argtds[i],
++                    reinterpret_cast<uno_ReleaseFunc>(css::uno::cpp_release));
++                uno_copyAndConvertData(
++                    cppArgs[i], args[i], argtds[i],
++                    proxy->getBridge()->getUno2Cpp());
++            }
++            uno_destructData(args[i], argtds[i], 0);
++            TYPELIB_DANGER_RELEASE(argtds[i]);
++        }
++    }
++    void * retout = 0; // avoid false -Werror=maybe-uninitialized
++    switch (retKind) {
++    case abi_aarch64::RETURN_KIND_REG:
++        switch (rtd == 0 ? typelib_TypeClass_VOID : rtd->eTypeClass) {
++        case typelib_TypeClass_VOID:
++            break;
++        case typelib_TypeClass_BOOLEAN:
++        case typelib_TypeClass_BYTE:
++        case typelib_TypeClass_SHORT:
++        case typelib_TypeClass_UNSIGNED_SHORT:
++        case typelib_TypeClass_LONG:
++        case typelib_TypeClass_UNSIGNED_LONG:
++        case typelib_TypeClass_HYPER:
++        case typelib_TypeClass_UNSIGNED_HYPER:
++        case typelib_TypeClass_CHAR:
++        case typelib_TypeClass_ENUM:
++            std::memcpy(gpr, retin, rtd->nSize);
++            assert(!retConv);
++            break;
++        case typelib_TypeClass_FLOAT:
++        case typelib_TypeClass_DOUBLE:
++            std::memcpy(fpr, retin, rtd->nSize);
++            assert(!retConv);
++            break;
++        case typelib_TypeClass_STRUCT:
++            if (retConv) {
++                retout = gpr;
++            } else {
++                std::memcpy(gpr, retin, rtd->nSize);
++            }
++            break;
++        default:
++            assert(false);
++        }
++        break;
++    case abi_aarch64::RETURN_KIND_HFA_FLOAT:
++        assert(rtd != 0);
++        switch (rtd->nSize) {
++        case 16:
++            std::memcpy(fpr + 3, static_cast<char *>(retin) + 12, 4);
++            // fall through
++        case 12:
++            std::memcpy(fpr + 2, static_cast<char *>(retin) + 8, 4);
++            // fall through
++        case 8:
++            std::memcpy(fpr + 1, static_cast<char *>(retin) + 4, 4);
++            // fall through
++        case 4:
++            std::memcpy(fpr, retin, 4);
++            break;
++        default:
++            assert(false);
++        }
++        assert(!retConv);
++        break;
++    case abi_aarch64::RETURN_KIND_HFA_DOUBLE:
++        assert(rtd != 0);
++        std::memcpy(fpr, retin, rtd->nSize);
++        assert(!retConv);
++        break;
++    case abi_aarch64::RETURN_KIND_INDIRECT:
++        retout = indirectRet;
++        break;
++    }
++    if (retConv) {
++        uno_copyAndConvertData(
++            retout, retin, rtd, proxy->getBridge()->getUno2Cpp());
++        uno_destructData(retin, rtd, 0);
++    }
++    if (rtd != 0) {
++        TYPELIB_DANGER_RELEASE(rtd);
++    }
++}
++
++extern "C" void vtableCall(
++    sal_Int32 functionIndex, sal_Int32 vtableOffset,
++    unsigned long * gpr, unsigned long * fpr, unsigned long  * stack,
++    void * indirectRet)
++{
++    bridges::cpp_uno::shared::CppInterfaceProxy * proxy
++        = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
++            reinterpret_cast<char *>(gpr[0]) - vtableOffset);
++    typelib_InterfaceTypeDescription * type = proxy->getTypeDescr();
++    assert(functionIndex < type->nMapFunctionIndexToMemberIndex);
++    sal_Int32 pos = type->pMapFunctionIndexToMemberIndex[functionIndex];
++    css::uno::TypeDescription desc(type->ppAllMembers[pos]);
++    switch (desc.get()->eTypeClass) {
++    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
++        if (type->pMapMemberIndexToFunctionIndex[pos] == functionIndex) {
++            // Getter:
++            call(
++                proxy, desc,
++                reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(
++                    desc.get())->pAttributeTypeRef,
++                0, 0, gpr, fpr, stack, indirectRet);
++        } else {
++            // Setter:
++            typelib_MethodParameter param = {
++                0,
++                reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(
++                    desc.get())->pAttributeTypeRef,
++                true, false };
++            call(proxy, desc, 0, 1, &param, gpr, fpr, stack, indirectRet);
++        }
++        break;
++    case typelib_TypeClass_INTERFACE_METHOD:
++        switch (functionIndex) {
++        case 1:
++            proxy->acquireProxy();
++            break;
++        case 2:
++            proxy->releaseProxy();
++            break;
++        case 0:
++            {
++                typelib_TypeDescription * td = 0;
++                TYPELIB_DANGER_GET(
++                    &td,
++                    (reinterpret_cast<css::uno::Type *>(gpr[1])
++                     ->getTypeLibType()));
++                if (td != 0 && td->eTypeClass == typelib_TypeClass_INTERFACE) {
++                    css::uno::XInterface * ifc = 0;
++                    proxy->getBridge()->getCppEnv()->getRegisteredInterface(
++                        proxy->getBridge()->getCppEnv(),
++                        reinterpret_cast<void **>(&ifc), proxy->getOid().pData,
++                        reinterpret_cast<typelib_InterfaceTypeDescription *>(
++                            td));
++                    if (ifc != 0) {
++                        uno_any_construct(
++                            reinterpret_cast<uno_Any *>(indirectRet), &ifc, td,
++                            reinterpret_cast<uno_AcquireFunc>(
++                                css::uno::cpp_acquire));
++                        ifc->release();
++                        TYPELIB_DANGER_RELEASE(td);
++                        break;
++                    }
++                    TYPELIB_DANGER_RELEASE(td);
++                }
++            }
++            // fall through
++        default:
++            call(
++                proxy, desc,
++                reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(
++                    desc.get())->pReturnTypeRef,
++                reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(
++                    desc.get())->nParams,
++                reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(
++                    desc.get())->pParams,
++                gpr, fpr, stack, indirectRet);
++        }
++        break;
++    default:
++        assert(false);
++    }
++}
++
++struct aarch64_va_list {
++    void * stack;
++    void * gr_top;
++    void * vr_top;
++    int gr_offs;
++    int vr_offs;
++};
++
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wvolatile-register-var"
++extern "C" void vtableSlotCall(
++    unsigned long gpr0, unsigned long gpr1, unsigned long gpr2,
++    unsigned long gpr3, unsigned long gpr4, unsigned long gpr5,
++    unsigned long gpr6, unsigned long gpr7, double fpr0, double fpr1,
++    double fpr2, double fpr3, double fpr4, double fpr5, double fpr6,
++    double fpr7, ...)
++{
++    register void * volatile indirectRet asm ("x8");
++    register sal_Int32 volatile functionIndex asm ("x9");
++    register sal_Int32 volatile vtableOffset asm ("x10");
++    va_list ap;
++    va_start(ap, fpr7);
++    assert(sizeof (va_list) == sizeof (aarch64_va_list));
++    unsigned long gpr[8];
++    gpr[0] = gpr0;
++    gpr[1] = gpr1;
++    gpr[2] = gpr2;
++    gpr[3] = gpr3;
++    gpr[4] = gpr4;
++    gpr[5] = gpr5;
++    gpr[6] = gpr6;
++    gpr[7] = gpr7;
++    double fpr[8];
++    fpr[0] = fpr0;
++    fpr[1] = fpr1;
++    fpr[2] = fpr2;
++    fpr[3] = fpr3;
++    fpr[4] = fpr4;
++    fpr[5] = fpr5;
++    fpr[6] = fpr6;
++    fpr[7] = fpr7;
++    vtableCall(
++        functionIndex, vtableOffset, gpr,
++        reinterpret_cast<unsigned long *>(fpr),
++        static_cast<unsigned long *>(
++            reinterpret_cast<aarch64_va_list *>(&ap)->stack),
++        indirectRet);
++    asm volatile(
++        "ldp x0, x1, [%[gpr_]]\n\t"
++        "ldp d0, d1, [%[fpr_]]\n\t"
++        "ldp d2, d3, [%[fpr_], #16]\n\t"
++        :: [gpr_]"r" (gpr), [fpr_]"r" (fpr)
++        : "r0", "r1", "v0", "v1", "v2", "v3");
++}
++#pragma GCC diagnostic pop
++
++std::size_t const codeSnippetSize = 8 * 4;
++
++unsigned char * generateCodeSnippet(
++    unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset)
++{
++    // movz x9, <low functionIndex>
++    reinterpret_cast<unsigned int *>(code)[0] = 0xD2800009
++        | ((functionIndex & 0xFFFF) << 5);
++    // movk x9, <high functionIndex>, LSL #16
++    reinterpret_cast<unsigned int *>(code)[1] = 0xF2A00009
++        | ((functionIndex >> 16) << 5);
++    // movz x10, <low vtableOffset>
++    reinterpret_cast<unsigned int *>(code)[2] = 0xD280000A
++        | ((vtableOffset & 0xFFFF) << 5);
++    // movk x10, <high vtableOffset>, LSL #16
++    reinterpret_cast<unsigned int *>(code)[3] = 0xF2A0000A
++        | ((vtableOffset >> 16) << 5);
++    // ldr x11, +2*4
++    reinterpret_cast<unsigned int *>(code)[4] = 0x5800004B;
++    // br x11
++    reinterpret_cast<unsigned int *>(code)[5] = 0xD61F0160;
++    reinterpret_cast<unsigned long *>(code)[3]
++        = reinterpret_cast<unsigned long>(&vtableSlotCall);
++    return code + codeSnippetSize;
++}
++
++}
++
++struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
++
++bridges::cpp_uno::shared::VtableFactory::Slot *
++bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) {
++    return static_cast<Slot *>(block) + 2;
++}
++
++sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
++    sal_Int32 slotCount)
++{
++    return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize;
++}
++
++bridges::cpp_uno::shared::VtableFactory::Slot *
++bridges::cpp_uno::shared::VtableFactory::initializeBlock(
++    void * block, sal_Int32 slotCount)
++{
++    Slot * slots = mapBlockToVtable(block);
++    slots[-2].fn = 0;
++    slots[-1].fn = 0;
++    return slots + slotCount;
++}
++
++unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
++    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
++    typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
++    sal_Int32 functionCount, sal_Int32 vtableOffset)
++{
++    (*slots) -= functionCount;
++    Slot * s = *slots;
++    for (sal_Int32 i = 0; i != type->nMembers; ++i) {
++        typelib_TypeDescription * td = 0;
++        TYPELIB_DANGER_GET(&td, type->ppMembers[i]);
++        assert(td != 0);
++        switch (td->eTypeClass) {
++        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
++            {
++                typelib_InterfaceAttributeTypeDescription * atd
++                    = reinterpret_cast<
++                        typelib_InterfaceAttributeTypeDescription *>(td);
++                // Getter:
++                (s++)->fn = code + writetoexecdiff;
++                code = generateCodeSnippet(
++                    code, functionOffset++, vtableOffset);
++                // Setter:
++                if (!atd->bReadOnly) {
++                    (s++)->fn = code + writetoexecdiff;
++                    code = generateCodeSnippet(
++                        code, functionOffset++, vtableOffset);
++                }
++                break;
++            }
++        case typelib_TypeClass_INTERFACE_METHOD:
++            (s++)->fn = code + writetoexecdiff;
++            code = generateCodeSnippet(code, functionOffset++, vtableOffset);
++            break;
++        default:
++            assert(false);
++        }
++        TYPELIB_DANGER_RELEASE(td);
++    }
++    return code;
++}
++
++void bridges::cpp_uno::shared::VtableFactory::flushCode(
++    unsigned char const * begin, unsigned char const * end)
++{
++   static void (*clear_cache)(unsigned char const *, unsigned char const *)
++       = (void (*)(unsigned char const *, unsigned char const *)) dlsym(
++           RTLD_DEFAULT, "__clear_cache");
++   (*clear_cache)(begin, end);
++}
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+new file mode 100644
+index 0000000..9c9a24a
+--- /dev/null
++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/uno2cpp.cxx
+@@ -0,0 +1,376 @@
++/* -*- 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/.
++ *
++ * This file incorporates work covered by the following license notice:
++ *
++ *   Licensed to the Apache Software Foundation (ASF) under one or more
++ *   contributor license agreements. See the NOTICE file distributed
++ *   with this work for additional information regarding copyright
++ *   ownership. The ASF licenses this file to you under the Apache
++ *   License, Version 2.0 (the "License"); you may not use this file
++ *   except in compliance with the License. You may obtain a copy of
++ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
++ */
++
++#include <sal/config.h>
++
++#include <cassert>
++#include <cstring>
++#include <exception>
++#include <typeinfo>
++
++#include <cxxabi.h>
++
++#include <bridges/cpp_uno/shared/bridge.hxx>
++#include <bridges/cpp_uno/shared/types.hxx>
++#include <bridges/cpp_uno/shared/unointerfaceproxy.hxx>
++#include <bridges/cpp_uno/shared/vtables.hxx>
++#include <com/sun/star/uno/Exception.hpp>
++#include <com/sun/star/uno/RuntimeException.hpp>
++#include <com/sun/star/uno/genfunc.hxx>
++#include <rtl/textenc.h>
++#include <rtl/ustring.hxx>
++#include <sal/alloca.h>
++#include <sal/types.h>
++#include <typelib/typeclass.h>
++#include <typelib/typedescription.h>
++#include <uno/any2.h>
++#include <uno/data.h>
++
++#include <abi.hxx>
++#include <callvirtualfunction.hxx>
++
++namespace {
++
++void pushArgument(
++    unsigned long value, unsigned long * stack, sal_Int32 * sp,
++    unsigned long * regs, sal_Int32 * nregs)
++{
++    (*nregs != 8 ? regs[(*nregs)++] : stack[(*sp)++]) = value;
++}
++
++void call(
++    bridges::cpp_uno::shared::UnoInterfaceProxy * proxy,
++    bridges::cpp_uno::shared::VtableSlot slot,
++    typelib_TypeDescriptionReference * returnType, sal_Int32 count,
++    typelib_MethodParameter * parameters, void * returnValue, void ** arguments,
++    uno_Any ** exception)
++{
++    typelib_TypeDescription * rtd = 0;
++    TYPELIB_DANGER_GET(&rtd, returnType);
++    abi_aarch64::ReturnKind retKind = abi_aarch64::getReturnKind(rtd);
++    bool retConv = bridges::cpp_uno::shared::relatesToInterfaceType(rtd);
++    void * ret = retConv ? alloca(rtd->nSize) : returnValue;
++    unsigned long ** thisPtr
++        = reinterpret_cast<unsigned long **>(proxy->getCppI()) + slot.offset;
++    unsigned long * stack = static_cast<unsigned long *>(
++        alloca(count * sizeof (unsigned long)));
++    sal_Int32 sp = 0;
++    unsigned long gpr[8];
++    sal_Int32 ngpr = 0;
++    unsigned long fpr[8];
++    sal_Int32 nfpr = 0;
++    gpr[ngpr++] = reinterpret_cast<unsigned long>(thisPtr);
++    void ** cppArgs = static_cast<void **>(alloca(count * sizeof (void *)));
++    typelib_TypeDescription ** ptds =
++        static_cast<typelib_TypeDescription **>(
++            alloca(count * sizeof (typelib_TypeDescription *)));
++    for (sal_Int32 i = 0; i != count; ++i) {
++        if (!parameters[i].bOut &&
++            bridges::cpp_uno::shared::isSimpleType(parameters[i].pTypeRef))
++        {
++            cppArgs[i] = 0;
++            switch (parameters[i].pTypeRef->eTypeClass) {
++            case typelib_TypeClass_BOOLEAN:
++                pushArgument(
++                    *static_cast<sal_Bool *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_BYTE:
++                pushArgument(
++                    *static_cast<sal_Int8 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_SHORT:
++                pushArgument(
++                    *static_cast<sal_Int16 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_UNSIGNED_SHORT:
++                pushArgument(
++                    *static_cast<sal_uInt16 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_LONG:
++            case typelib_TypeClass_ENUM:
++                pushArgument(
++                    *static_cast<sal_Int32 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_UNSIGNED_LONG:
++                pushArgument(
++                    *static_cast<sal_uInt32 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_HYPER:
++                pushArgument(
++                    *static_cast<sal_Int64 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_UNSIGNED_HYPER:
++                pushArgument(
++                    *static_cast<sal_uInt64 *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            case typelib_TypeClass_FLOAT:
++                pushArgument(
++                    *static_cast<unsigned int *>(arguments[i]), stack, &sp, fpr,
++                    &nfpr);
++                break;
++            case typelib_TypeClass_DOUBLE:
++                pushArgument(
++                    *static_cast<unsigned long *>(arguments[i]), stack, &sp,
++                    fpr, &nfpr);
++                break;
++            case typelib_TypeClass_CHAR:
++                pushArgument(
++                    *static_cast<sal_Unicode *>(arguments[i]), stack, &sp, gpr,
++                    &ngpr);
++                break;
++            default:
++                assert(false);
++            }
++        } else {
++            typelib_TypeDescription * ptd = 0;
++            TYPELIB_DANGER_GET(&ptd, parameters[i].pTypeRef);
++            if (!parameters[i].bIn) {
++                cppArgs[i] = alloca(ptd->nSize);
++                uno_constructData(cppArgs[i], ptd);
++                ptds[i] = ptd;
++                pushArgument(
++                    reinterpret_cast<unsigned long>(cppArgs[i]), stack, &sp,
++                    gpr, &ngpr);
++            } else if (bridges::cpp_uno::shared::relatesToInterfaceType(ptd)) {
++                cppArgs[i] = alloca(ptd->nSize);
++                uno_copyAndConvertData(
++                    cppArgs[i], arguments[i], ptd,
++                    proxy->getBridge()->getUno2Cpp());
++                ptds[i] = ptd;
++                pushArgument(
++                    reinterpret_cast<unsigned long>(cppArgs[i]), stack, &sp,
++                    gpr, &ngpr);
++            } else {
++                cppArgs[i] = 0;
++                pushArgument(
++                    reinterpret_cast<unsigned long>(arguments[i]), stack, &sp,
++                    gpr, &ngpr);
++                TYPELIB_DANGER_RELEASE(ptd);
++            }
++        }
++    }
++    try {
++        try {
++            callVirtualFunction(
++                (*thisPtr)[slot.index], gpr, fpr, stack, sp, ret);
++        } catch (css::uno::Exception &) {
++            throw;
++        } catch (std::exception & e) {
++            throw css::uno::RuntimeException(
++                ("C++ code threw "
++                 + OStringToOUString(typeid(e).name(), RTL_TEXTENCODING_UTF8)
++                 + ": " + OStringToOUString(e.what(), RTL_TEXTENCODING_UTF8)),
++                css::uno::Reference<css::uno::XInterface>());
++        } catch (...) {
++            throw css::uno::RuntimeException(
++                "C++ code threw unknown exception",
++                css::uno::Reference<css::uno::XInterface>());
++        }
++    } catch (css::uno::Exception &) {
++        abi_aarch64::mapException(
++            reinterpret_cast<abi_aarch64::__cxa_eh_globals *>(
++                __cxxabiv1::__cxa_get_globals())->caughtExceptions,
++            *exception, proxy->getBridge()->getCpp2Uno());
++        for (sal_Int32 i = 0; i != count; ++i) {
++            if (cppArgs[i] != 0) {
++                uno_destructData(
++                    cppArgs[i], ptds[i],
++                    reinterpret_cast<uno_ReleaseFunc>(css::uno::cpp_release));
++                TYPELIB_DANGER_RELEASE(ptds[i]);
++            }
++        }
++        TYPELIB_DANGER_RELEASE(rtd);
++        return;
++    }
++    *exception = 0;
++    for (sal_Int32 i = 0; i != count; ++i) {
++        if (cppArgs[i] != 0) {
++            if (parameters[i].bOut) {
++                if (parameters[i].bIn) {
++                    uno_destructData(arguments[i], ptds[i], 0);
++                }
++                uno_copyAndConvertData(
++                    arguments[i], cppArgs[i], ptds[i],
++                    proxy->getBridge()->getCpp2Uno());
++            }
++            uno_destructData(
++                cppArgs[i], ptds[i],
++                reinterpret_cast<uno_ReleaseFunc>(css::uno::cpp_release));
++            TYPELIB_DANGER_RELEASE(ptds[i]);
++        }
++    }
++    switch (retKind) {
++    case abi_aarch64::RETURN_KIND_REG:
++        switch (rtd->eTypeClass) {
++        case typelib_TypeClass_VOID:
++            break;
++        case typelib_TypeClass_BOOLEAN:
++        case typelib_TypeClass_BYTE:
++        case typelib_TypeClass_SHORT:
++        case typelib_TypeClass_UNSIGNED_SHORT:
++        case typelib_TypeClass_LONG:
++        case typelib_TypeClass_UNSIGNED_LONG:
++        case typelib_TypeClass_HYPER:
++        case typelib_TypeClass_UNSIGNED_HYPER:
++        case typelib_TypeClass_CHAR:
++        case typelib_TypeClass_ENUM:
++        case typelib_TypeClass_STRUCT:
++            std::memcpy(ret, gpr, rtd->nSize);
++            break;
++        case typelib_TypeClass_FLOAT:
++        case typelib_TypeClass_DOUBLE:
++            std::memcpy(ret, fpr, rtd->nSize);
++            break;
++        default:
++            assert(false);
++        }
++        break;
++    case abi_aarch64::RETURN_KIND_HFA_FLOAT:
++        switch (rtd->nSize) {
++        case 16:
++            std::memcpy(static_cast<char *>(ret) + 12, fpr + 3, 4);
++            // fall through
++        case 12:
++            std::memcpy(static_cast<char *>(ret) + 8, fpr + 2, 4);
++            // fall through
++        case 8:
++            std::memcpy(static_cast<char *>(ret) + 4, fpr + 1, 4);
++            // fall through
++        case 4:
++            std::memcpy(ret, fpr, 4);
++            break;
++        default:
++            assert(false);
++        }
++        break;
++    case abi_aarch64::RETURN_KIND_HFA_DOUBLE:
++        std::memcpy(ret, fpr, rtd->nSize);
++        break;
++    case abi_aarch64::RETURN_KIND_INDIRECT:
++        break;
++    }
++    if (retConv) {
++        uno_copyAndConvertData(
++            returnValue, ret, rtd, proxy->getBridge()->getCpp2Uno());
++        uno_destructData(
++            ret, rtd, reinterpret_cast<uno_ReleaseFunc>(css::uno::cpp_release));
++    }
++    TYPELIB_DANGER_RELEASE(rtd);
++}
++
++}
++
++namespace bridges { namespace cpp_uno { namespace shared {
++
++void unoInterfaceProxyDispatch(
++    uno_Interface * pUnoI, typelib_TypeDescription const * pMemberDescr,
++    void * pReturn, void ** pArgs, uno_Any ** ppException)
++{
++    UnoInterfaceProxy * proxy = static_cast<UnoInterfaceProxy *>(pUnoI);
++    switch (pMemberDescr->eTypeClass) {
++    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
++        {
++            typelib_InterfaceAttributeTypeDescription const * atd
++                = reinterpret_cast<
++                    typelib_InterfaceAttributeTypeDescription const *>(
++                        pMemberDescr);
++            VtableSlot slot(getVtableSlot(atd));
++            if (pReturn != 0) { // getter
++                call(
++                    proxy, slot, atd->pAttributeTypeRef, 0, 0, pReturn, pArgs,
++                    ppException);
++            } else { // setter
++                typelib_MethodParameter param = {
++                    0, atd->pAttributeTypeRef, true, false };
++                typelib_TypeDescriptionReference * rtd = 0;
++                typelib_typedescriptionreference_new(
++                    &rtd, typelib_TypeClass_VOID, OUString("void").pData);
++                slot.index += 1;
++                call(proxy, slot, rtd, 1, &param, pReturn, pArgs, ppException);
++                typelib_typedescriptionreference_release(rtd);
++            }
++            break;
++        }
++    case typelib_TypeClass_INTERFACE_METHOD:
++        {
++            typelib_InterfaceMethodTypeDescription const * mtd
++                = reinterpret_cast<
++                    typelib_InterfaceMethodTypeDescription const *>(
++                        pMemberDescr);
++            VtableSlot slot(getVtableSlot(mtd));
++            switch (slot.index) {
++            case 1:
++                pUnoI->acquire(pUnoI);
++                *ppException = 0;
++                break;
++            case 2:
++                pUnoI->release(pUnoI);
++                *ppException = 0;
++                break;
++            case 0:
++                {
++                    typelib_TypeDescription * td = 0;
++                    TYPELIB_DANGER_GET(
++                        &td,
++                        (reinterpret_cast<css::uno::Type *>(pArgs[0])
++                         ->getTypeLibType()));
++                    if (td != 0) {
++                        uno_Interface * ifc = 0;
++                        proxy->pBridge->getUnoEnv()->getRegisteredInterface(
++                            proxy->pBridge->getUnoEnv(),
++                            reinterpret_cast<void **>(&ifc), proxy->oid.pData,
++                            reinterpret_cast<
++                                typelib_InterfaceTypeDescription *>(td));
++                        if (ifc != 0) {
++                            uno_any_construct(
++                                reinterpret_cast<uno_Any *>(pReturn), &ifc, td,
++                                0);
++                            ifc->release(ifc);
++                            TYPELIB_DANGER_RELEASE(td);
++                            *ppException = 0;
++                            break;
++                        }
++                        TYPELIB_DANGER_RELEASE(td);
++                    }
++                }
++                // fall through
++            default:
++                call(
++                    proxy, slot, mtd->pReturnTypeRef, mtd->nParams,
++                    mtd->pParams, pReturn, pArgs, ppException);
++                break;
++            }
++            break;
++        }
++    default:
++        assert(false);
++    }
++}
++
++} } }
++
++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/configure.ac b/configure.ac
+index 5ead2a0..826797f8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4292,6 +4292,12 @@ linux-gnu*)
+ 
+     case "$host_cpu" in
+ 
++    aarch64)
++        CPUNAME=AARCH64
++        PLATFORMID=linux_aarch64
++        RTL_ARCH=AARCH64
++        OUTPATH=unxlngaarch64
++        ;;
+     alpha)
+         CPUNAME=AXP
+         RTL_ARCH=ALPHA
+diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
+index 09b3fcd..6b04004 100644
+--- a/desktop/source/deployment/misc/dp_platform.cxx
++++ b/desktop/source/deployment/misc/dp_platform.cxx
+@@ -45,7 +45,7 @@
+ #define PLATFORM_LINUX_S390x        "linux_s390x"
+ #define PLATFORM_LINUX_HPPA         "linux_hppa"
+ #define PLATFORM_LINUX_ALPHA        "linux_alpha"
+-
++#define PLATFORM_LINUX_AARCH64      "linux_aarch64"
+ 
+ 
+ #define PLATFORM_SOLARIS_SPARC      "solaris_sparc"
+@@ -149,6 +149,8 @@ namespace
+             ret = checkOSandCPU("Linux", "HPPA");
+         else if (token == PLATFORM_LINUX_ALPHA)
+             ret = checkOSandCPU("Linux", "ALPHA");
++        else if (token == PLATFORM_LINUX_AARCH64)
++            ret = checkOSandCPU("Linux", "AARCH64");
+         else if (token == PLATFORM_SOLARIS_SPARC)
+             ret = checkOSandCPU("Solaris", "SPARC");
+         else if (token == PLATFORM_SOLARIS_SPARC64)
+diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+index 25baaee5..29f2641 100644
+--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
++++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+@@ -65,6 +65,8 @@ OpenJDK at least, but probably not true for Lemotes JDK */
+ #define JFW_PLUGIN_ARCH "parisc"
+ #elif defined AXP
+ #define JFW_PLUGIN_ARCH "alpha"
++#elif defined AARCH64
++#define JFW_PLUGIN_ARCH "aarch64"
+ #else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA
+ #error unknown platform
+ #endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA
+diff --git a/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk
+new file mode 100644
+index 0000000..682199e
+--- /dev/null
++++ b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk
+@@ -0,0 +1,14 @@
++# -*- 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/.
++#
++
++gb_COMPILERDEFAULTOPTFLAGS := -Os
++
++include $(GBUILDDIR)/platform/linux.mk
++
++# vim: set noet sw=4:
+-- 
+1.9.3
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 37ec7b6..d7f9b2b 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -46,7 +46,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        %{libo_version}.2
-Release:        1%{?libo_prerelease}%{?dist}
+Release:        2%{?libo_prerelease}%{?dist}
 License:        (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
 Group:          Applications/Productivity
 URL:            http://www.libreoffice.org/
@@ -311,6 +311,8 @@ Patch23: 0001-if-_CALL_ELF-if-defined-_CALL_ELF-_CALL_ELF-2.patch
 Patch24: 0001-fix-variable-name.patch
 Patch25: 0001-cast-arg-to-the-right-type.patch
 Patch26: 0001-sigh-simply-forgot-to-include-the-endian-header.patch
+Patch27: 0001-Update-config.-guess-sub.patch
+Patch28: 0002-Linux-AArch64-port.patch
 
 %define instdir %{_libdir}
 %define baseinstdir %{instdir}/libreoffice
@@ -2290,6 +2292,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
+* Fri Aug 29 2014 Stephan Bergmann <sbergman at redhat.com> - 1:4.3.1.2-2
+- Resolves: rhbz#1098693 AArch64 port
+
 * Wed Aug 27 2014 David Tardon <dtardon at redhat.com> - 1:4.3.1.2-1
 - update to 4.3.1 rc2
 


More information about the scm-commits mailing list