dbh201
2022-03-08 337a41061ffe9b0a5ea5d7654d1e193d12a084d6
libreoffice: update to 7.2.5.2 64-bit

2 files deleted
20 files added
7 files modified
39905 ■■■■ changed files
components/desktop/libreoffice/Makefile 113 ●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/call.hxx 33 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/call.s 104 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/callvirtualmethod.cxx 155 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/callvirtualmethod.hxx 50 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/cpp2uno.cxx 509 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/except.cxx 291 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/share.hxx 86 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/files/gcc3_solaris_x86-64/uno2cpp.cxx 348 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/libreoffice.p5m 19003 ●●●● patch | view | raw | blame | history
components/desktop/libreoffice/manifests/sample-manifest.p5m 18910 ●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/03-alloca.patch 26 ●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/05-avoid-conflict-with-math-version.patch 4 ●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/07-os-solaris.patch 11 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/12-change-download.patch 2 ●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/13-fix-TRUE.patch 22 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/16-std_string_poppler.patch 43 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/51-fix-nUTC.patch 11 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/52-strhelper-cxx.patch 11 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/53-more-alloca.patch 13 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/54-SEC-fix.patch 11 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/55-gdb-prettyprinter.patch 15 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/56-add-platform-mk.patch 17 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/57-configure.ca-enable-64bit-solaris.patch 27 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/58-backtrace-c.patch 11 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/59-bridge-library.patch 14 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/60-unpack-to-rootdir.patch 27 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/patches/61-fix-coinmp-makefile.patch 36 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/pkg5 2 ●●●●● patch | view | raw | blame | history
components/desktop/libreoffice/Makefile
@@ -10,14 +10,15 @@
#
# Copyright 2020 Alexander Pyhalov
# Copyright 2022 Daniel Bell
#
BUILD_BITS=32
include ../../../make-rules/shared-macros.mk
BITS=64
COMPONENT_NAME=    libreoffice
COMPONENT_VERSION= 6.4.7
COMPONENT_VERSION= 7.2.5
COMPONENT_RC_VERSION= 2
COMPONENT_FULL_VERSION=$(COMPONENT_VERSION).$(COMPONENT_RC_VERSION)
COMPONENT_SUMMARY= LibreOffice is a powerful office suite
@@ -28,7 +29,7 @@
COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.xz
COMPONENT_ARCHIVE_URL= https://download.documentfoundation.org/libreoffice/src/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
COMPONENT_SIG_URL= $(COMPONENT_ARCHIVE_URL).asc
COMPONENT_ARCHIVE_HASH= sha256:034dd79a60cfff60c7d353130fe2cc8e6a1aabeab50d89e4570ae95f33296644
COMPONENT_ARCHIVE_HASH= sha256:67c1bfb059d433286b0252a915627b33af63bb5f4b6ec9509d13b9dd475512a7
COMPONENT_LICENSE= MPL2.0
COMPONENT_LICENSE_FILE= COPYING.MPL
@@ -52,9 +53,9 @@
COMPONENT_ARCHIVE_HASH_5 = sha256:304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705
COMPONENT_ARCHIVE_URL_5 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_5)
COMPONENT_ARCHIVE_6 = 884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc-opens___.ttf
COMPONENT_ARCHIVE_HASH_6 = sha256:884ed41809687c3e168fc7c19b16585149ff058eca79acbf3ee784f6630704cc
COMPONENT_ARCHIVE_URL_6 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_6)
COMPONENT_ARCHIVE_6 = f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140-opens___.ttf
COMPONENT_ARCHIVE_HASH_6 = sha256:f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140
COMPONENT_ARCHIVE_URL_6 = https://dev-www.libreoffice.org/extern/$(COMPONENT_ARCHIVE_6)
#COMPONENT_ARCHIVE_7 = a233181e03d3c307668b4c722d881661-mariadb_client-2.0.0-src.tar.gz
#COMPONENT_ARCHIVE_HASH_7 = sha256:fd2f751dea049c1907735eb236aeace1d811d6a8218118b00bbaa9b84dc5cd60
@@ -88,48 +89,89 @@
COMPONENT_ARCHIVE_HASH_14 = sha256:13fdbc9d4c489a4d0519e51933a1aa21fe3fb9eb7da191b87f7a63e82797dac8
COMPONENT_ARCHIVE_URL_14 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_14)
COMPONENT_ARCHIVE_15 = libnumbertext-1.0.5.tar.xz
COMPONENT_ARCHIVE_HASH_15 = sha256:e1c9086b4cecb6b25f180316f30740dfabe6a4dbaf70dddc34276fc839e4f4f7
COMPONENT_ARCHIVE_15 = libnumbertext-1.0.7.tar.xz
COMPONENT_ARCHIVE_HASH_15 = sha256:17b8249cb89ae11ae15a85612d2665626c0e0e3e56b35654363ba6566d8b61fc
COMPONENT_ARCHIVE_URL_15 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_15)
COMPONENT_ARCHIVE_16 = liborcus-0.15.3.tar.gz
COMPONENT_ARCHIVE_HASH_16 = sha256:0dd26f3f2e611c51df9ee02d6dbf08887989eaa417b73f6877cd0d94df795fc2
COMPONENT_ARCHIVE_16 = liborcus-0.16.1.tar.bz2
COMPONENT_ARCHIVE_HASH_16 = sha256:c700d1325f744104d9fca0d5a019434901e9d51a16eedfb05792f90a298587a4
COMPONENT_ARCHIVE_URL_16 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_16)
COMPONENT_ARCHIVE_17 = QR-Code-generator-1.4.0.tar.gz
COMPONENT_ARCHIVE_HASH_17 = sha256:fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
COMPONENT_ARCHIVE_URL_17 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_17)
COMPONENT_ARCHIVE_18 = xmlsec1-1.2.28.tar.gz
COMPONENT_ARCHIVE_HASH_18 = sha256:13eec4811ea30e3f0e16a734d1dbf7f9d246a71d540b48d143a07b489f6222d4
COMPONENT_ARCHIVE_18 = xmlsec1-1.2.32.tar.gz
COMPONENT_ARCHIVE_HASH_18 = sha256:e383702853236004e5b08e424b8afe9b53fe9f31aaa7a5382f39d9533eb7c043
COMPONENT_ARCHIVE_URL_18 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_18)
COMPONENT_ARCHIVE_19 = libreoffice-translations-$(COMPONENT_FULL_VERSION).tar.xz
COMPONENT_ARCHIVE_HASH_19 = sha256:b13088a98be1f6e7e177331db3d723419bfeb11ae16516334f0fbb853ae40ab1
COMPONENT_ARCHIVE_HASH_19 = sha256:f6b9ee4627ec117ed101476c5fa555c3fc504ba759792dd16ca9e80b7f6e31df
COMPONENT_ARCHIVE_URL_19 = https://download.documentfoundation.org/libreoffice/src/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_19)
COMPONENT_ARCHIVE_20 = libreoffice-dictionaries-$(COMPONENT_FULL_VERSION).tar.xz
COMPONENT_ARCHIVE_HASH_20 = sha256:3718c44d5ec5fc1d011ddf5b9bbbef384f1bdc695338e8459d6e403da2539bb7
COMPONENT_ARCHIVE_HASH_20 = sha256:5915694f8a844afe96d46d306dafdd30f548bffd96ae8cfbc0a35189d7988f66
COMPONENT_ARCHIVE_URL_20 = https://download.documentfoundation.org/libreoffice/src/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_20)
COMPONENT_ARCHIVE_21 = boost_1_69_0.tar.bz2
COMPONENT_ARCHIVE_HASH_21 = sha256:8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
COMPONENT_ARCHIVE_URL_21 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_21)
#COMPONENT_ARCHIVE_21 = boost_1_69_0.tar.bz2
#COMPONENT_ARCHIVE_HASH_21 = sha256:8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
#COMPONENT_ARCHIVE_URL_21 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_21)
COMPONENT_ARCHIVE_22 = neon-0.31.2.tar.gz
COMPONENT_ARCHIVE_HASH_22 = sha256:cf1ee3ac27a215814a9c80803fcee4f0ede8466ebead40267a9bd115e16a8678
COMPONENT_ARCHIVE_URL_22 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_22)
COMPONENT_ARCHIVE_23 = zxing-cpp-1.1.1.tar.gz
COMPONENT_ARCHIVE_HASH_23 = sha256:e595b3fa2ec320beb0b28f6af56b1141853257c2611686685639cebb3b248c86
COMPONENT_ARCHIVE_URL_23 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_23)
COMPONENT_ARCHIVE_24 = box2d-2.3.1.tar.gz
COMPONENT_ARCHIVE_HASH_24 = sha256:58ffc8475a8650aadc351345aef696937747b40501ab78d72c197c5ff5b3035c
COMPONENT_ARCHIVE_URL_24 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_24)
COMPONENT_ARCHIVE_25 = dtoa-20180411.tgz
COMPONENT_ARCHIVE_HASH_25 = sha256:0082d0684f7db6f62361b76c4b7faba19e0c7ce5cb8e36c4b65fea8281e711b4
COMPONENT_ARCHIVE_URL_25 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_25)
COMPONENT_ARCHIVE_26 = glm-0.9.9.7.zip
COMPONENT_ARCHIVE_HASH_26 = sha256:c5e167c042afd2d7ad642ace6b643863baeb33880781983563e1ab68a30d3e95
COMPONENT_ARCHIVE_URL_26 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_26)
COMPONENT_ARCHIVE_27 = skia-m90-45c57e116ee0ce214bdf78405a4762722e4507d9.tar.xz
COMPONENT_ARCHIVE_HASH_27 = sha256:abe0b94d54edb717c58d74263f4ed3d27824d2ce9e9f2ce85a21ab38d993f94d
COMPONENT_ARCHIVE_URL_27 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_27)
COMPONENT_ARCHIVE_28 = libcmis-0.5.2.tar.xz
COMPONENT_ARCHIVE_HASH_28 = sha256:d7b18d9602190e10d437f8a964a32e983afd57e2db316a07d87477a79f5000a2
COMPONENT_ARCHIVE_URL_28 = https://dev-www.libreoffice.org/src/$(COMPONENT_ARCHIVE_28)
# ignore archive 7 (mariadb client)
NUM_EXTRA_ARCHIVES = $(shell seq 1 6) $(shell 8 21)
# ignore archive 21 (boost)
NUM_EXTRA_ARCHIVES = $(shell seq 1 6) $(shell 8 20) $(shell 22 28)
include $(WS_MAKE_RULES)/common.mk
GCC_VERSION=7
PATH=$(GCC_ROOT)/bin:$(PATH.gnu)
#Ensure asm is built in 64-bit.
AFLAGS= -m64
#CFLAGS / CXXFLAGS not passed to all external libraries! Add -m64 to ensure 64-bit is built.
CC+= -m64
CXX+= -m64
COMPONENT_BUILD_ENV=   CONFIG_SHELL="$(CONFIG_SHELL)"
COMPONENT_BUILD_ENV+=  SHELL="$(CONFIG_SHELL)"
COMPONENT_BUILD_ENV+=  CC="$(CC)"
COMPONENT_BUILD_ENV+=  CXX="$(CXX)"
COMPONENT_BUILD_ENV+=  AFLAGS="$(AFLAGS)"
CONFIGURE_ENV = $(COMPONENT_BUILD_ENV)
CONFIGURE_ENV += PYTHON=/usr/bin/python3.5
CONFIGURE_LIBDIR= $(CONFIGURE_LIBDIR.64)
COMPONENT_PREP_ACTION= ( mkdir -p $(@D)/external/tarballs && \
    for i in $(ARCHIVES) ; do \
@@ -138,12 +180,15 @@
    done && \
    cd $(@D) && autoconf )
