Kaydet (Commit) 235fa033 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Linux AArch64 port

Change-Id: I37044a37348b203944a8eb9d2204e619055f069d
üst 6bc81d4e
......@@ -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
......
This diff is collapsed.
/* -*- 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: */
/* -*- 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: */
/* -*- 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: */
......@@ -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
......@@ -6903,7 +6909,7 @@ if test "$ENABLE_JAVA" != ""; then
# at least 2 reasons to check: officebean needs to link -ljawt,
# and libjpipe.so needs to be loaded by java to run JunitTests.
case $CPUNAME in
AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64)
AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64)
if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
......
......@@ -46,7 +46,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"
......@@ -152,6 +152,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)
......
......@@ -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
......
# -*- 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:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment