1 |
commit: 947faddaa0c012fe78adaf3fb3d0d1f1fde2be4e |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 6 21:08:45 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 7 23:23:19 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=947fadda |
7 |
|
8 |
app-office/libreoffice: Fix build with LLVM-10 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/713574 |
11 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
.../files/libreoffice-6.4.6.2-llvm-10.patch | 102 +++++++++++++++++++++ |
15 |
app-office/libreoffice/libreoffice-6.4.9999.ebuild | 1 + |
16 |
2 files changed, 103 insertions(+) |
17 |
|
18 |
diff --git a/app-office/libreoffice/files/libreoffice-6.4.6.2-llvm-10.patch b/app-office/libreoffice/files/libreoffice-6.4.6.2-llvm-10.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..4a1ff516029 |
21 |
--- /dev/null |
22 |
+++ b/app-office/libreoffice/files/libreoffice-6.4.6.2-llvm-10.patch |
23 |
@@ -0,0 +1,102 @@ |
24 |
+From 986bd28388df745dd969e7be7c3bda36b2b2cb0e Mon Sep 17 00:00:00 2001 |
25 |
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@××××××.com> |
26 |
+Date: Thu, 6 Aug 2020 10:50:47 +0100 |
27 |
+Subject: [PATCH] ofz#24641 libc++abi __cxa_exception has grown another member |
28 |
+MIME-Version: 1.0 |
29 |
+Content-Type: text/plain; charset=UTF-8 |
30 |
+Content-Transfer-Encoding: 8bit |
31 |
+ |
32 |
+https: //github.com/llvm/llvm-project/commit/f2a436058fcbc11291e73badb44e243f61046183 |
33 |
+ |
34 |
+this is the same problem as |
35 |
+ |
36 |
+commit f4b6f6a8ae60bdec53512728d00853b73fa18500 |
37 |
+Author: Stephan Bergmann <sbergman@××××××.com> |
38 |
+Date: Thu Feb 13 08:40:11 2020 +0100 |
39 |
+ |
40 |
+ Hack to dynamically adapt to __cxa_exceptiom in LLVM 11 libcxxabi |
41 |
+ |
42 |
+ (where the new change to __cxa_exception effectively reverts the change that |
43 |
+ prompted 7a9dd3d482deeeb3ed1d50074e56adbd3f928296 "Hack to dynamically adapt to |
44 |
+ __cxa_exceptiom in LLVM 5.0 libcxxabi") |
45 |
+ |
46 |
+ Change-Id: Iec4ef1dc188bea2223d99b1b7eb8adec636c98e7 |
47 |
+ Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88583 |
48 |
+ Tested-by: Jenkins |
49 |
+ Reviewed-by: Stephan Bergmann <sbergman@××××××.com> |
50 |
+ |
51 |
+so c-n-p that solution here |
52 |
+ |
53 |
+Change-Id: I4475757a766e3ade7b9fcaf6149e535c9f9a4fa4 |
54 |
+Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100209 |
55 |
+Tested-by: Caolán McNamara <caolanm@××××××.com> |
56 |
+Reviewed-by: Caolán McNamara <caolanm@××××××.com> |
57 |
+--- |
58 |
+ .../cpp_uno/gcc3_linux_x86-64/except.cxx | 28 +++++++++++++++++++ |
59 |
+ .../cpp_uno/gcc3_linux_x86-64/share.hxx | 14 ++++++++++ |
60 |
+ 2 files changed, 42 insertions(+) |
61 |
+ |
62 |
+diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx |
63 |
+index e9e861f1c210..25931671f7dc 100644 |
64 |
+--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx |
65 |
++++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx |
66 |
+@@ -150,6 +150,34 @@ void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno) |
67 |
+ return; |
68 |
+ } |
69 |
+ |
70 |
++#if defined _LIBCPPABI_VERSION // detect libc++abi |
71 |
++ // Very bad HACK to find out whether we run against a libcxxabi that has a new |
72 |
++ // __cxa_exception::reserved member at the start, introduced with LLVM 11 |
73 |
++ // <https://github.com/llvm/llvm-project/commit/f2a436058fcbc11291e73badb44e243f61046183> |
74 |
++ // "[libcxxabi] Insert padding in __cxa_exception struct for compatibility". The layout of the |
75 |
++ // start of __cxa_exception is |
76 |
++ // |
77 |
++ // [8 byte void *reserve] |
78 |
++ // 8 byte size_t referenceCount |
79 |
++ // |
80 |
++ // where the (bad, hacky) assumption is that reserve (if present) is null |
81 |
++ // (__cxa_allocate_exception in at least LLVM 11 zero-fills the object, and nothing actively |
82 |
++ // sets reserve) while referenceCount is non-null (__cxa_throw sets it to 1, and |
83 |
++ // __cxa_decrement_exception_refcount destroys the exception as soon as it drops to 0; for a |
84 |
++ // __cxa_dependent_exception, the referenceCount member is rather |
85 |
++ // |
86 |
++ // 8 byte void* primaryException |
87 |
++ // |
88 |
++ // but which also will always be set to a non-null value in __cxa_rethrow_primary_exception). |
89 |
++ // As described in the definition of __cxa_exception |
90 |
++ // (bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx), this hack (together with the "#if 0" |
91 |
++ // there) can be dropped once we can be sure that we only run against new libcxxabi that has the |
92 |
++ // reserve member: |
93 |
++ if (*reinterpret_cast<void **>(header) == nullptr) { |
94 |
++ header = reinterpret_cast<__cxxabiv1::__cxa_exception*>(reinterpret_cast<void **>(header) + 1); |
95 |
++ } |
96 |
++#endif |
97 |
++ |
98 |
+ std::type_info *exceptionType = __cxxabiv1::__cxa_current_exception_type(); |
99 |
+ |
100 |
+ typelib_TypeDescription * pExcTypeDescr = nullptr; |
101 |
+diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx |
102 |
+index e8afe35c4f59..53c8841fbbcb 100644 |
103 |
+--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx |
104 |
++++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx |
105 |
+@@ -108,6 +108,20 @@ namespace __cxxabiv1 { |
106 |
+ struct __cxa_exception { |
107 |
+ #if defined _LIBCPPABI_VERSION // detect libc++abi |
108 |
+ #if defined __LP64__ || LIBCXXABI_ARM_EHABI |
109 |
++#if 0 |
110 |
++ // This is a new field added with LLVM 11 |
111 |
++ // <https://github.com/llvm/llvm-project/commit/f2a436058fcbc11291e73badb44e243f61046183> |
112 |
++ // "[libcxxabi] Insert padding in __cxa_exception struct for compatibility". The HACK in |
113 |
++ // fillUnoException (bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx) tries to find out at |
114 |
++ // runtime whether a __cxa_exception has this member. Once we can be sure that we only run |
115 |
++ // against new libcxxabi that has this member, we can drop the "#if 0" here and drop the hack |
116 |
++ // in fillUnoException. |
117 |
++ |
118 |
++ // Now _Unwind_Exception is marked with __attribute__((aligned)), |
119 |
++ // which implies __cxa_exception is also aligned. Insert padding |
120 |
++ // in the beginning of the struct, rather than before unwindHeader. |
121 |
++ void *reserve; |
122 |
++#endif |
123 |
+ std::size_t referenceCount; |
124 |
+ #endif |
125 |
+ #endif |
126 |
|
127 |
diff --git a/app-office/libreoffice/libreoffice-6.4.9999.ebuild b/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
128 |
index ecae7dbf2c7..6f4a72b4e47 100644 |
129 |
--- a/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
130 |
+++ b/app-office/libreoffice/libreoffice-6.4.9999.ebuild |
131 |
@@ -271,6 +271,7 @@ PATCHES=( |
132 |
|
133 |
# git master |
134 |
"${FILESDIR}/${PN}-6.4.3.2-boost-1.73.patch" # bug 721806 |
135 |
+ "${FILESDIR}/${PN}-6.4.6.2-llvm-10.patch" # bug 713574 |
136 |
) |
137 |
|
138 |
S="${WORKDIR}/${PN}-${MY_PV}" |