COMPONENT_PRE_BUILD_ACTION= ( rm -rf $(SOURCE_DIR)/bridges/source/cpp_uno/gcc3_solaris_x86-64; cp -R $(COMPONENT_DIR)/files/gcc3_solaris_x86-64 $(SOURCE_DIR)/bridges/source/cpp_uno/ )
# LDFLAGS seem to be not always passed to lower levels
CFLAGS += $(JPEG_CPPFLAGS) $(JPEG_LDFLAGS)
CFLAGS += -fstack-protector -lssp_nonshared
LDFLAGS += $(JPEG_LDFLAGS) -lX11-xcb -lX11
CFLAGS += $(JPEG_CPPFLAGS) $(JPEG_CFLAGS) -fstack-protector -lssp_nonshared
CXXFLAGS = $(CFLAGS)
# 64-bit
CONFIGURE_OPTIONS += --build=amd64-pc-solaris2.11
CONFIGURE_OPTIONS += --with-myspell-dicts
CONFIGURE_OPTIONS += --with-help=common
@@ -156,17 +201,21 @@
CONFIGURE_OPTIONS += --with-system-icu
CONFIGURE_OPTIONS += --with-system-poppler
CONFIGURE_OPTIONS += --with-system-curl
# Our boost is too old
#CONFIGURE_OPTIONS += --with-system-boost
CONFIGURE_OPTIONS += --with-system-boost
CONFIGURE_OPTIONS += --with-system-nss
CONFIGURE_OPTIONS += --with-system-apr
CONFIGURE_OPTIONS += --with-system-neon
# library/libneon < 0.31.2
# CONFIGURE_OPTIONS += --with-system-neon
CONFIGURE_OPTIONS += --with-system-openssl
CONFIGURE_OPTIONS += --with-system-libpng
CONFIGURE_OPTIONS += --with-system-jpeg
CONFIGURE_OPTIONS += --with-system-harfbuzz
CONFIGURE_OPTIONS += --with-system-graphite
CONFIGURE_OPTIONS += --with-system-cppunit
#CONFIGURE_OPTIONS += --enable-debug
CONFIGURE_OPTIONS += --with-system-lcms2
CONFIGURE_OPTIONS += --with-system-dicts
CONFIGURE_OPTIONS += --with-system-epoxy
@@ -174,7 +223,8 @@
CONFIGURE_OPTIONS += --with-system-mdds
CONFIGURE_OPTIONS += --with-system-libabw
CONFIGURE_OPTIONS += --with-system-libcdr
CONFIGURE_OPTIONS += --with-system-libcmis
# libreoffice uses functionality not packaged in latest libcmis (0.5.2)
#CONFIGURE_OPTIONS += --with-system-libcmis
CONFIGURE_OPTIONS += --with-system-libetonyek
CONFIGURE_OPTIONS += --with-system-libebook
CONFIGURE_OPTIONS += --with-system-libepubgen
@@ -192,6 +242,7 @@
CONFIGURE_OPTIONS += --with-system-libwpg
CONFIGURE_OPTIONS += --with-system-libwps
CONFIGURE_OPTIONS += --with-system-libzmf
# Use packaged mariadb client with solaris patches
CONFIGURE_OPTIONS += --with-system-mariadb
CONFIGURE_OPTIONS += --enable-gio
@@ -214,10 +265,10 @@
COMPONENT_INSTALL_TARGETS = distro-pack-install
LIBREOFFICE_PROGRAM_DIR = /usr/lib/libreoffice/program
LIBREOFFICE_PROGRAM_DIR = /usr/lib/amd64/libreoffice/program
NSS_LIB_DIR=/usr/lib/mps
MARIADB_LIBDIR=/usr/mariadb/10.1/lib
NSS_LIB_DIR=/usr/lib/mps/amd64
MARIADB_LIBDIR=/usr/mariadb/10.1/lib/amd64
COMPONENT_POST_INSTALL_ACTION  = \
    for file in $(PROTO_DIR)$(LIBREOFFICE_PROGRAM_DIR)/*.so*; do \
@@ -232,6 +283,7 @@
REQUIRED_PACKAGES += developer/icu
REQUIRED_PACKAGES += file/gnu-coreutils
REQUIRED_PACKAGES += library/c++/mdds
REQUIRED_PACKAGES += database/mariadb-101/client
# Auto-generated dependencies
REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
@@ -290,6 +342,7 @@
REQUIRED_PACKAGES += system/library/libdbus
REQUIRED_PACKAGES += system/library/math
REQUIRED_PACKAGES += system/library/mozilla-nss
REQUIRED_PACKAGES += system/library/boost
REQUIRED_PACKAGES += text/hunspell
REQUIRED_PACKAGES += web/curl
REQUIRED_PACKAGES += x11/library/libepoxy
components/desktop/libreoffice/files/gcc3_solaris_x86-64/call.hxx
New file
@@ -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 SOLARIS_64_CALL_HXX
#define SOLARIS_64_CALL_HXX
#include <sal/config.h>
#include <sal/types.h>
extern "C" void __attribute__((noinline)) cpp_vtable_call(
    sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
    void** pCallStack );
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/call.s
New file
@@ -0,0 +1,104 @@
/*
 * 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 .
 */
    .extern cpp_vtable_call         # probably unnecessary
    .text
    .align 2
.globl asm_vtable_call_wrapper
    .type    asm_vtable_call_wrapper, @function
asm_vtable_call_wrapper:
.LFB3:
    pushq    %rbp
.LCFI0:
    movq    %rsp, %rbp
.LCFI1:
    subq    $0x80, %rsp
.LCFI2:
    movq    %r10, -0x08(%rbp)        # Save (nVtableOffset << 32) + nFunctionIndex
    # General purpose registers
    movq    %rdi, -0x80(%rbp)        # rdi = arg1 = this
    movq    %rsi, -0x78(%rbp)        # rsi = arg2
    movq    %rdx, -0x70(%rbp)        # ...
    movq    %rcx, -0x68(%rbp)
    movq    %r8 , -0x60(%rbp)
    movq    %r9 , -0x58(%rbp)
    # FP/SSE registers
    movsd    %xmm0, -0x50(%rbp)
    movsd    %xmm1, -0x48(%rbp)
    movsd    %xmm2, -0x40(%rbp)
    movsd    %xmm3, -0x38(%rbp)
    movsd    %xmm4, -0x30(%rbp)
    movsd    %xmm5, -0x28(%rbp)
    movsd    %xmm6, -0x20(%rbp)
    movsd    %xmm7, -0x18(%rbp)
    # pCallStack = [ret ptr], this, params
    leaq    -0x88(%rbp), %rdx        # 3rd param: void ** pCallStack
    movl    -0x04(%rbp), %esi        # 2nd param: sal_int32 nVtableOffset
    movl    -0x08(%rbp), %edi        # 1st param: sal_int32 nFunctionIndex
    call    cpp_vtable_call
    leave
    ret
