diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-08-09 10:51:22 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-08-10 17:51:27 +0200 |
commit | e2bd5afd726abd5df438b6b821416bd7cf496e4d (patch) | |
tree | d7376196ff0baafaa5904bf454f93974eda87a93 /TEMPLATE.SOURCECODE.HEADER | |
parent | 301b56f92b9058731f76e32604a771cac460693d (diff) |
Make the C++/UNO bridge work to some extent on macOS on arm64
Use the same code as for Linux on aarch64, with minor
additional hacks. But that will not actually work in all cases, as
there are slight differences in the ABI. See
https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
Thus we can drop the use of the lo_mobile_throwException() hack that
was very temporarily used.
The run-time code generation requires use of a new API on macOS to
work: See the use of pthread_jit_write_protect_np() in
bridges/source/cpp_uno/shared/vtablefactory.cxx.
For some reason, with the Xcode 12 betas, when compiling for
arm64-apple-macos, the symbols for the type_infos for the UNO
exception types (_ZTIN3com3sun4star3uno16RuntimeExceptionE etc) end up
as "weak private external" in the object file, as displayed by "nm -f
darwin". We try to look them up with dlsym(), but that then fails. So
use a gross hack: Introduce separate real variables that point to
these typeinfos, and look up and dereference them instead. If this
hack ends up needing to be permanent, instead of having a manually
edited set of such pointer variables, we should teach codemaker to
generate corresponding functions, and look up and invoke them to get
the std::type_info pointer.
When compiling for x86_64-apple-macos, the type_info symbols end up as
"weak external" which is fine.
With this, LibreOffice starts and seems to work to some extent, and
many unit tests succeed.
Change-Id: I05f46a122a51ade1ac7dccd57cb90e594547740e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100408
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'TEMPLATE.SOURCECODE.HEADER')
0 files changed, 0 insertions, 0 deletions