summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-13 08:29:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-13 13:41:20 +0200
commit96b3de39bc723ffe0beea278e32b9c858873bfc5 (patch)
tree2d016740a728a446bd51b31065cb0e6a1e39ca9d /bridges
parente6450f1115b8c1f80d6b442cce8b4ee24bcddd02 (diff)
Document that the deleteException hack is only relevant for LLVM 5, not later
Change-Id: I2d93d3d76f2fe5e24e6864725184519c0595076b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100638 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_ios/except.cxx8
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx14
-rw-r--r--bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx8
3 files changed, 16 insertions, 14 deletions
diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx b/bridges/source/cpp_uno/gcc3_ios/except.cxx
index 2ef8ef49b966..58f458da34db 100644
--- a/bridges/source/cpp_uno/gcc3_ios/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx
@@ -267,10 +267,14 @@ static void deleteException( void * pExc )
// size 8 in front of that member (changing its offset from 88 to 96,
// sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
// from 8 to 16); a hack to dynamically determine whether we run against a
- // new libcxxabi is to look at the exceptionDestructor member, which must
+ // LLVM 5 libcxxabi is to look at the exceptionDestructor member, which must
// point to this function (the use of __cxa_exception in fillUnoException is
// unaffected, as it only accesses members towards the start of the struct,
- // through a pointer known to actually point at the start):
+ // through a pointer known to actually point at the start). The libcxxabi commit
+ // <https://github.com/llvm/llvm-project/commit/9ef1daa46edb80c47d0486148c0afc4e0d83ddcf>
+ // "Insert padding before the __cxa_exception header to ensure the thrown" in LLVM 6
+ // removes the need for this hack, so it can be removed again once we can be sure that we only
+ // run against libcxxabi from LLVM >= 6:
if (header->exceptionDestructor != &deleteException) {
header = reinterpret_cast<__cxa_exception const *>(
reinterpret_cast<char const *>(header) - 8);
diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
index 7164b4ecb51c..492c14898977 100644
--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/abi.cxx
@@ -174,16 +174,14 @@ extern "C" void _GLIBCXX_CDTOR_CALLABI deleteException(void * exception) {
// size 8 in front of that member (changing its offset from 88 to 96,
// sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
// from 8 to 16); a hack to dynamically determine whether we run against a
- // new libcxxabi is to look at the exceptionDestructor member, which must
+ // LLVM 5 libcxxabi is to look at the exceptionDestructor member, which must
// point to this function (the use of __cxa_exception in fillUnoException is
// unaffected, as it only accesses members towards the start of the struct,
- // through a pointer known to actually point at the start):
-
- // Later, libcxxabi, as used at least on macOS on arm64, added a
- // void *reserve at the start of the __cxa_exception in front of
- // the referenceCount. See
- // https://github.com/llvm/llvm-project/commit/674ec1eb16678b8addc02a4b0534ab383d22fa77
-
+ // through a pointer known to actually point at the start). The libcxxabi commit
+ // <https://github.com/llvm/llvm-project/commit/9ef1daa46edb80c47d0486148c0afc4e0d83ddcf>
+ // "Insert padding before the __cxa_exception header to ensure the thrown" in LLVM 6
+ // removes the need for this hack, so it can be removed again once we can be sure that we only
+ // run against libcxxabi from LLVM >= 6:
if (header->exceptionDestructor != &deleteException) {
header = reinterpret_cast<__cxxabiv1::__cxa_exception *>(
reinterpret_cast<char *>(header) - 8);
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index e0216ddf3824..60f5f6e40ef1 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -271,14 +271,14 @@ static void deleteException( void * pExc )
// size 8 in front of that member (changing its offset from 88 to 96,
// sizeof(__cxa_exception) from 120 to 128, and alignof(__cxa_exception)
// from 8 to 16); a hack to dynamically determine whether we run against a
- // new libcxxabi is to look at the exceptionDestructor member, which must
+ // LLVM 5 libcxxabi is to look at the exceptionDestructor member, which must
// point to this function (the use of __cxa_exception in fillUnoException is
// unaffected, as it only accesses members towards the start of the struct,
// through a pointer known to actually point at the start). The libcxxabi commit
- // <https://github.com/llvm/llvm-project/commit/674ec1eb16678b8addc02a4b0534ab383d22fa77>
- // "[libcxxabi] Insert padding in __cxa_exception struct for compatibility" in LLVM 10
+ // <https://github.com/llvm/llvm-project/commit/9ef1daa46edb80c47d0486148c0afc4e0d83ddcf>
+ // "Insert padding before the __cxa_exception header to ensure the thrown" in LLVM 6
// removes the need for this hack, so it can be removed again once we can be sure that we only
- // run against libcxxabi from LLVM >= 10:
+ // run against libcxxabi from LLVM >= 6:
if (header->exceptionDestructor != &deleteException) {
header = reinterpret_cast<__cxa_exception const *>(
reinterpret_cast<char const *>(header) - 8);