.LFE3:
    .size    asm_vtable_call_wrapper, .-asm_vtable_call_wrapper
    # see http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
    # for details of the .eh_frame, the "Common Information Entry" and "Frame Description Entry" formats
    # and http://mentorembedded.github.io/cxx-abi/exceptions.pdf for more info
    .section    .eh_frame,"a",@progbits
.Lframe1:
    .long    .LECIE1-.LSCIE1
.LSCIE1:
    .long    0x0
    .byte    0x1
    .string    "zR"
    .uleb128 0x1
    .sleb128 -8
    .byte    0x10
    .uleb128 0x1
    .byte    0x1b
    .byte    0xc
    .uleb128 0x7
    .uleb128 0x8
    .byte    0x90
    .uleb128 0x1
    .align 8
.LECIE1:
.LSFDE1:
    .long    .LEFDE1-.LASFDE1
.LASFDE1:
    .long    .LASFDE1-.Lframe1
    .long    .LFB3-.
    .long    .LFE3-.LFB3
    .uleb128 0x0
    .byte    0x4
    .long    .LCFI0-.LFB3
    .byte    0xe
    .uleb128 0x10
    .byte    0x86
    .uleb128 0x2
    .byte    0x4
    .long    .LCFI1-.LCFI0
    .byte    0xd
    .uleb128 0x6
    .align 8
.LEFDE1:
    .section    .note.GNU-stack,"",@progbits
