Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/files/, sys-devel/gdb/
Date: Mon, 28 Jan 2019 22:01:10
Message-Id: 1548712853.46f7eccbcb65b1b4b6802480250c153d05854c35.slyfox@gentoo
1 commit: 46f7eccbcb65b1b4b6802480250c153d05854c35
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 28 22:00:25 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 28 22:00:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46f7eccb
7
8 sys-devel/gdb: pull aarch64-musl fix, bug #676620
9
10 Reported-by: eroen
11 Closes: https://bugs.gentoo.org/676620
12 Package-Manager: Portage-2.3.58, Repoman-2.3.12
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 sys-devel/gdb/files/gdb-8.2.1-aarch64-musl.patch | 49 ++++++++++++++++++++++++
16 sys-devel/gdb/gdb-8.2.1.ebuild | 3 +-
17 2 files changed, 51 insertions(+), 1 deletion(-)
18
19 diff --git a/sys-devel/gdb/files/gdb-8.2.1-aarch64-musl.patch b/sys-devel/gdb/files/gdb-8.2.1-aarch64-musl.patch
20 new file mode 100644
21 index 00000000000..70f42df90a9
22 --- /dev/null
23 +++ b/sys-devel/gdb/files/gdb-8.2.1-aarch64-musl.patch
24 @@ -0,0 +1,49 @@
25 +https://bugs.gentoo.org/676620
26 +
27 +From 51b4f73a37c2e7eec31e932fc3c8dae879735f63 Mon Sep 17 00:00:00 2001
28 +From: Szabolcs Nagy <szabolcs.nagy@×××.com>
29 +Date: Thu, 13 Dec 2018 17:47:17 +0000
30 +Subject: [PATCH] AArch64: Fix the gdb build with musl libc
31 +
32 +Including asm/sigcontext.h together with libc headers is not valid. In
33 +general linux headers may not work with libc headers, so mixing them
34 +should be avoided, especially when the linux header defines types that
35 +are also exposed in libc headers.
36 +
37 +In case of asm/sigcontext.h glibc happens to work because glibc signal.h
38 +directly includes it, but e.g. in musl libc signal.h replicates the
39 +sigcontext.h definitions in an abi compatible way which are in conflict
40 +with the linux definitions when both headers are included.
41 +
42 +Since old linux headers or old libc headers may not have the necessary
43 +definitions, gdb has to replicate the definitions it relies on anyway.
44 +Which is fine since all definitions must be ABI stable. For linux apis
45 +that are not available via libc headers, replicating the definitions in
46 +gdb is the most reliable way to use them.
47 +
48 +Note: asm/ptrace.h includes asm/sigcontext.h in some versions of linux
49 +headers, which is just as problematic and should be fixed in linux.
50 +
51 +gdb/ChangeLog:
52 +
53 + * nat/aarch64-sve-linux-ptrace.h: Include signal.h instead of
54 + asm/sigcontext.h.
55 +---
56 + gdb/ChangeLog | 5 +++++
57 + gdb/nat/aarch64-sve-linux-ptrace.h | 2 +-
58 + 2 files changed, 6 insertions(+), 1 deletion(-)
59 +
60 +--- a/gdb/nat/aarch64-sve-linux-ptrace.h
61 ++++ b/gdb/nat/aarch64-sve-linux-ptrace.h
62 +@@ -20,7 +20,7 @@
63 + #ifndef AARCH64_SVE_LINUX_PTRACE_H
64 + #define AARCH64_SVE_LINUX_PTRACE_H
65 +
66 +-#include <asm/sigcontext.h>
67 ++#include <signal.h>
68 + #include <sys/utsname.h>
69 + #include <sys/ptrace.h>
70 + #include <asm/ptrace.h>
71 +--
72 +2.20.1
73 +
74
75 diff --git a/sys-devel/gdb/gdb-8.2.1.ebuild b/sys-devel/gdb/gdb-8.2.1.ebuild
76 index c7a030aa640..57cee06eec9 100644
77 --- a/sys-devel/gdb/gdb-8.2.1.ebuild
78 +++ b/sys-devel/gdb/gdb-8.2.1.ebuild
79 @@ -1,4 +1,4 @@
80 -# Copyright 1999-2018 Gentoo Authors
81 +# Copyright 1999-2019 Gentoo Authors
82 # Distributed under the terms of the GNU General Public License v2
83
84 EAPI=7
85 @@ -93,6 +93,7 @@ S=${WORKDIR}/${PN}-${MY_PV}
86 PATCHES=(
87 "${FILESDIR}"/${PN}-8.2-tinfow.patch
88 "${FILESDIR}"/${PN}-8.2-sparc-fix-syntax.patch
89 + "${FILESDIR}"/${PN}-8.2.1-aarch64-musl.patch
90 )
91
92 pkg_setup() {