From: | "Mike Frysinger (vapier)" <vapier@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo commit in src/patchsets/gdb/7.6.1: 15_all_gdb-7.6-btrace.patch README.history |
Date: | Sun, 29 Sep 2013 04:00:15 |
Message-Id: | 20130929040005.7761E2004C@flycatcher.gentoo.org |
1 | vapier 13/09/29 04:00:05 |
2 | |
3 | Modified: README.history |
4 | Added: 15_all_gdb-7.6-btrace.patch |
5 | Log: |
6 | Add fix from upstream for building btrace on older systems #473522 by William Throwe |
7 | |
8 | Revision Changes Path |
9 | 1.2 src/patchsets/gdb/7.6.1/README.history |
10 | |
11 | file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gdb/7.6.1/README.history?rev=1.2&view=markup |
12 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gdb/7.6.1/README.history?rev=1.2&content-type=text/plain |
13 | diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gdb/7.6.1/README.history?r1=1.1&r2=1.2 |
14 | |
15 | Index: README.history |
16 | =================================================================== |
17 | RCS file: /var/cvsroot/gentoo/src/patchsets/gdb/7.6.1/README.history,v |
18 | retrieving revision 1.1 |
19 | retrieving revision 1.2 |
20 | diff -u -r1.1 -r1.2 |
21 | --- README.history 3 Sep 2013 02:34:54 -0000 1.1 |
22 | +++ README.history 29 Sep 2013 04:00:05 -0000 1.2 |
23 | @@ -1,3 +1,6 @@ |
24 | +2 28 Sep 2013 |
25 | + + 15_all_gdb-7.6-btrace.patch |
26 | + |
27 | 1 02 Sep 2013 |
28 | + 05_all_readline-headers.patch |
29 | + 10_all_gdb-7.6-cpuid.patch |
30 | |
31 | |
32 | |
33 | 1.1 src/patchsets/gdb/7.6.1/15_all_gdb-7.6-btrace.patch |
34 | |
35 | file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gdb/7.6.1/15_all_gdb-7.6-btrace.patch?rev=1.1&view=markup |
36 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gdb/7.6.1/15_all_gdb-7.6-btrace.patch?rev=1.1&content-type=text/plain |
37 | |
38 | Index: 15_all_gdb-7.6-btrace.patch |
39 | =================================================================== |
40 | From 467f08afd234738fa51fac4262c1eb950e679c47 Mon Sep 17 00:00:00 2001 |
41 | From: Mike Frysinger <vapier@g.o> |
42 | Date: Tue, 3 Sep 2013 02:33:11 -0400 |
43 | Subject: [PATCH] gdb: btrace: fix build errors on older glibc builds |
44 | |
45 | It is possible to have a build of glibc where SYS_perf_event_open is not |
46 | defined (because when the glibc was compiled, the syscall did not exist), |
47 | but have newer kernel headers installed so that linux/perf_event.h is |
48 | available. In this setup, you get a build failure: |
49 | |
50 | ./common/linux-btrace.c: In function 'kernel_supports_btrace': |
51 | ./common/linux-btrace.c:316:23: error: 'SYS_perf_event_open' undeclared (first use in this function) |
52 | |
53 | Update the ifdef check to also see if the syscall is available. |
54 | |
55 | URL: https://bugs.gentoo.org/473522 |
56 | Reported-by: William Throwe <wtt6@×××××××.edu> |
57 | Signed-off-by: Mike Frysinger <vapier@g.o> |
58 | |
59 | gdb/: |
60 | 2013-09-12 Mike Frysinger <vapier@g.o> |
61 | |
62 | * common/linux-btrace.c: Move sys/syscall.h out of the |
63 | HAVE_LINUX_PERF_EVENT_H check and wrap it in HAVE_SYS_SYSCALL_H. |
64 | Also check for SYS_perf_event_open before attempting to buid. |
65 | |
66 | --- |
67 | gdb/common/linux-btrace.c | 7 +++++-- |
68 | |
69 | diff --git a/gdb/common/linux-btrace.c b/gdb/common/linux-btrace.c |
70 | index b874c84..7e20745 100644 |
71 | --- a/gdb/common/linux-btrace.c |
72 | +++ b/gdb/common/linux-btrace.c |
73 | @@ -33,13 +33,16 @@ |
74 | #include "gdb_wait.h" |
75 | #include "i386-cpuid.h" |
76 | |
77 | -#if HAVE_LINUX_PERF_EVENT_H |
78 | +#ifdef HAVE_SYS_SYSCALL_H |
79 | +#include <sys/syscall.h> |
80 | +#endif |
81 | + |
82 | +#if HAVE_LINUX_PERF_EVENT_H && defined(SYS_perf_event_open) |
83 | |
84 | #include <errno.h> |
85 | #include <string.h> |
86 | #include <stdint.h> |
87 | #include <unistd.h> |
88 | -#include <sys/syscall.h> |
89 | #include <sys/mman.h> |
90 | #include <sys/user.h> |
91 | #include <sys/ptrace.h> |