components/desktop/libreoffice/files/gcc3_solaris_x86-64/callvirtualmethod.cxx
New file
@@ -0,0 +1,155 @@
/* -*- 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 <com/sun/star/uno/genfunc.hxx>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <uno/data.h>
#include "bridge.hxx"
#include "types.hxx"
#include "unointerfaceproxy.hxx"
#include "vtables.hxx"
#include "share.hxx"
#include "callvirtualmethod.hxx"
#include <stdio.h>
void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
    void * pAdjustedThisPtr,
    sal_Int32 nVtableIndex,
    void * pRegisterReturn,
    typelib_TypeClass eReturnType,
    sal_Int64 * pStackLongs,
    sal_Int32 nStackLongs )
{
    // parameter list is mixed list of * and values
    // reference parameters are pointers
    assert(pStackLongs && pAdjustedThisPtr);
    static_assert((sizeof(void *) == 8) && (sizeof(sal_Int32) == 4), "### unexpected size of int!");
    assert(nStackLongs && pStackLongs && "### no stack in callVirtualMethod !");
    // never called
    if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something
    static_assert((sizeof(long) == 8),"### unexpected size of long!");
    long edx, eax; // for register returns
    void * stackptr;
    //pStackLongs = return ptr, this, params
    asm volatile (
    // new pseudo stack frame
    // we don't want a real frame, as it will be created during the actual call
    "mov   %%rsp, %2\n\t"
    // number of longs in external stack
        "mov   %3, %%edx\n\t"
    // skip copy if stack is empty (not sure if this happens)
    "test %%rdx, %%rdx\n\t"
    "jz    Lvcall\n\t"
    // location of external stack bottom
        "mov   %4, %%rsi\n"
        // copy values from external stack bottom to stack frame top (reverse order)
        "Lcopy:\n\t"
        "pushq -8(%%rsi,%%rdx,8)\n\t"
        "dec   %%rdx\n\t"
        "jnz   Lcopy\n\t"
        // do the actual call
    "Lvcall:\n\t"
    // align stack
    "and $0xFFFFFFFFFFFFFFF0, %%rsp\n\t"
    // Load Registers
    "mov %4, %%rbx\n\t"
    // General purpose registers
    "movq    0x00(%%rbx), %%rdi\n\t"
    "movq    0x08(%%rbx), %%rsi\n\t"
    "movq    0x10(%%rbx), %%rdx\n\t"
    "movq    0x18(%%rbx), %%rcx\n\t"
    "movq    0x20(%%rbx), %%r8\n\t"
    "movq    0x28(%%rbx), %%r9\n\t"
    // FP/SSE registers
    "movsd    0x30(%%rbx), %%xmm0\n\t"
    "movsd    0x38(%%rbx), %%xmm1\n\t"
    "movsd    0x40(%%rbx), %%xmm2\n\t"
    "movsd    0x48(%%rbx), %%xmm3\n\t"
    "movsd    0x50(%%rbx), %%xmm4\n\t"
    "movsd    0x58(%%rbx), %%xmm5\n\t"
    "movsd    0x60(%%rbx), %%xmm6\n\t"
    "movsd    0x68(%%rbx), %%xmm7\n\t"
        "mov   %5, %%rbx\n\t"
        "mov   0(%%rbx), %%rbx\n\t"
        "mov   %6, %%eax\n\t"
        "shl   $3, %%rax\n\t"
        "add   %%rax, %%rbx\n\t"
        "mov   0(%%rbx), %%rbx\n\t"
        "call  *%%rbx\n\t"
        // save return registers
        "mov   %%rax, %0\n\t"
        "mov   %%rdx, %1\n\t"
    // delete stack frame
    "mov %2, %%rsp\n\t"
        : "=m"(eax), "=m"(edx), "=m"(stackptr)
        : "m"(nStackLongs), "m"(pStackLongs), "m"(pAdjustedThisPtr), "m"(nVtableIndex)
    : "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11", "r12",
          "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
          "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
          "memory" );
    switch( eReturnType )
    {
        case typelib_TypeClass_HYPER:
        case typelib_TypeClass_UNSIGNED_HYPER:
            ((long*)pRegisterReturn)[1] = edx;
        case typelib_TypeClass_LONG:
        case typelib_TypeClass_UNSIGNED_LONG:
        case typelib_TypeClass_CHAR:
        case typelib_TypeClass_ENUM:
            ((long*)pRegisterReturn)[0] = eax;
            break;
        case typelib_TypeClass_SHORT:
        case typelib_TypeClass_UNSIGNED_SHORT:
            *(unsigned short*)pRegisterReturn = eax;
            break;
        case typelib_TypeClass_BOOLEAN:
        case typelib_TypeClass_BYTE:
            *(unsigned char*)pRegisterReturn = eax;
            break;
        case typelib_TypeClass_FLOAT:
            asm ( "fstps %0" : : "m"(*(char *)pRegisterReturn) );
            break;
        case typelib_TypeClass_DOUBLE:
            asm ( "fstpl %0\n\t" : : "m"(*(char *)pRegisterReturn) );
            break;
    // for clarity's sake, and to quell gcc's whining
    default:
        break;
    }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/callvirtualmethod.hxx
New file
@@ -0,0 +1,50 @@
/* -*- 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_SOLARIS_INTEL_CALLVIRTUALMETHOD_HXX
#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_SOLARIS_INTEL_CALLVIRTUALMETHOD_HXX
#include <malloc.h>
#include "sal/alloca.h"
#include "sal/config.h"
#include <cstring>
#include "sal/types.h"
#include "typelib/typeclass.h"
#include "typelib/typedescription.h"
namespace CPPU_CURRENT_NAMESPACE {
void callVirtualMethod(
    void * pAdjustedThisPtr,
    sal_Int32 nVtableIndex,
    void * pRegisterReturn,
    typelib_TypeClass eReturnType,
    sal_Int64 * pStackLongs,
    sal_Int32 nStackLongs );
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/cpp2uno.cxx
New file
@@ -0,0 +1,509 @@
/* -*- 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/alloca.h>
#include <strings.h>
#include <com/sun/star/uno/genfunc.hxx>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <sal/log.hxx>
#include <uno/data.h>
#include <typelib/typedescription.hxx>
#include "bridge.hxx"
#include "cppinterfaceproxy.hxx"
#include "types.hxx"
#include "vtablefactory.hxx"
#include "share.hxx"
#include "call.hxx"
using namespace ::com::sun::star::uno;
static typelib_TypeClass cpp2uno_call(
    bridges::cpp_uno::shared::CppInterfaceProxy * pThis,
    const typelib_TypeDescription * pMemberTypeDescr,
    typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return
    sal_Int32 nParams, typelib_MethodParameter * pParams,
    void ** pCallStack,
    sal_Int64 * pRegisterReturn /* space for register return */ )
{
    // pCallStack: ret, [return ptr], this, params
    char * pCppStack = (char *)(pCallStack +1);
    // return
    typelib_TypeDescription * pReturnTypeDescr = 0;
    if (pReturnTypeRef)
        TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
    void * pUnoReturn = 0;
    void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need
    if (pReturnTypeDescr)
    {
        if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
        {
            pUnoReturn = pRegisterReturn; // direct way for simple types
        }
        else // complex return via ptr (pCppReturn)
        {
            pCppReturn = *(void **)pCppStack;
            pCppStack += sizeof(void *);
            pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
                              pReturnTypeDescr )
                          ? alloca( pReturnTypeDescr->nSize )
                          : pCppReturn); // direct way
        }
    }
    // pop this
    pCppStack += sizeof( void* );
    // stack space
    static_assert(sizeof(void *) == sizeof(sal_Int64), "### unexpected size!");
    // parameters
    void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
    void ** pCppArgs = pUnoArgs + nParams;
    // indices of values this have to be converted (interface conversion cpp<=>uno)
    sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams));
    // type descriptions for reconversions
    typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
    sal_Int32 nTempIndices   = 0;
    for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
    {
        const typelib_MethodParameter & rParam = pParams[nPos];
        typelib_TypeDescription * pParamTypeDescr = 0;
        TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
        if (!rParam.bOut
            && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
            // value
        {
            pCppArgs[nPos] = pCppStack;
            pUnoArgs[nPos] = pCppStack;
            // no longer needed
            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
        }
        else // ptr to complex value | ref
        {
            pCppArgs[nPos] = *(void **)pCppStack;
            if (! rParam.bIn) // is pure out
            {
                // uno out is unconstructed mem!
                pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
                pTempIndices[nTempIndices] = nPos;
                // will be released at reconversion
                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
            }
            // is in/inout
            else if (bridges::cpp_uno::shared::relatesToInterfaceType(
                         pParamTypeDescr ))
            {
                uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
                                        *(void **)pCppStack, pParamTypeDescr,
                                        pThis->getBridge()->getCpp2Uno() );
                pTempIndices[nTempIndices] = nPos; // has to be reconverted
                // will be released at reconversion
                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
            }
            else // direct way
            {
                pUnoArgs[nPos] = *(void **)pCppStack;
                // no longer needed
                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
            }
        }
        pCppStack += sizeof(sal_Int64); // standard parameter length
    }
    // ExceptionHolder
    uno_Any aUnoExc; // Any will be constructed by callee
    uno_Any * pUnoExc = &aUnoExc;
    // invoke uno dispatch call
    (*pThis->getUnoI()->pDispatcher)(
        pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
    // in case an exception occurred...
    if (pUnoExc)
    {
        // destruct temporary in/inout params
        for ( ; nTempIndices--; )
        {
            sal_Int32 nIndex = pTempIndices[nTempIndices];
            if (pParams[nIndex].bIn) // is in/inout => was constructed
                uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], 0 );
            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
        }
        if (pReturnTypeDescr)
            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
        CPPU_CURRENT_NAMESPACE::raiseException(
            &aUnoExc, pThis->getBridge()->getUno2Cpp() );
            // has to destruct the any
        // is here for dummy
        return typelib_TypeClass_VOID;
    }
    else // else no exception occurred...
    {
        // temporary params
        for ( ; nTempIndices--; )
        {
            sal_Int32 nIndex = pTempIndices[nTempIndices];
            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
            if (pParams[nIndex].bOut) // inout/out
            {
                // convert and assign
                uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
                uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr,
                                        pThis->getBridge()->getUno2Cpp() );
            }
            // destroy temp uno param
            uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
        }
        // return
        if (pCppReturn) // has complex return
        {
            if (pUnoReturn != pCppReturn) // needs reconversion
            {
                uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr,
                                        pThis->getBridge()->getUno2Cpp() );
                // destroy temp uno return
                uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
            }
            // complex return ptr is set to eax
            *(void **)pRegisterReturn = pCppReturn;
        }
        if (pReturnTypeDescr)
        {
            typelib_TypeClass eRet = (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
            return eRet;
        }
        else
            return typelib_TypeClass_VOID;
    }
}
static typelib_TypeClass cpp_mediate(
    sal_Int32 nFunctionIndex,
    sal_Int32 nVtableOffset,
    void ** pCallStack,
    sal_Int64 * pRegisterReturn /* space for register return */ )
{
    static_assert(sizeof(sal_Int64)==sizeof(void *), "### unexpected!");
    // pCallStack: ret adr, [ret *], this, params
    void * pThis;
    if( nFunctionIndex & 0x80000000 )
    {
        nFunctionIndex &= 0x7fffffff;
        pThis = pCallStack[2];
    }
    else
    {
        pThis = pCallStack[1];
    }
    pThis = static_cast< char * >(pThis) - nVtableOffset;
    bridges::cpp_uno::shared::CppInterfaceProxy * pCppI
        = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
            pThis);
    typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
    if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
    {
        SAL_WARN(
            "bridges",
            "illegal " << OUString::unacquired(&pTypeDescr->aBase.pTypeName)
                << " vtable index " << nFunctionIndex << "/"
                << pTypeDescr->nMapFunctionIndexToMemberIndex);
        throw RuntimeException(
            ("illegal " + OUString::unacquired(&pTypeDescr->aBase.pTypeName)
             + " vtable index " + OUString::number(nFunctionIndex) + "/"
             + OUString::number(pTypeDescr->nMapFunctionIndexToMemberIndex)),
            (XInterface *)pThis);
    }
    // determine called method
    sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
    assert(nMemberPos < pTypeDescr->nAllMembers);
    TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
    typelib_TypeClass eRet;
    switch (aMemberDescr.get()->eTypeClass)
    {
    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
    {
        if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex)
        {
            // is GET method
            eRet = cpp2uno_call(
                pCppI, aMemberDescr.get(),
                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
                0, 0, // no params
                pCallStack, pRegisterReturn );
        }
        else
        {
            // is SET method
            typelib_MethodParameter aParam;
            aParam.pTypeRef =
                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
            aParam.bIn      = sal_True;
            aParam.bOut     = sal_False;
            eRet = cpp2uno_call(
                pCppI, aMemberDescr.get(),
                0, // indicates void return
                1, &aParam,
                pCallStack, pRegisterReturn );
        }
        break;
    }
    case typelib_TypeClass_INTERFACE_METHOD:
    {
        // is METHOD
        switch (nFunctionIndex)
        {
        case 1: // acquire()
            pCppI->acquireProxy(); // non virtual call!
            eRet = typelib_TypeClass_VOID;
            break;
        case 2: // release()
            pCppI->releaseProxy(); // non virtual call!
            eRet = typelib_TypeClass_VOID;
            break;
        case 0: // queryInterface() opt
        {
            typelib_TypeDescription * pTD = 0;
            TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pCallStack[3] )->getTypeLibType() );
            if (pTD)
            {
                XInterface * pInterface = 0;
                (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
                    pCppI->getBridge()->getCppEnv(),
                    (void **)&pInterface, pCppI->getOid().pData,
                    (typelib_InterfaceTypeDescription *)pTD );
                if (pInterface)
                {
                    ::uno_any_construct(
                        reinterpret_cast< uno_Any * >( pCallStack[1] ),
                        &pInterface, pTD, cpp_acquire );
                    pInterface->release();
                    TYPELIB_DANGER_RELEASE( pTD );
                    *(void **)pRegisterReturn = pCallStack[1];
                    eRet = typelib_TypeClass_ANY;
                    break;
                }
                TYPELIB_DANGER_RELEASE( pTD );
            }
        } // else perform queryInterface()
        default:
            eRet = cpp2uno_call(
                pCppI, aMemberDescr.get(),
                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
                pCallStack, pRegisterReturn );
        }
        break;
    }
    default:
    {
        throw RuntimeException( "no member description found!", (XInterface *)pThis );
    }
    }
    return eRet;
}
/**
 * is called on incoming vtable calls
 * (called by asm snippets)
 */
