summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05Export RTTI symbols from liblo-native-code.so, for binary UNO bridgeStephan Bergmann1-3/+0
This will become important when switching armeabi-v7a to libc++/libc++abi/libunwind (coming soon) which uses address instead of string comparison when checking for type equality, so that exceptions thrown from the binary UNO bridge will need to use the exact same RTTI objects as referenced from the compiled catch clauses. Change-Id: If8bcb39212b5f5e154aee215cb5f471fe2dc4a7b Reviewed-on: https://gerrit.libreoffice.org/64965 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-05android: use unified headers and llvm-c++ STL (x86) with NDK 16Christian Lohmaier4-16/+54
gnustl (and others) are to be removed in future versions of the ndk also bump gradle and build-tools to current versions along with it arm unfortunately crashes with llvm-c++, so keep with gnustl for now/fix that later Change-Id: Ic794c3293b599b77ec48096bf3283a99c09cbb79 Reviewed-on: https://gerrit.libreoffice.org/45163 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-06-05Fix getRTTI for Android x86Stephan Bergmann2-0/+37
First, make sure existing compiler-generated RTTI from liblo-native-code.so is found (so that catching bridge-synthesized exceptions in native code works with libc++abi, which checks type equivalence by address instead of string comparsion), by using the dlsym(RTLD_DEFAULT,...) mechanism as in the ANDROID gcc3_linux_arm bridge case. And second, if that should fail, synthesize the type_info even if the included cxxabi.h doesn't provide the relevant type declarations, by using copies from the ABI specification, as also done on other platforms. Instead of always having getRTTI fail and raiseException throw a non-synthesized css::uno::RuntimeException("no rtti for type ..."). Which explains the mystery discussed in the commit message of 312eeeee42cb4a1e356943e17305555e41afc4ef "Switch Android armeabi-v7a to libc++/libc++abi/libunwind too", why the observed misbehavior on x86 was so different from that on armeabi-v7a. Change-Id: I9308654c5c2b88b4d27e0e8e9edda1849133a161 Reviewed-on: https://gerrit.libreoffice.org/65070 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-30Re-think cppu::throwException() and the C++/UNO bridge on iOSTor Lillqvist1-0/+4
It seems that on iOS, where we don't have any Java, Python, BASIC, or other scripting, the only thing that would use the C++/UNO bridge functionality that invokes codeSnippet() was cppu::throwException(). codeSnippet() is part of what corresponds to the code that uses run-time-generated machine code on other platforms. We can't generate code at run-time on iOS, that has been known forever. Instead we have used some manually written assembler to handle it instead. We used to have a Perl script to generate a set of code snippets for different cases, different numbers of parameters of the called function and whatnot, but that went away at some stage some year ago. (It is unclear whether that broke the C++/UNO bridge on iOS, or whether the stuff continued to work even after that.) Anyway, this handwritten assembly, or the manual construction of internal data structures for exceptions, or something else, seemed to have bit-rotten. Exceptions thrown with cppu::throwException() were not catchable properly any longer. Instead of digging in and trying to understand what is wrong, I chose another solution. It turns out that the number of types of exception objects thrown by cppu::throwException() is fairly small. During startup of the LibreOffice code, and loading of an .odt document, only one kind of exception is thrown this way... (The lovely css::ucb:InteractiveAugmentedIOException.) So we can simply have code that checks what the type of object being thrown is, and explicitgly throws such an object then with a normal C++ throw statement. Seems to work. Sadly the cppu::getCaughtException() API still needs some inline assembly in the C++/UNO brige. That seems to work though, knock on wood. This commit also adds a small "unit test" for iOS, copied from cppuhelperm to ImplSVMain(). Ideally we should not copy code around of course, but have a separate unit test app for iOS that would somehow include relevant unit tests from source files all over the place. Later. Change-Id: Ib6d9d5b6fb8cc684ec15c97a312ca2f720e87069 Reviewed-on: https://gerrit.libreoffice.org/60506 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 7d6be61a62ca3724c67ab3fb93e60a2748d8a67e) Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2017-11-30fix includes in aarch64 bridgeDavid Tardon4-5/+5
Change-Id: Ia27f15483c27bc43a3cd3a74432f15fa928ad6da (cherry picked from commit 897c07bda2d116bcc2fa4a64c1eb75a52651c991) Signed-off-by: David Tardon <dtardon@redhat.com>
2017-11-14Fix ASan "alloc-dealloc-mismatch (operator new [] vs operator delete)"Stephan Bergmann1-24/+64
...e.g. during CppunitTest_smoketest, after be2d9d3407ddae22797879e93778513be30ec5aa "Clean up m_generatedRttis at exit" Change-Id: Ife4b07927ba11cf5b99e987b3bb9af068652ba62
2017-11-13ofz: Direct-leakCaolán McNamara1-5/+11
asan reports that the strdups leak and __si_class_type_info takes a const char* arg Change-Id: Ie0ee94554689d9246981cb7d6ce0f23917c2d333 Reviewed-on: https://gerrit.libreoffice.org/44641 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-09Clean up m_generatedRttis at exitStephan Bergmann1-16/+24
...inspired by <https://gerrit.libreoffice.org/#/c/44487/> "silence RTTI::getRTTI Direct-leak". (std::type_info is guaranteed to have a virtual dtor.) Change-Id: I972bfd57a2e800ef0e9bfc978fdc6345dbff853e Reviewed-on: https://gerrit.libreoffice.org/44532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-03iOS include error in bridgesjan Iversen1-1/+1
Need to use "" for call.hxx include Change-Id: I9a30f3d3cfab83076f9ad22a5b637f8f4fc7c432
2017-10-27loplugin:includeform: bridges (Windows)Stephan Bergmann4-14/+14
Change-Id: I4514d751d5449902c589c7f3577c7f3cd593d2e9
2017-10-24loplugin:includeform: bridges (macOS)Stephan Bergmann8-29/+29
Change-Id: I9df97c6684de7dfc60f79dd11abaed069e5f08b2
2017-10-23loplugin:includeform: bridgesStephan Bergmann15-85/+85
Change-Id: Icad98d3153a5b1710c8c2a2d338ba0129e9ff208
2017-10-23overload std::hash for OUString and OStringNoel Grandin24-24/+24
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-05Fix --enable-assert-always-abort (but not --enable-debug) buildTor Lillqvist1-1/+1
Look at NDEBUG, not OSL_DEBUG_LEVEL, to see whether asserts are active or not. Change-Id: I772d27da4bcc73c8c5a50ab4b72f50caddcf7273
2017-09-22iOS, make simulator config copy of macosx.jan Iversen13-1050/+4943
When compiling for the simulator it is like compiling for macosx (64bit) but with other libraries, therefore the bridge should be like the macosx. Change-Id: I59f1442a5c77d09ad0bc4bf31c2432fc32ef725e
2017-09-22iOS, updated helper.s to do 64 bitjan Iversen1-24/+1
Removed __arm reference Change-Id: I194d79ccb5ba2117e0f468080813bf8de1ada84a
2017-09-21iOS, change bridges to 64bit and reducejan Iversen6-1659/+1054
Changed __i386 to not __arm64 iOS either compiles for arm64 (production) or x86_64 (simulator) add common parts to cpp2uno and uno2cpp Change-Id: I059f3cc23bb658d6d53dbf2bf4aa6634eeac9662
2017-09-19iOS, remove support for 32bit (arm).jan Iversen14-1265/+2
Supporting 32bit iOS, means a.o. adding several libraries to the dependency list because macOSX does not install them by default (e.g. zlib). 32bit is only used in old iPhones. updated configure.ac removed from solenv/gbuild/platform bridges corrected Change-Id: I415e744a9cb4acb3b5fbfca33c22940a1d56e390
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski2-0/+6
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18bridges: [loplugin:stringconstant]Michael Stahl21-21/+21
Change-Id: I07501ac3593cd5df713b74e04ea64d22365958b9
2017-09-16Use more WIN32_LEAN_AND_MEANMike Kaganski2-0/+2
https://msdn.microsoft.com/en-us/aa383745 Change-Id: I83528dc8e6a5e119e7aa816219d35f1ea3723b96 Reviewed-on: https://gerrit.libreoffice.org/42338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-07Fix typosAndrea Gelmini2-2/+2
Change-Id: I855b26e447a8406cbab6f4c7f918b3319debba35 Reviewed-on: https://gerrit.libreoffice.org/42034 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-09-05iOS, update gcc3_ios_arm exception.jan Iversen1-71/+97
except.c updated to new structure (includes etc). Change-Id: Ie39ec356b2eb0d14f7ba1b15ab1a6e093a35fd74
2017-08-28Replace use of oslInterlockedCount with std::atomic in bridgesStephan Bergmann3-11/+6
Change-Id: Iad47a01fd283345a2461eaaea50633bf840e5201
2017-08-11convert std::map::insert to std::map::emplaceNoel Grandin1-1/+1
which is considerably less verbose Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b Reviewed-on: https://gerrit.libreoffice.org/40978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-12Supress unused variable warning in gcc arm bridgebrainbreaker1-0/+2
Change-Id: I78c9d6b5e6af73965cb422dfdbaec5a7f9b57fac Reviewed-on: https://gerrit.libreoffice.org/39829 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23bridges: fix Linux/arm for the non-Android caseMiklos Vajna1-0/+4
Change-Id: I8adf22c65515ae23b95e6745c24c41814192811b Reviewed-on: https://gerrit.libreoffice.org/39173 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-06-23android: Fix bridges/ module for building with Clangbrainbreaker3-3/+4
Change-Id: If8bcda3aa8c3a3e46cd98e5ae797486f32db9822 Reviewed-on: https://gerrit.libreoffice.org/39050 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-19Hack to dynamically adapt to __cxa_exceptiom in LLVM 5.0 libcxxabiStephan Bergmann1-0/+20
Change-Id: Ibf6379425d312b2cc2c9d663a65d0e02209f74e4 Reviewed-on: https://gerrit.libreoffice.org/38981 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke7-8/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-14Clean up declaration of __cxa_get_globals in linux_arm bridgebrainbreaker2-5/+21
This is the Linux/arm version of commit 5ba3d1740b03efa394b2d2bf34fb8a8d3db2331d, which did the same for the Linux/x86_64 bridge. Clang rejects the incompatible declarations of the same extern "C" function in different namespaces. This commit redeclares __cxa_get_globals so as to support clang for building Android in future. Change-Id: I4d733d3835d0dea5784701143f4ea1bc5d5ff363 Reviewed-on: https://gerrit.libreoffice.org/38735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-13iOS, adding x86_64 to gcc_iosjan Iversen1-1/+98
Adding support for x86_64 code from Linux Change-Id: Ia75109f0457177a8a5d5022d2de38aaab620a85f
2017-05-30remove duplicate 'using namespace'Jochen Nitschke2-4/+0
Change-Id: I7f8828f677cfb588135ff75c03ffb75895773440 Reviewed-on: https://gerrit.libreoffice.org/38201 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-23loplugin:comparisonwithconstant in bridgesNoel Grandin6-18/+18
Change-Id: I14983a829daf481e31eaa955b0756bda89b87ee1 Reviewed-on: https://gerrit.libreoffice.org/37940 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-18Revert "Fix typos"Stephan Bergmann4-4/+4
This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
2017-05-18Fix typosAndrea Gelmini4-4/+4
Only replaced "iff" with "if" Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581 Reviewed-on: https://gerrit.libreoffice.org/37782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-03remove empty namespacesJochen Nitschke1-3/+0
Change-Id: I3eae0ecc1ffc5500d3c55abc6554822f5432a50a Reviewed-on: https://gerrit.libreoffice.org/37173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-05fix shadow warning with latest clangNoel Grandin1-4/+2
Change-Id: I0640d4e816ba73f900ad21d7603743e0e9695a70 error: declaration shadows a typedef in 'bridges::cpp_uno::shared::VtableFactory' [-Werror,-Wshadow] Reviewed-on: https://gerrit.libreoffice.org/36127 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-04loplugin:redundantinline (clang-cl)Stephan Bergmann1-3/+3
Change-Id: I03a19b599005f6ef25040889a1e1802445ebf430 Reviewed-on: https://gerrit.libreoffice.org/36063 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-26Fix typosAndrea Gelmini1-1/+1
Change-Id: Idbf0aa261b829e83d4c08a2e989a4ced871dc6de Reviewed-on: https://gerrit.libreoffice.org/35616 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-24loplugin:redundantcastStephan Bergmann1-1/+1
Change-Id: Ia7701e84ea87588abb526ad82da659114474bee5
2017-03-23loplugin:redundantcastStephan Bergmann1-1/+1
Change-Id: I1bc2fbe98f24b173cfda4661f812575a2008c792
2017-03-22loplugin:redundantcast find redundant c-style enum castsNoel Grandin1-1/+1
Change-Id: I2dab376d87804521aed6b6bd41ad7762830fa349 Reviewed-on: https://gerrit.libreoffice.org/35467 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03UNO bridges: Remove MSVC 2013 legacy codeDavid Ostrovsky2-30/+2
Change-Id: Ia6f59f825ead50f92ed7a343df0c01f34ce5c6f8 Reviewed-on: https://gerrit.libreoffice.org/23199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-03Fix typosAndrea Gelmini7-7/+7
Change-Id: Iaefa094c82006346897f5563ac3ddcdc60ab68a3 Reviewed-on: https://gerrit.libreoffice.org/34809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-16ios update to make TiledLibreOffice compile/linkjan Iversen2-0/+6
changes needed to make TiledLibreOffice compile/link for ios-simulator. Remark: autogen.input need to have --disable-pdfium due to a missing <Carbon/Carbon.h> Change-Id: I3e1af26d99c35c3c552510f28e13a7e530fca09f Reviewed-on: https://gerrit.libreoffice.org/34145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@libreoffice.org>
2017-02-15Drop :: prefix from std in [a-b]*/Tor Lillqvist18-52/+52
Change-Id: I0422aaf39bbce889c95ed9a81a0784cb03a1badd Reviewed-on: https://gerrit.libreoffice.org/34320 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-02-15Support MSVC 15.0David Ostrovsky1-1/+1
New compiler changes quite some stuff: * Compiler detection done based on different registry key * .NET SDK detection done based on different registry key * Msbuild installation directory changed * Merge modules installation directory changed * SDK number in registry doesn't match the directory name: (registry key: 10.0.14393, directory name: 10.0.14393.0) * Compiler, include and library location directories changed * Architecture specific directory changed: x64 instead of amd64 * Compiler own include directory must be added with -I option * To force usage of SDK 10 (8.1 is selected per default) new switch WindowsTargetPlatformVersion is passed to msbuild, to avoid patching VC project files with this line: <WindowsTargetPlatformVersion><SDK>/WindowsTargetPlatformVersion> Known issues: * Firebird is broken: http://paste.openstack.org/show/594333 Change-Id: I148d7932aff43bbbd07bd493504df974726234c2 Reviewed-on: https://gerrit.libreoffice.org/31279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Ostrovsky <david@ostrovsky.org>
2017-02-12LEAK_STATIC_DATA is always defined for WNTStephan Bergmann2-82/+0
cppu_no_leak and bndchk were remnants from pre-gbuild times Change-Id: Ie9f325c20e39c100b4a7180a9925559f58bcca6b Reviewed-on: https://gerrit.libreoffice.org/34153 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-11LEAK_STATIC_DATA is only ever defined for WNTStephan Bergmann19-76/+0
Change-Id: I1aa7b56b44e5efc8ad407c8d0fe09927f622b5e7