1 |
commit: 9444dcb0033689a493c681a8f5ce5660bc143df8 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 31 10:16:16 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 31 10:16:28 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9444dcb0 |
7 |
|
8 |
dev-util/edb-debugger: backport gcc-11 fix |
9 |
|
10 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
dev-util/edb-debugger/edb-debugger-1.2.0.ebuild | 5 ++- |
14 |
.../files/edb-debugger-1.2.0-gcc-11.patch | 48 ++++++++++++++++++++++ |
15 |
2 files changed, 52 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-util/edb-debugger/edb-debugger-1.2.0.ebuild b/dev-util/edb-debugger/edb-debugger-1.2.0.ebuild |
18 |
index 9fd3eb915ec..4d27f38f986 100644 |
19 |
--- a/dev-util/edb-debugger/edb-debugger-1.2.0.ebuild |
20 |
+++ b/dev-util/edb-debugger/edb-debugger-1.2.0.ebuild |
21 |
@@ -34,7 +34,10 @@ DEPEND=" |
22 |
${RDEPEND} |
23 |
" |
24 |
|
25 |
-PATCHES=("${FILESDIR}"/${PN}-1.2.0-qt-5.15.patch) |
26 |
+PATCHES=( |
27 |
+ "${FILESDIR}"/${PN}-1.2.0-qt-5.15.patch |
28 |
+ "${FILESDIR}"/${PN}-1.2.0-gcc-11.patch |
29 |
+) |
30 |
|
31 |
S=${WORKDIR}/${PN} |
32 |
|
33 |
|
34 |
diff --git a/dev-util/edb-debugger/files/edb-debugger-1.2.0-gcc-11.patch b/dev-util/edb-debugger/files/edb-debugger-1.2.0-gcc-11.patch |
35 |
new file mode 100644 |
36 |
index 00000000000..68d58b2b90e |
37 |
--- /dev/null |
38 |
+++ b/dev-util/edb-debugger/files/edb-debugger-1.2.0-gcc-11.patch |
39 |
@@ -0,0 +1,48 @@ |
40 |
+https://github.com/eteran/edb-debugger/pull/776 |
41 |
+ |
42 |
+From a46587a77c33256d56077a2d0709291b3ab12505 Mon Sep 17 00:00:00 2001 |
43 |
+From: Sergei Trofimovich <slyfox@g.o> |
44 |
+Date: Fri, 11 Sep 2020 07:57:39 +0100 |
45 |
+Subject: [PATCH] x86-generic/PlatformThread.cpp: avoid non-constant offsetof |
46 |
+ |
47 |
+On gcc-11 edb-debugger build fails as: |
48 |
+ |
49 |
+``` |
50 |
+.../x86-generic/PlatformThread.cpp:332:79: error: 'n' is not a constant expression |
51 |
+ 332 | return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user, u_debugreg[n]), value); |
52 |
+ | ^ |
53 |
+``` |
54 |
+ |
55 |
+The change workarounds by avoiding non-constant expression: |
56 |
+https://gcc.gnu.org/PR95942 |
57 |
+ |
58 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
59 |
+--- |
60 |
+ .../unix/linux/arch/x86-generic/PlatformThread.cpp | 6 ++++-- |
61 |
+ 1 file changed, 4 insertions(+), 2 deletions(-) |
62 |
+ |
63 |
+--- a/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.cpp |
64 |
++++ b/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.cpp |
65 |
+@@ -318,7 +318,8 @@ edb::address_t PlatformThread::instructionPointer() const { |
66 |
+ * @return |
67 |
+ */ |
68 |
+ unsigned long PlatformThread::getDebugRegister(std::size_t n) { |
69 |
+- return ptrace(PTRACE_PEEKUSER, tid_, offsetof(struct user, u_debugreg[n]), 0); |
70 |
++ size_t drOffset = offsetof(struct user, u_debugreg[0]) + n * sizeof(user::u_debugreg[0]); |
71 |
++ return ptrace(PTRACE_PEEKUSER, tid_, drOffset, 0); |
72 |
+ } |
73 |
+ |
74 |
+ /** |
75 |
+@@ -328,7 +329,8 @@ unsigned long PlatformThread::getDebugRegister(std::size_t n) { |
76 |
+ * @return |
77 |
+ */ |
78 |
+ long PlatformThread::setDebugRegister(std::size_t n, unsigned long value) { |
79 |
+- return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user, u_debugreg[n]), value); |
80 |
++ size_t drOffset = offsetof(struct user, u_debugreg[0]) + n * sizeof(user::u_debugreg[0]); |
81 |
++ return ptrace(PTRACE_POKEUSER, tid_, drOffset, value); |
82 |
+ } |
83 |
+ |
84 |
+ /** |
85 |
+-- |
86 |
+2.28.0 |
87 |
+ |