void __attribute__((noinline)) cpp_vtable_call(
    sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, void** pCallStack )
{
    volatile long nRegReturn[2];
    typelib_TypeClass aType = cpp_mediate(
        nFunctionIndex, nVtableOffset, pCallStack, (sal_Int64*)nRegReturn );
    switch( aType )
    {
        case typelib_TypeClass_HYPER:
        case typelib_TypeClass_UNSIGNED_HYPER:
            __asm__( "movq %1, %%rdx\n\t"
                     "movq %0, %%rax\n"
                     : : "m"(nRegReturn[0]), "m"(nRegReturn[1]) );
            break;
        case typelib_TypeClass_FLOAT:
            __asm__( "flds %0\n\t"
                     "fstp %%st(0)\n\t"
                     "flds %0\n"
                     : : "m"(*(float *)nRegReturn) );
            break;
        case typelib_TypeClass_DOUBLE:
            __asm__( "fldl %0\n\t"
                     "fstp %%st(0)\n\t"
                     "fldl %0\n"
                     : : "m"(*(double *)nRegReturn) );
            break;
//      case typelib_TypeClass_UNSIGNED_SHORT:
//      case typelib_TypeClass_SHORT:
//          __asm__( "movswl %0, %%eax\n"
//                   : : "m"(nRegReturn) );
//      break;
        default:
            __asm__( "movq %0, %%rax\n"
                     : : "m"(nRegReturn[0]) );
            break;
    }
}
const int codeSnippetSize = 24;
// Generate a trampoline that redirects method calls to
// asm_vtable_call_wrapper().
//
// asm_vtable_call_wrapper() saves all the registers that are used for
// parameter passing on x86_64, and calls the cpp_vtable_call(), which
// executes the call, and sets the return values.
// asm_vtable_call_wrapper() then immediately returns those values which
// were set by cpp_vtable_call().
//
// Note: The code snippet we build here must not create a stack frame,
// otherwise the UNO exceptions stop working thanks to non-existing
// unwinding info.
static unsigned char * codeSnippet( unsigned char * code,
        sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
        bool simpleReturnType )
{
    if ( !simpleReturnType )
        nFunctionIndex |= 0x80000000;
    // movq $<nOffsetAndIndex>, %r10
    *reinterpret_cast<sal_uInt16 *>( code ) = 0xba49;
    *reinterpret_cast<sal_uInt32 *>( code + 2 ) = nFunctionIndex;
    *reinterpret_cast<sal_uInt32 *>( code + 6 ) = nVtableOffset;
    // movq $<asm_vtable_call_wrapper>, %r11
    *reinterpret_cast<sal_uInt16 *>( code + 10 ) = 0xbb49;
    *reinterpret_cast<sal_uInt32 *>( code + 12 )
        = reinterpret_cast<sal_uInt64>(asm_vtable_call_wrapper);
    *reinterpret_cast<sal_uInt32 *>( code + 16 )
        = reinterpret_cast<sal_uInt64>(asm_vtable_call_wrapper) >> 32;
    // jmpq *%r11
    *reinterpret_cast<sal_uInt32 *>( code + 20 ) = 0x00e3ff49;
    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;
}
std::size_t 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, sal_Int32,
    typelib_InterfaceTypeDescription *)
{
    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,
    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 * member = 0;
        TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
        assert(member != 0);
        switch (member->eTypeClass) {
        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
            // Getter:
            (s++)->fn = code;
            code = codeSnippet(
                code, functionOffset++, vtableOffset,
                bridges::cpp_uno::shared::isSimpleType(
                    reinterpret_cast<
                    typelib_InterfaceAttributeTypeDescription * >(
                        member)->pAttributeTypeRef));
            // Setter:
            if (!reinterpret_cast<
                typelib_InterfaceAttributeTypeDescription * >(
                    member)->bReadOnly)
            {
                (s++)->fn = code;
                code = codeSnippet(code, functionOffset++, vtableOffset, true);
            }
            break;
        case typelib_TypeClass_INTERFACE_METHOD:
            (s++)->fn = code;
            code = codeSnippet(
                code, functionOffset++, vtableOffset,
                bridges::cpp_uno::shared::isSimpleType(
                    reinterpret_cast<
                    typelib_InterfaceMethodTypeDescription * >(
                        member)->pReturnTypeRef));
            break;
        default:
            assert(false);
            break;
        }
        TYPELIB_DANGER_RELEASE(member);
    }
    return code;
}
void bridges::cpp_uno::shared::VtableFactory::flushCode(
    unsigned char const *, unsigned char const *)
{}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/except.cxx
New file
@@ -0,0 +1,291 @@
/* -*- 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 <stdio.h>
#include <strings.h>
#include <dlfcn.h>
#include <cxxabi.h>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/uno/genfunc.hxx>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <typelib/typedescription.hxx>
#include <uno/any2.h>
#include <unordered_map>
#include "share.hxx"
using namespace ::std;
using namespace ::osl;
using namespace ::com::sun::star::uno;
using namespace ::__cxxabiv1;
namespace CPPU_CURRENT_NAMESPACE
{
void dummy_can_throw_anything( char const * )
{
}
static OUString toUNOname( char const * p )
{
#if OSL_DEBUG_LEVEL > 1
    char const * start = p;
#endif
    // example: N3com3sun4star4lang24IllegalArgumentExceptionE
    OUStringBuffer buf( 64 );
    assert( 'N' == *p );
    ++p; // skip N
    while ('E' != *p)
    {
        // read chars count
        long n = (*p++ - '0');
        while ('0' <= *p && '9' >= *p)
        {
            n *= 10;
            n += (*p++ - '0');
        }
        buf.appendAscii( p, n );
        p += n;
        if ('E' != *p)
            buf.append( '.' );
    }
#if OSL_DEBUG_LEVEL > 1
    OUString ret( buf.makeStringAndClear() );
    OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) );
    fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() );
    return ret;
#else
    return buf.makeStringAndClear();
#endif
}
class RTTI
{
    typedef std::unordered_map< OUString, type_info * > t_rtti_map;
    Mutex m_mutex;
    t_rtti_map m_rttis;
    t_rtti_map m_generatedRttis;
    void * m_hApp;
public:
    RTTI();
    ~RTTI();
    type_info * getRTTI( typelib_CompoundTypeDescription * );
};
RTTI::RTTI()
    : m_hApp( dlopen( 0, RTLD_LAZY ) )
{
}
RTTI::~RTTI()
{
    dlclose( m_hApp );
}
type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
{
    type_info * rtti;
    OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName;
    MutexGuard guard( m_mutex );
    t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
    if (iFind == m_rttis.end())
    {
        // RTTI symbol
        OStringBuffer buf( 64 );
        buf.append( "_ZTIN" );
        sal_Int32 index = 0;
        do
        {
            OUString token( unoName.getToken( 0, '.', index ) );
            buf.append( token.getLength() );
            OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) );
            buf.append( c_token );
        }
        while (index >= 0);
        buf.append( 'E' );
        OString symName( buf.makeStringAndClear() );
        rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
        if (rtti)
        {
            pair< t_rtti_map::iterator, bool > insertion(
                m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
            assert(insertion.second && "### inserting new rtti failed?!");
        }
        else
        {
            // try to lookup the symbol in the generated rtti map
            t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) );
            if (iFind == m_generatedRttis.end())
            {
                // we must generate it !
                // symbol and rtti-name is nearly identical,
                // the symbol is prefixed with _ZTI
                char const * rttiName = symName.getStr() +4;
#if OSL_DEBUG_LEVEL > 1
                fprintf( stderr,"generated rtti for %s\n", rttiName );
#endif
                if (pTypeDescr->pBaseTypeDescription)
                {
                    // ensure availability of base
                    type_info * base_rtti = getRTTI(
                        (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription );
                    rtti = new __si_class_type_info(
                        strdup( rttiName ), (__class_type_info *)base_rtti );
                }
                else
                {
                    // this class has no base class
                    rtti = new __class_type_info( strdup( rttiName ) );
                }
                pair< t_rtti_map::iterator, bool > insertion(
                    m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
                assert(insertion.second && "### inserting new generated rtti failed?!");
            }
            else // taking already generated rtti
            {
                rtti = iFind->second;
            }
        }
    }
    else
    {
        rtti = iFind->second;
    }
    return rtti;
}
static void deleteException( void * pExc )
{
    __cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
    typelib_TypeDescription * pTD = 0;
    OUString unoName( toUNOname( header->exceptionType->name() ) );
    ::typelib_typedescription_getByName( &pTD, unoName.pData );
    assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!");
    if (pTD)
    {
        ::uno_destructData( pExc, pTD, cpp_release );
        ::typelib_typedescription_release( pTD );
    }
}
void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
{
#if OSL_DEBUG_LEVEL > 1
    OString cstr(
        OUStringToOString(
            OUString::unacquired( &pUnoExc->pType->pTypeName ),
            RTL_TEXTENCODING_ASCII_US ) );
    fprintf( stderr, "> uno exception occurred: %s\n", cstr.getStr() );
#endif
    void * pCppExc;
    type_info * rtti;
    {
    // construct cpp exception object
    typelib_TypeDescription * pTypeDescr = 0;
    TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
    assert(pTypeDescr);
    if (! pTypeDescr)
    {
        throw RuntimeException(
            OUString("cannot get typedescription for type ") +
            OUString::unacquired( &pUnoExc->pType->pTypeName ) );
    }
    pCppExc = __cxa_allocate_exception( pTypeDescr->nSize );
    ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
    // destruct uno exception
    ::uno_any_destruct( pUnoExc, 0 );
    // avoiding locked counts
    static RTTI rtti_data;
    rtti = (type_info*)rtti_data.getRTTI((typelib_CompoundTypeDescription*)pTypeDescr);
    TYPELIB_DANGER_RELEASE( pTypeDescr );
    assert(rtti);
    if (! rtti)
    {
        throw RuntimeException(
            OUString("no rtti for type ") +
            OUString::unacquired( &pUnoExc->pType->pTypeName ) );
    }
    }
    __cxa_throw( pCppExc, rtti, deleteException );
}
void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno)
{
    __cxa_exception * header = __cxa_get_globals()->caughtExceptions;
    if (! header)
    {
        RuntimeException aRE( "no exception header!" );
        Type const & rType = cppu::UnoType<decltype(aRE)>::get();
        uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
        SAL_WARN("bridges", aRE.Message);
        return;
    }
    std::type_info *exceptionType = __cxa_current_exception_type();
    typelib_TypeDescription * pExcTypeDescr = 0;
    OUString unoName( toUNOname( exceptionType->name() ) );
#if OSL_DEBUG_LEVEL > 1
    OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) );
    fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() );
#endif
    typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
    if (0 == pExcTypeDescr)
    {
        RuntimeException aRE( OUString("exception type not found: ") + unoName );
        Type const & rType = cppu::UnoType<decltype(aRE)>::get();
        uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
        SAL_WARN("bridges", aRE.Message);
    }
    else
    {
        // construct uno exception any
        uno_any_constructAndConvert( pUnoExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno );
        typelib_typedescription_release( pExcTypeDescr );
    }
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/share.hxx
New file
@@ -0,0 +1,86 @@
/* -*- 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_SOLARIS_X86_64_SHARE_HXX
#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_SOLARIS_X86_64_SHARE_HXX
#include "uno/mapping.h"
#include <typeinfo>
#include <exception>
#include <cstddef>
extern "C" void asm_vtable_call_wrapper( ... );
namespace CPPU_CURRENT_NAMESPACE
{
void dummy_can_throw_anything( char const * );
// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and 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 *);
    void (*unexpectedHandler)(); // std::unexpected_handler dropped from C++17
    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;
};
extern "C" void *__cxa_allocate_exception(
    std::size_t thrown_size ) throw();
extern "C" void __cxa_throw (
    void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
struct __cxa_eh_globals
{
    __cxa_exception *caughtExceptions;
    unsigned int uncaughtExceptions;
};
extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
extern "C" std::type_info *__cxa_current_exception_type() throw();
void raiseException(
    uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
void fillUnoException(uno_Any *, uno_Mapping * pCpp2Uno);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/files/gcc3_solaris_x86-64/uno2cpp.cxx
New file
@@ -0,0 +1,348 @@
/* -*- 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 <exception>
#include <typeinfo>
#include <malloc.h>
#include <sal/alloca.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
#include "types.hxx"
#include "unointerfaceproxy.hxx"
#include "vtables.hxx"
#include "share.hxx"
#include "callvirtualmethod.hxx"
using namespace ::com::sun::star::uno;
namespace
{
static void cpp_call(
    bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
    bridges::cpp_uno::shared::VtableSlot aVtableSlot,
    typelib_TypeDescriptionReference * pReturnTypeRef,
    sal_Int32 nParams, typelib_MethodParameter * pParams,
    void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
{
      // max space for: [complex ret ptr], values|ptr ...
      char * pCppStack      =
          (char *)alloca( ((nParams+3) * sizeof(sal_Int64)) );
      char * pCppStackStart = pCppStack;
    // return
    typelib_TypeDescription * pReturnTypeDescr = 0;
    TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
    assert(pReturnTypeDescr);
    void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
    if (pReturnTypeDescr)
    {
        if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
        {
            pCppReturn = pUnoReturn; // direct way for simple types
        }
        else
        {
            // complex return via ptr
            pCppReturn = *(void **)pCppStack
                = (bridges::cpp_uno::shared::relatesToInterfaceType(
                       pReturnTypeDescr )
                   ? alloca( pReturnTypeDescr->nSize )
                   : pUnoReturn); // direct way
            pCppStack += sizeof(void *);
        }
    }
    // push this
    void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI())
        + aVtableSlot.offset;
    *(void**)pCppStack = pAdjustedThisPtr;
    pCppStack += sizeof( void* );
    // stack space
    static_assert(sizeof(void *) == sizeof(sal_Int64), "### unexpected size!");
    // args
    void ** pCppArgs  = (void **)alloca( 3 * sizeof(void *) * nParams );
    // indices of values this have to be converted (interface conversion cpp<=>uno)
    sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams);
    // type descriptions for reconversions
    typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
    sal_Int32 nTempIndices   = 0;
    for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
    {
        const typelib_MethodParameter & rParam = pParams[nPos];
        typelib_TypeDescription * pParamTypeDescr = 0;
        TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
        if (!rParam.bOut
            && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
        {
            uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr,
                                    pThis->getBridge()->getUno2Cpp() );
            // no longer needed
            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
        }
        else // ptr to complex value | ref
        {
            if (! rParam.bIn) // is pure out
            {
                // cpp out is constructed mem, uno out is not!
                uno_constructData(
                    *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
                    pParamTypeDescr );
                pTempIndices[nTempIndices] = nPos; // default constructed for cpp call
                // will be released at reconversion
                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
            }
            // is in/inout
            else if (bridges::cpp_uno::shared::relatesToInterfaceType(
                         pParamTypeDescr ))
            {
                uno_copyAndConvertData(
                    *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
                    pUnoArgs[nPos], pParamTypeDescr,
                    pThis->getBridge()->getUno2Cpp() );
                pTempIndices[nTempIndices] = nPos; // has to be reconverted
                // will be released at reconversion
                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
            }
            else // direct way
            {
                *(void **)pCppStack = pCppArgs[nPos] = pUnoArgs[nPos];
                // no longer needed
                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
            }
        }
        pCppStack += sizeof(sal_Int64); // standard parameter length
    }
    try
    {
        assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)");
        try {
            CPPU_CURRENT_NAMESPACE::callVirtualMethod(
                pAdjustedThisPtr, aVtableSlot.index,
                pCppReturn, pReturnTypeDescr->eTypeClass,
                (sal_Int64 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int64) );
        } catch (css::uno::Exception &) {
            throw;
        } catch (std::exception & e) {
            throw css::uno::RuntimeException(
                "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
                + o3tl::runtimeToOUString(e.what()));
        } catch (...) {
            throw css::uno::RuntimeException("C++ code threw unknown exception");
        }
        // NO exception occurred...
        *ppUnoExc = 0;
        // reconvert temporary params
        for ( ; nTempIndices--; )
        {
            sal_Int32 nIndex = pTempIndices[nTempIndices];
            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
            if (pParams[nIndex].bIn)
            {
                if (pParams[nIndex].bOut) // inout
                {
                    uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
                    uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
                                            pThis->getBridge()->getCpp2Uno() );
                }
            }
            else // pure out
            {
                uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
                                        pThis->getBridge()->getCpp2Uno() );
            }
            // destroy temp cpp param => cpp: every param was constructed
            uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
        }
        // return value
        if (pCppReturn && pUnoReturn != pCppReturn)
        {
            uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
                                    pThis->getBridge()->getCpp2Uno() );
            uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
        }
    }
    catch (...)
    {
        // fill uno exception
        CPPU_CURRENT_NAMESPACE::fillUnoException(*ppUnoExc, pThis->getBridge()->getCpp2Uno());
        // temporary params
        for ( ; nTempIndices--; )
        {
            sal_Int32 nIndex = pTempIndices[nTempIndices];
            // destroy temp cpp param => cpp: every param was constructed
            uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndices], cpp_release );
            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
        }
        // return type
        if (pReturnTypeDescr)
            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
    }
}
}
namespace bridges { namespace cpp_uno { namespace shared {
void unoInterfaceProxyDispatch(
    uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
    void * pReturn, void * pArgs[], uno_Any ** ppException )
{
    // is my surrogate
    bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
        = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI);
    typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
    switch (pMemberDescr->eTypeClass)
    {
    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
    {
        VtableSlot aVtableSlot(
            getVtableSlot(
                reinterpret_cast<
                    typelib_InterfaceAttributeTypeDescription const * >(
                        pMemberDescr)));
        if (pReturn)
        {
            // dependent dispatch
            cpp_call(
                pThis, aVtableSlot,
                ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
                0, 0, // no params
                pReturn, pArgs, ppException );
        }
        else
        {
            // is SET
            typelib_MethodParameter aParam;
            aParam.pTypeRef =
                ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
            aParam.bIn      = sal_True;
            aParam.bOut     = sal_False;
            typelib_TypeDescriptionReference * pReturnTypeRef = 0;
            OUString aVoidName("void");
            typelib_typedescriptionreference_new(
                &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
            // dependent dispatch
            aVtableSlot.index += 1; // get, then set method
            cpp_call(
                pThis, aVtableSlot,
                pReturnTypeRef,
                1, &aParam,
                pReturn, pArgs, ppException );
            typelib_typedescriptionreference_release( pReturnTypeRef );
        }
        break;
    }
    case typelib_TypeClass_INTERFACE_METHOD:
    {
        VtableSlot aVtableSlot(
            getVtableSlot(
                reinterpret_cast<
                    typelib_InterfaceMethodTypeDescription const * >(
                        pMemberDescr)));
        switch (aVtableSlot.index)
        {
            // standard calls
        case 1: // acquire uno interface
            (*pUnoI->acquire)( pUnoI );
            *ppException = 0;
            break;
        case 2: // release uno interface
            (*pUnoI->release)( pUnoI );
            *ppException = 0;
            break;
        case 0: // queryInterface() opt
        {
            typelib_TypeDescription * pTD = 0;
            TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
            if (pTD)
            {
                uno_Interface * pInterface = 0;
                (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)(
                    pThis->pBridge->getUnoEnv(),
                    (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
                if (pInterface)
                {
                    ::uno_any_construct(
                        reinterpret_cast< uno_Any * >( pReturn ),
                        &pInterface, pTD, 0 );
                    (*pInterface->release)( pInterface );
                    TYPELIB_DANGER_RELEASE( pTD );
                    *ppException = 0;
                    break;
                }
                TYPELIB_DANGER_RELEASE( pTD );
            }
        } // else perform queryInterface()
        default:
            // dependent dispatch
            cpp_call(
                pThis, aVtableSlot,
                ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
                ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
                ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
                pReturn, pArgs, ppException );
        }
        break;
    }
    default:
    {
        ::com::sun::star::uno::RuntimeException aExc(
            "illegal member type description!",
            ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
        Type const & rExcType = cppu::UnoType<decltype(aExc)>::get();
        // binary identical null reference
        ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
    }
    }
}
} } }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
components/desktop/libreoffice/libreoffice.p5m
Diff too large
components/desktop/libreoffice/manifests/sample-manifest.p5m
Diff too large
components/desktop/libreoffice/patches/03-alloca.patch
@@ -23,19 +23,18 @@
 #include <sal/log.hxx>
 #include <uno/dispatcher.h>
 #include <typelib/typedescription.hxx>
--- libreoffice-6.4.2.2/vcl/source/helper/strhelper.cxx.1    2020-03-16 12:22:08.219082534 +0000
+++ libreoffice-6.4.2.2/vcl/source/helper/strhelper.cxx    2020-03-16 12:22:46.051613810 +0000
@@ -17,6 +17,10 @@
--- libreoffice-7.2.5.2/vcl/source/helper/strhelper.cxx.orig    Wed Feb  9 11:40:19 2022
+++ libreoffice-7.2.5.2/vcl/source/helper/strhelper.cxx        Wed Feb  9 11:41:29 2022
@@ -16,6 +16,9 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+#ifdef __sun__
+#include <alloca.h>
+#endif
+
 #include <vcl/strhelper.hxx>
 
 namespace  {
 #include <strhelper.hxx>
--- libreoffice-6.4.2.2/vcl/unx/generic/app/i18n_cb.cxx.1    2020-03-18 07:29:10.139990266 +0000
+++ libreoffice-6.4.2.2/vcl/unx/generic/app/i18n_cb.cxx    2020-03-18 07:29:53.640901720 +0000
@@ -19,6 +19,9 @@
@@ -74,19 +73,6 @@
 #if defined(NETBSD) || defined (FREEBSD) || defined(OPENBSD)
 #include <sys/poll.h>
 #else
--- libreoffice-6.4.2.2/vcl/opengl/x11/salvd.cxx.1    2020-04-06 17:02:21.537690277 +0000
+++ libreoffice-6.4.2.2/vcl/opengl/x11/salvd.cxx    2020-04-06 17:03:00.877301273 +0000
@@ -16,6 +16,10 @@
 #include <opengl/x11/salvd.hxx>
+#ifdef __sun__
+#include <alloca.h>
+#endif
+
 void X11SalGraphics::Init( X11OpenGLSalVirtualDevice *pDevice )
 {
     SalDisplay *pDisplay  = pDevice->GetDisplay();
--- libreoffice-6.4.2.2/vcl/unx/generic/window/salframe.cxx.1    2020-04-06 17:34:22.433987425 +0000
+++ libreoffice-6.4.2.2/vcl/unx/generic/window/salframe.cxx    2020-04-06 17:34:49.177033362 +0000
@@ -21,6 +21,10 @@
components/desktop/libreoffice/patches/05-avoid-conflict-with-math-version.patch
@@ -1,7 +1,7 @@
Avoid conflict with version symbol from math.h
--- libreoffice-6.4.2.2/vcl/opengl/x11/X11DeviceInfo.cxx.1    2020-03-17 17:53:39.356712820 +0000
+++ libreoffice-6.4.2.2/vcl/opengl/x11/X11DeviceInfo.cxx    2020-03-17 17:57:12.113693962 +0000
--- libreoffice-6.4.2.2/vcl/source/opengl/x11/X11DeviceInfo.cxx.1    2020-03-17 17:53:39.356712820 +0000
+++ libreoffice-6.4.2.2/vcl/source/opengl/x11/X11DeviceInfo.cxx        2020-03-17 17:57:12.113693962 +0000
@@ -95,7 +95,7 @@
     return ret;
 }
components/desktop/libreoffice/patches/07-os-solaris.patch
File was deleted
components/desktop/libreoffice/patches/12-change-download.patch
@@ -19,9 +19,9 @@
+        $(call fetch_Optional,REDLAND,RAPTOR_TARBALL) \
+    ,$(call fetch_Download_item,http://dlc.openindiana.org/oi-userland/source-archives,$(item)))
+    $(foreach item, \
         $(call fetch_Optional,ODK,UNOWINREG_DLL) \
         $(call fetch_Optional,OPENSYMBOL,OPENSYMBOL_TTF) \
         $(call fetch_Optional,ODFVALIDATOR,ODFVALIDATOR_JAR) \
        $(call fetch_Optional,OFFICEOTRON,OFFICEOTRON_JAR) \
--- libreoffice-6.4.3.2/download.lst.orig    2020-04-07 17:26:49.000000000 +0000
+++ libreoffice-6.4.3.2/download.lst    2020-12-25 20:02:09.529275219 +0000
@@ -218,8 +218,8 @@
components/desktop/libreoffice/patches/13-fix-TRUE.patch
File was deleted
components/desktop/libreoffice/patches/16-std_string_poppler.patch
New file
@@ -0,0 +1,43 @@
--- libreoffice-7.2.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx.~1~    Tue Feb  8 15:16:27 2022
+++ libreoffice-7.2.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx    Tue Feb  8 16:34:47 2022
@@ -145,7 +145,7 @@
     bool collectBytes = false;
     int startOfScan = 0;
     int b1 = -1;
-    for (; ; )
+    for ( ; ; )
     {
         const int b2 = b1;
         b1 = str->getChar();
@@ -153,8 +153,8 @@
         if (b1 == -1)
             return false;
-        if (collectBytes)
-        {
+        if (collectBytes) {
+
             outBuf.push_back(static_cast<Output_t>(b1));
             bytesToMarker--;
@@ -433,9 +433,9 @@
     int nSize = 0;
 #if POPPLER_CHECK_VERSION(20, 12, 0)
-    std::string familyName = gfxFont->getNameWithoutSubsetTag();
+    std::string familyName( gfxFont->getNameWithoutSubsetTag() );
 #else
-    std::string familyName = gfxFont->getName()->toStr();
+    std::string familyName( gfxFont->getName()->getCString() );
     if (familyName.length() > 7 && familyName.at(6) == '+')
     {
         familyName = familyName.substr(7);
@@ -444,7 +444,7 @@
     if( familyName != "" )
     {
         aNewFont.familyName.clear();
-        aNewFont.familyName.append( familyName );
+        aNewFont.familyName.append( familyName.c_str() );
     }
     else
     {
components/desktop/libreoffice/patches/51-fix-nUTC.patch
New file
@@ -0,0 +1,11 @@
--- libreoffice-7.2.5.2/tools/source/datetime/ttime.cxx.orig    Wed Feb  9 08:46:29 2022
+++ libreoffice-7.2.5.2/tools/source/datetime/ttime.cxx    Wed Feb  9 08:47:17 2022
@@ -415,7 +415,7 @@
 #if defined(__sun)
         // Solaris gmtime_r() seems not to handle daylight saving time
         // flags correctly
-        nUTC = nLocalTime + ( aTM.tm_isdst == 0 ? timezone : altzone );
+        sal_Int32 nUTC = nLocalTime + ( aTM.tm_isdst == 0 ? timezone : altzone );
 #elif defined( LINUX )
         // Linux mktime() seems not to handle tm_isdst correctly
         sal_Int32 nUTC = nLocalTime - aTM.tm_gmtoff;
components/desktop/libreoffice/patches/52-strhelper-cxx.patch
New file
@@ -0,0 +1,11 @@
--- libreoffice-7.2.5.2/vcl/unx/generic/printer/printerinfomanager.cxx.orig    Wed Feb  9 13:01:28 2022
+++ libreoffice-7.2.5.2/vcl/unx/generic/printer/printerinfomanager.cxx    Wed Feb  9 13:02:04 2022
@@ -21,7 +21,7 @@
 #include <unx/cupsmgr.hxx>
 #include <unx/helper.hxx>
-#include <vcl/strhelper.hxx>
+#include <strhelper.hxx>
 #include <saldatabasic.hxx>
components/desktop/libreoffice/patches/53-more-alloca.patch
New file
@@ -0,0 +1,13 @@
--- libreoffice-7.2.5.2/formula/source/core/api/FormulaCompiler.cxx.orig    Wed Feb  9 13:46:51 2022
+++ libreoffice-7.2.5.2/formula/source/core/api/FormulaCompiler.cxx    Wed Feb  9 13:47:13 2022
@@ -37,6 +37,10 @@
 #include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp>
 #include <algorithm>
+#ifdef __sun__
+#include <alloca.h>
+#endif
+
 namespace formula
 {
     using namespace ::com::sun::star;
components/desktop/libreoffice/patches/54-SEC-fix.patch
New file
@@ -0,0 +1,11 @@
--- libreoffice-7.2.5.2/writerfilter/source/rtftok/rtfcontrolwords.hxx.orig    Wed Feb  9 17:13:49 2022
+++ libreoffice-7.2.5.2/writerfilter/source/rtftok/rtfcontrolwords.hxx    Wed Feb  9 17:13:25 2022
@@ -11,6 +11,8 @@
 namespace writerfilter::rtftok
 {
+// fix error with SEC being defined elsewhere
+#undef SEC
 /**
  * An RTF destination state is the last open destination control word.
  *
components/desktop/libreoffice/patches/55-gdb-prettyprinter.patch
New file
@@ -0,0 +1,15 @@
--- libreoffice-7.2.5.2/solenv/gdb/libreoffice/util/compatibility.py.orig    Thu Feb 10 18:27:00 2022
+++ libreoffice-7.2.5.2/solenv/gdb/libreoffice/util/compatibility.py    Thu Feb 10 18:28:39 2022
@@ -15,6 +15,11 @@
 except ImportError:
     use_gdb_printing = False
-use_lazy_string = hasattr(gdb.Value, 'lazy_string')
+# gdb choking on display of utf-16 lazy strings with
+# "Resource temporarily unavailable." or "Error 0" messages.
+# use_lazy_string = hasattr(gdb.Value, 'lazy_string')
+
+use_lazy_string = False
+
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
components/desktop/libreoffice/patches/56-add-platform-mk.patch
New file
@@ -0,0 +1,17 @@
--- libreoffice-6.4.7.2/solenv/gbuild/platform/SOLARIS_X86_64_GCC.mk    1969-12-31 20:00:00.000000000 +0000
+++ libreoffice-6.4.7.2/solenv/gbuild/platform/SOLARIS_X86_64_GCC.mk    2022-02-01 20:09:30.322908759 +0000
@@ -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/.
+#
+#*************************************************************************
+
+include $(GBUILDDIR)/platform/solaris.mk
+
+
+# vim: set noet sw=4 ts=4:
components/desktop/libreoffice/patches/57-configure.ca-enable-64bit-solaris.patch
New file
@@ -0,0 +1,27 @@
--- libreoffice-6.4.7.2/configure.ac    Tue Feb  1 18:17:23 2022
+++ libreoffice-6.4.7.2/configure.ac.new    Tue Feb  1 19:32:02 2022
@@ -605,10 +605,10 @@
     dnl Check whether we're using a SPARC or i386 processor
     AC_MSG_CHECKING([the processor type])
-    if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
+    if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386" -o "$host_cpu" = "x86_64"; then
         AC_MSG_RESULT([ok ($host_cpu)])
     else
-        AC_MSG_ERROR([only SPARC and i386 processors are supported])
+        AC_MSG_ERROR([only SPARC and i386 processors are supported, not $host_cpu])
     fi
     ;;
@@ -4592,6 +4592,11 @@
         RTL_ARCH=x86
         PLATFORMID=solaris_x86
         ;;
+    x86_64)
+        CPUNAME=X86_64
+        RTL_ARCH=X86_64
+        PLATFORMID=solaris_x86_64
+        ;;
     sparc)
         CPUNAME=SPARC
         RTL_ARCH=SPARC
components/desktop/libreoffice/patches/58-backtrace-c.patch
New file
@@ -0,0 +1,11 @@
--- libreoffice-6.4.7.2/sal/osl/unx/backtrace.c.~1~    Wed Oct  7 09:23:42 2020
+++ libreoffice-6.4.7.2/sal/osl/unx/backtrace.c    Fri Feb  4 09:27:22 2022
@@ -44,7 +44,7 @@
 #endif
-#elif defined( INTEL )
+#elif defined( INTEL ) || defined( X86_64 )
 #define FRAME_PTR_OFFSET 3
 #define FRAME_OFFSET     0
components/desktop/libreoffice/patches/59-bridge-library.patch
New file
@@ -0,0 +1,14 @@
--- libreoffice-6.4.7.2/bridges/Library_cpp_uno.mk.orig    Wed Oct  7 09:23:42 2020
+++ libreoffice-6.4.7.2/bridges/Library_cpp_uno.mk    Tue Feb  1 22:56:38 2022
@@ -172,6 +172,11 @@
 bridges_SELECTED_BRIDGE := gcc3_macosx_x86-64
 bridge_exception_objects := abi call cpp2uno except uno2cpp
 bridge_noncallexception_noopt_objects := callvirtualmethod
+else ifeq ($(OS),SOLARIS)
+bridges_SELECTED_BRIDGE := gcc3_solaris_x86-64
+bridge_exception_objects := cpp2uno except uno2cpp
+bridge_asm_objects := call
+bridge_noncallexception_objects := callvirtualmethod
 else ifeq ($(COM),MSC)
 bridges_SELECTED_BRIDGE := msvc_win32_x86-64
 bridge_exception_objects := cpp2uno dllinit uno2cpp
components/desktop/libreoffice/patches/60-unpack-to-rootdir.patch
New file
@@ -0,0 +1,27 @@
--- libreoffice-7.2.5.2/bin/unpack-sources.~1~    Tue Feb  8 14:46:06 2022
+++ libreoffice-7.2.5.2/bin/unpack-sources    Tue Feb  8 14:55:18 2022
@@ -63,8 +63,7 @@
     exit 0;
 fi
-lo_src_dir="$start_dir/src"
-mkdir -p "$lo_src_dir"
+lo_src_dir="$start_dir"
 for tarball in $tarballs ; do
     tarname=`basename $tarball | sed -e "s/\.tar\..*//"`
@@ -74,12 +73,8 @@
     fi
     echo "Unpacking $tarname..."
-    echo mkdir -p "$lo_src_dir/$tarname"
-    if ! mkdir -p "$lo_src_dir/$tarname" ; then
-        echo "Error: could not create directory $lo_src_dir/$tarname"
-    fi
-    echo tar -xf "$tarball" -C "$lo_src_dir/$tarname" --strip-components=1
-    if ! tar -xf "$tarball" -C "$lo_src_dir/$tarname" --strip-components=1; then
+    echo tar -xf "$tarball" -C "$lo_src_dir" --strip-components=1
+    if ! tar -xf "$tarball" -C "$lo_src_dir" --strip-components=1; then
         echo "Error: could not unpack $tarname"
         exit 1
     fi
components/desktop/libreoffice/patches/61-fix-coinmp-makefile.patch
New file
@@ -0,0 +1,36 @@
--- libreoffice-7.2.5.2/external/coinmp/ExternalProject_coinmp.mk.~1~    Wed Dec 29 08:49:22 2021
+++ libreoffice-7.2.5.2/external/coinmp/ExternalProject_coinmp.mk    Wed Feb 23 09:20:27 2022
@@ -12,7 +12,6 @@
 $(eval $(call gb_ExternalProject_register_targets,coinmp,\
     build \
 ))
-
 ifeq ($(COM),MSC)
 $(call gb_ExternalProject_get_state_target,coinmp,build) :
     $(call gb_Trace_StartRange,coinmp,EXTERNAL)
@@ -27,11 +26,14 @@
 else
 $(call gb_ExternalProject_get_state_target,coinmp,build) :
+    $(info COINMP_CFLAGS = $(COINMP_CFLAGS))
+    $(info COINMP_CXXFLAGS = $(COINMP_CXXFLAGS))
     $(call gb_Trace_StartRange,coinmp,EXTERNAL)
     +$(call gb_ExternalProject_run,build,\
-        $(gb_RUN_CONFIGURE) ./configure COIN_SKIP_PROJECTS="Data/Sample" \
+        $(gb_RUN_CONFIGURE) CFLAGS="$(COINMP_CFLAGS)" CXXFLAGS="$(COINMP_CXXFLAGS)"  ./configure COIN_SKIP_PROJECTS="Data/Sample" \
             $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
-            $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+            --build=$(BUILD_PLATFORM) \
+            $(if $(CROSS_COMPILING), --host=$(HOST_PLATFORM)) \
             $(if $(DISABLE_DYNLOADING),--disable-shared) \
             --disable-bzlib \
             $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
@@ -40,7 +42,7 @@
             $(if $(filter LINUX,$(OS)), \
                 'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
                     -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
-        && $(MAKE) \
+        && $(MAKE) -j1 \
         $(if $(filter MACOSX,$(OS)),&& $(PERL) \
             $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \
             $(EXTERNAL_WORKDIR)/Cbc/src/.libs/libCbc.3.8.8.dylib \
components/desktop/libreoffice/pkg5
@@ -2,6 +2,7 @@
    "dependencies": [
        "SUNWcs",
        "compress/xz",
        "database/mariadb-101/client",
        "database/mariadb-101/library",
        "developer/assembler/nasm",
        "developer/cppunit",
@@ -56,6 +57,7 @@
        "library/zlib",
        "shell/ksh93",
        "system/library",
        "system/library/boost",
        "system/library/fontconfig",
        "system/library/freetype-2",
        "system/library/g++-7-runtime",